Archive for the ‘tips’ Category
Sunday, March 23rd, 2008
I get a kick out of stuff like this. Add this to your .bash_profile to be greeted with the remaining space on your disk.
df -h | awk 'NR==2 {print "Space available " $4}'
This will actually change depending on which version of df you're using (i think). I get ...
Posted in awk, tips, unix | No Comments »
Tuesday, February 26th, 2008
I just bought a 1TB Western Digital drive. I am stoked.
However, I tried to format the drive on my Mac (Leopard) and got the error "File system formatter failed" when I tried to format the disk as MacOS Extended (Journaled). Not cool.
I found this forum thread which suggested ...
Posted in mac, tips | 9 Comments »
Thursday, November 1st, 2007
I ran into an issue trying to get Imagemagick (convert) working on OSX last night. I had compiled libjpeg and installed it, but when I would compile convert, it would not have jpeg support.
I found this post on dzone, which I followed and was able to use libjpeg just ...
Posted in mac, tips | No Comments »
Sunday, July 15th, 2007
I installed CentOS 5 on my VMWare a few days ago. I installed gcc via yum, compiled and installed libxml2. I then tried to install PHP 5.2.3 and received this error:
configure: error: installation or configuration problem: C++ compiler cannot create executables.
It took me forever to figure this out, ...
Posted in linux, php, tips | 2 Comments »
Wednesday, May 30th, 2007
I didn't find any simple ways to determine how hard our mysql database was working, so I whipped this up. It uses a 10 second delay to figure out the queries per second average.
time=10
orig=`mysql -e "show status" | awk '{if ($1 == "Questions") print $2}'`
sleep $time
last=`mysql -e "show status" ...
Posted in mysql, tips | 1 Comment »
Wednesday, May 30th, 2007
I use SVN from the command line a lot. I also hate typing things over and over. I wrote this script to add all files to a repository that are not already in there.
svn status | awk '{if ($1 == "?") print $2 }' | xargs svn add
I ...
Posted in svn, tips | 1 Comment »
Wednesday, April 25th, 2007
When you set up public key authentication, make sure your authorized_keys2 file has the permissions set to 600. If you don't, it's likely that you will still be prompted for your password.
chmod 600 authorized_keys*
Posted in linux, tips | 1 Comment »
Friday, April 6th, 2007
I've always wanted to know how to do this, and for some reason I always had a hard time finding out how. I needed to rollback a change I had committed to my SVN repository.
The way you rollback to an earlier version of your repository is to do ...
Posted in svn, tips | 4 Comments »
Friday, February 23rd, 2007
Barebones list for the things you should be looking for when developing a web app in PHP. Some of it applies to all web apps, not just PHP.
Use HTML_Safe (or a similar javascript stripping library) to check for and remove javascript when you're accepting data that will be output ...
Posted in apache, php, tips | 1 Comment »
Thursday, October 12th, 2006
I saw a post on digg.com about how it's nice to have "pretty urls" that are easy to tell people. While i'm not sure anyone would remember rustyrazorblade.com slash some ridiculous post name, it's nice to have for search engines. Unfortunately, it didn't really go into detail about ...
Posted in apache, php, tips | 9 Comments »