I created a nice little reference document for Vi and Vim. It gives some background and history, and then goes on to explain a few things as well as provide a list of a lot of useful commands for use within Vi and/or Vim. Vi and Vim are very powerful text editors found on any NIX platform. Take a look at these commands and shortcuts and turn your Vi time into a powerhouse of productivity!
Category Archives: How To
PERL Trim Functions
PERL is a wonderful scripting language, it is extremely powerful, flexible and portable. It also lacks a couple basic functions that other languages have built in. Fear not my friend, just like the PERL round function, I have functions for other things as well!
One thing I miss is a trim function. They have chop and chomp, but that doesn’t always fit what I want. Below I have included a few suns that will get the job done nicely, check it out. Continue reading
Veritas Volume Manager Goodness
Hi folks, it’s been a bit since I put anything new up here, life has been real busy lately. To that end though, I have been working on stuff for the site, and I just posted something that I think is very useful. It took awhile to put it all together, but nothing is too good for my visitors.
I have been working with Veritas Volume Manager, now called Veritas Storage Foundation lately. I have worked with it in the past, but not as in depth as I have in recent weeks. I decided to make a reference for myself, since I seem to get into it for a bit and then don’t touch it for awhile because it just runs. Then I figured I would make it as comprehensive as I could, plus easy to read, pretty, etc, and then post it here for anyone and everyone that might find it useful.
I have it on the site in HTML format here, and I also have it up in the downloads section as a PDF if you wan to download a copy. Check it out and let me know if you see anything I missed, I hope you find it useful!
MySQL and the dreaded Error: 1251
Recently I ran into a situation when upgrading from MySQL 4.x to 5.x on a dev box of mine. I actually ran into this a year or two ago too, but I forgot to document it (I know, I know) and so I didn’t remember it. I thought I would post it here now to share with all of you in case you run across it yourself. Once the upgrade was done, the application that connected to the database would connect no longer. I kept getting authentication errors no matter what I did. This was a fresh install, I just imported MySQL dump files for my databases, so I thought it was a setting or something that I had forgotten. I checked everything out and could find nothing wrong with the settings, user accounts, passwords, you name it. The app I was launching ran on Windows (specifically, this is my EQEmu server, check it out daBoneyard), and it’s a console app so the Dos window flies by and I hadn’t seen the error message. Finally I decided to put a pause in the batch file and see what the heck was going on. It was then that I was presented with the following error:
WordPress and Permalinks
If you haven’t ever used WordPress for your website or blog, you don’t know what you are missing. I have used almost every CMS out there, including PHP-Nuke, Post-Nuke, e107, PHPWebsite, CPG to just name a few of the more popular ones. However, once WordPress got past the 2.0 versions, it was all over. I love the WordPress platform and use it for many different websites that I manage. I do sometimes run something other than WordPress if I have some specific need that something else does better, but for a good, solid blog and/or website platform I find it hard to beat WordPress.
That being said, one thing I have seen people have trouble with is Permalinks. This is when you change the link structure from the default style like this:
http://example.com/?page_id=N
to something more visually appealing like this:
http://example.com/category/post-name/
or
http://example.com/year/month/day/post-name
The friendly Permalink option is not only easier on your visitors, but it’s easier for search engines as well to index your site. That means that setting Permalinks to something friendly is a good idea on many fronts. You can set the Permalink style in the WordPress admin panel under Options. However, when you do that you also have to update your .htaccess file (on Apache) in order to process the links properly. I have included below a nice .htaccess snippet that you can drop in to get your Permalinks working, check it out:
# BEGIN WordPress Permalink Rules <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Permalink Rules
I hope that will help in your Permalink adventures!
mysqldump tricks
In a recent post we talked about using the ever more awesome mysqldump command to dump the schema or structure of a table, but not the data. For example, if you want to create a copy of the database with new data.
I thought I might expand on mysqldump and talk about some other useful things you can do with your data. Let’s start by putting this into perspective. Since we are talking about the mysqldump command, obviously whatever we are doing is going to focus on getting data out of the database. Hence the “dump” portion of the command. This can be to backup the database, to clone it or move it, or in development/test/verification situations where you are taking part of the data and doing something with it.