My Mac Development Setup

From powering on a new mac to ready to develop, here's my setup:

Install Dropbox and make symbolic links to all my dot files, .vim,  .vimrc, .zshrc, etc

Install SIMBL

Install a nice, easy to read terminal theme such as this one:

Install XCode

Install Homebrew

    brew install git

    brew install macvim

    brew install mysql

    brew install ack

    brew install imagemagick

install rvm with:

install Ruby Enterprise Edition with 

    rvm install ree

    rvm use default

    sudo gem install livereload # this uses some rubycocoa libraries that aren't in Ruby Enterprise Edition
    sudo gem install compass

    rvm use ree

    gem install rails
    gem install mysqlplus
    gem install compass
    gem install activerecord-sqlserver-adapter
    gem install unicorn

Moving from a case-sensitive fs to a case ignorant one

I'm moving to a new mbp. I've got a time machine backup disk, but it's a case sensitive fs and my new mb is not. I've got a few music files that don't match up perfectly like "Lady Gaga" and "Lady GaGa"....hey, you gotta admit, she's got some catchy tunes.

Anyway, in order to find these and manually copy them over, I drop into the command line and run this:

 
find ./ | tr 'A-Z' 'a-z' | sort -rn | uniq -d 

This will give you a list of all the directories/files that are duplicates of each other in everything but their case. It's up to you after that to move the files to one directory or another.

Mail.app and the case of the "descending order"

So after trying to use the Gmail web interface for a few weeks, I spooled up Mail.app. I like Mail.app. It can sometimes seem like it's syncing with gmail forever, but in general I like the app a lot. When I started it though, I noticed that my emails were all in Date Received Descending order.

Now, I'm really not sure who likes to read mail in Date Received Descending order. It's kinda like reading a book from back to front for me. So dutifully, I clicked the column to sort it ascending. Went to my next folder and found it was descending order also. Clicked - Sorted, next folder..hmmm, okay, I started noticing a pattern. What was even more odd was that when I went back to the first folder, it was once again descending order. I thought I'd fix it by sorting by another column and then back to date. Nope, everytime you leave and come back, it's back to descending order.

In the end, interestingly and unsurprisingly at the same time, it was LCC...or Logitech Control Center. Once that was uninstalled, my mail folders remain sorted the correct way. Anyway, who needs my Logitech mouse now that I have the Magic Mouse :)

2006 Uplander Bearing replacement

It's funny, but I really don't have any Ruby related posts yet, but who knows, maybe this will help someone else.

A few months back, my wife started complaining about a noise her car was making.  Like all car problems, it disappeared the instant I tried to check it out.  Fast forward a couple months, I used my wife's car for an errand.  I couldn't believe the howling it was making.  I quickly checked into taking it into the shop.  I couldn't believe it when the shop wanted to charge me over $600.00 to replace the bearing.  I instantly started calling the auto parts stores and found a replacement bearing for $118.00.  With that price difference, I was committed :)
 
 
Here are the tools I used.  The air wrench definitely helped out quite a bit.  The other tools pictured are a puller.  A socket wrench with a 4 inch extension and a 2 inch extension, a bearing socket obtained from Oreilly's, and a torque wrench.
 
Pull of the tire.  With the tire removed, remove the brake caliper (warning - these bolts are tough to get off!) and remove the nut holding the disc on.

Read the rest of this post »

xRefresh, Firefox soft css updates and SASS

