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 while traveling. When I cut back on using it, I noticed a few things.
When I’d leave it unplugged for a few days, the battery would be dead.
tips
- 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 the Twitter libmemcached builds, you won’t even have to change the production server pool. The instance is not restarted, and no data is lost.
- 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 /usr/share/automake-1.9/config.sub . I copied the above files into my jpeg-6b directory, and ./configure –enable-shared –enable-static worked correctly.
- 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 different output on my Mac than I do on a CentOS machine - df seems to auto wrap lines on long drive names, so when I check the space on the CentOS server I need to change the line number (NR goes to 3) and the column to print (down to 3).
- 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 using multiple partitions to solve the problem. When I was trying this, I went into options and changed the partition scheme from Master Boot Record to GUID partition table.
- 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 fine. tar zxvf jpegsrc.v6b.tar.gz cd jpeg-6b cp /usr/share/libtool/config.sub . cp /usr/share/libtool/config.guess . ./configure --enable-shared --enable-static make sudo make install sudo ranlib /usr/local/lib/libjpeg.
- 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, but I had to install the g++ library, then it compiled fine. yum install gcc-c++
- 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” | awk ‘{if ($1 == “Questions”) print $2}’ diff=expr $last - $orig avg=expr $diff / $timeecho "$avg"
- 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 have this saved in my ~/bin folder as “addall”, which I’ve added to the $PATH variable, which gets set in ~/.
- 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*