Archive for the ‘tips’ Category

Textmate – Stop ._ Backup Files

Sunday, February 14th, 2010

Pretty sure this stops TextMate from creating the ridiculous backup files in my network shares. defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1

Linux/OSX: find out what network ports are in use

Tuesday, January 5th, 2010

To get a quick idea of what ports you have open on your local box, you can use nmap. ~ jhaddad$ nmap localhost Starting Nmap 5.00 ( http://nmap.org ) at 2010-01-05 11:06 PST Interesting ports on localhost (127.0.0.1): Not shown: 499 closed ports, 492 filtered ports PORT STATE SERVICE 80/tcp ...

MacBook Air Battery Drain While Sleeping

Friday, December 11th, 2009

I bought a MacBook Air in June this year, refurbished. I didn't really use it a lot for day to day work, and when I didn't use it I was charging it. It was very convenient - it weighs practically nothing and has almost no impact on me ...

Interesting Programmer Links

Tuesday, April 21st, 2009

Peeping into memcached. Really interesting read about how to examine what's stored in memcached. Peep uses ptrace to freeze a running memcached server, dump the internal key metadata, and return the server to a running state. If you have a good host ejection mechanism in your client, such as in ...

Compiling libjpeg on 64 bit Centos

Monday, July 7th, 2008

I ran into an issue just now compiling libjpeg on 64 bit CentOS. I found this very helpful post that gives a workaround using a config.guess file from libtool. For some reason, I didn't have the folder he suggested, but I did have the alternative (automake). cp /usr/share/automake-1.9/config.guess . cp ...

Report space remaining on disk on unix login

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 ...

Western Digital Drive with Leopard – “File system formatter failed.”

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 ...

Compiling Imagemagick on MacOS X – Not finding libjpeg

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 ...

PHP compile error on CentOS Install

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, ...

Calculating the queries per second average in Mysql

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" ...