So, I’ve just recently found the excellent tool of xRefresh (http://xrefresh.binaryage.com/). I really wanted the soft css updates to work with sass, but every time I would update my SASS file, the whole page would reload.

So I figured out I needed to exclude it:

xrefresh-server -e '^(\.(log|sass)'

Unfortunately, when I did that, it wouldn’t recognize the changes to the css anymore. I had forgotten that the SASS file is recompiled during the request. I hate to admit it, but it took me a while to figure that out. So, the solution is pretty simple — in another terminal window start the compass watcher

compass watch

Voila…your changes to your css appear without a complete reload of the page!

Setting up Ubuntu 10.4 on Citrix ZenServer 5.5 DomU

This is how I got Ubuntu 10.4 64bit running under DomU on Citrix ZenServer 5.5. I’m not sure if the 32bit version can install in DomU — I’ve been told only the 64bit Kernels include the citrix modules   First off, start out by setting up a new machine.

Next, let the auto partitioner set up the disk, but don’t write the changes yet.
Next, edit the partition table.  Delete the primary partition, leaving the swap.
Next, create a 256Mb primary partition at the beginning with Ext 2 with a mount point of /boot
Then create an Ext 4 primary partition with a mount point of /
Write the changes to disk and continue the install as normal
After the installation, Ubuntu will reboot into HVM mode.  Login and run the following commands  

sudo aptitude update  
sudo aptitude safe-upgrade

Next, follow the instructions I found on http://brettshaffer.com/blog/linux/downgrade-grub-2/ to downgrade Grub2 to Grub1

sudo cp /etc/default/grub /etc/default/grub.old
sudo cp -R /etc/grub.d /etc/grub.d.old
sudo cp -R /boot/grub /boot/grub.old

sudo apt-get purge grub-common grub-pc
-- answer yes to remove grub2

sudo apt-get install grub
sudo update-grub
sudo grub-install /dev/sdX

echo "grub hold" | sudo dpkg --set-selections

  Then set up getty to listen to the hvc0 console

cd /etc/init
cp tty1.conf hvc0.conf

Change all references from tty1 to hvc0 In your fstab, change /dev/scd0 to /dev/xvdd. Reboot into HVM again to make sure the grub install went okay

Look in the /boot directory and copy down the vmlinuz & initrd versions

ssh into the xen console:

find the machine and copy the uuid of it:

xe vm-list

once you have that:

xe vm-param-set uuid=uuid-of-machine HVM-boot-policy=
xe vm-param-set uuid=uuid-of-machine PV-bootloader=pygrub
xe vm-param-set uuid=uuid-of-machine PV-bootloader-args="--kernel /vmlinuz-2.6.31-20-server --ramdisk /initrd.img-2.6.31-20-server"
xe vm-param-set uuid=uuid-of-machine PV-args="root=/dev/xvda3 console=hvc0"

find the uuid of the VBD

xe vm-disk-list uuid=uuid-of-machine
xe vbd-param-set uuid=uuid-of-vbd bootable=true

check to make sure the boot partition is readable

xe-edit-bootloader -u uuid-of-machine -p 1

start the VM – The VM should start in PV mode – Reboot and Shutdown buttons should be active now.

—hint: if you can’t type in the console, you may have to restart citrix center

Login and start an sh shell instead of bash

Mount the xs-tools.iso and install the tools. You’ll get an “Unexpected Operator” message, but the tools install.

sudo mount /dev/xvdd /mnt
cd /mnt/Linux
sudo dpkg -i xe-guest-utilities_5.5.0-466_amd64.deb

Now, the suspend button should be active. Edit the /boot/grub/menu.lst and change the value of indomU to false so that grub will pick up the standard kernels. Also, set the value of groot=(hd0) and update grub again

sudo update-grub

Now, go back to the xen ssh session and clear out the PV-bootloader-args

xe vm-param-set uuid=889ee104-56a7-c5db-677a-f4ec71d63fb8 PV-bootloader-args=

Reboot! Your server should be running in DomU mode and should be booting from the grub menu. When your kernel updates, it will automatically be picked up now and become the default kernel.

I did have some issues with the tools not always starting correctly. I rectified that by moving them back in the boot order.

sudo update-rc.d -f xe-linux-distribution remove

sudo update-rc.d xe-linux-distribution defaults 86

Iphone4 battery life

Not to shabby performance wise, over two days of standby usage with over 7 hours of active usage!

"Hey, things look different!"

Yeah, that's right, things have changed.  Blogging had really slowed down for me just because of the tediousness of prepping articles.  I stumbled up this site Posterous.com and found a solution to my tedium!  I can create entries straight from my phone...and who doesn't have their phone on them 99% of the time nowadays.  Anyway, look forward to more articles.  I don't know if I'll import any of my old articles or not...