Archive for the ‘Geek’ Category

Web Directions South 2008

Wednesday, August 20th, 2008

Web Directions South 2008

Web Directions South is fast approaching. I will be chairing a panel on web application frameworks which is sure to be awesome (no really, the panelists rock!). Use the promo code “WDS08-LC” to get a discount on your ticket. Hazaah!

MySQL server-id woes on Redhat/CentOS

Thursday, July 12th, 2007

Problem

You’re trying to set up MySQL database replication and despite having correctly set your server-id on the master and slave you keep seeing the following message in the slave server error log: Misconfigured master - server id was not set.

Solution

Bug #3829 states that you can not set the server-id using the SET GLOBAL command.

But I didn’t do that, I set it in my my.cnf and then reloaded MySQL. Whatevs, nerdz.

After much mucking around this morning I realised that reloading MySQL is roughly equivalent to using the SET GLOBAL command. If I think long and hard enough I suppose that makes sense. So…
service mysqld stop
service mysqld start

A few seconds outage on the production server, but now we’re in business.

Adding a physical disk to LVM in Redhat/CentOS

Friday, June 29th, 2007

Posted here for googlers and for my own future reference. Documentation pulled together from about 4 different sites. Could possibly be sub-titled: “Holy crap, the disk in my VMware installation is too small - it’s split up into 2GB files and using vmware to resize it seems like voodoo”

Problem:

My computer only has 20GB of disk space. I just have 1 partition. I want to add another disk (40GB). I don’t want to add another partition (and I really don’t want to reinstall the whole system), I want to increase the size of the root partition to 60GB. i.e. I want the root partition to span across two physical disks.

Solution:

  1. Add new physical disk. Boot.
  2. # pvscan

    This will show you the current physical volumes.

  3. # fdisk /dev/sdb

    Add the disk to your machine as a primary partition. Partition type: “8e (LVM)”. Obviously /dev/sdb may be different on your system.

  4. # pvcreate /dev/sdb1

    This creates a new physical LVM volume on our new disk.

  5. # vgextend VolGroup00 /dev/sdb1

    Add our new physical volume to the volume group: VolGroup00. Again, this group name may by different for you, but this is what Redhat & CentOS assigns by default when you install your system.

  6. # pvscan

    You should see the new physical volume assigned to VolGroup00.

  7. # lvextend -L+40G /dev/VolGroup00/LogVol00

    This increases the size of the logical volume our root partition resides in. Change the -L flag as appropriate.

We’ve just added 40GB to the logical volume used by the root partition. Sweet as. Now we need to resize the file system to utilize the additional space.

  1. Reboot into rescue mode using your CentOS CDROM.

    From memory this involves typing linux rescue as your boot option.

  2. When prompted, skip the mounting of system partitions.
  3. # lvm vgchange -a y

    This command makes your LVM volumes accessible.

  4. # e2fsck -f /dev/VolGroup00/LogVol00

    Run a file system check, the -f flag seems necessary. No idea what we do if the returns an error?

  5. # resize2fs /dev/VolGroup00/LogVol00

    Without any parameters resize2fs will just increase the file system to the max space available.

Reboot and your root partition is now 40GB lager, spanning multiple disks. Yay.

Speedy iCal Events & To Dos with Quicksilver

Friday, June 8th, 2007

Karl bought a MacBook recently. He asked me if there was a way to quickly add events/appointments into Quicksilver. He gets lots of emails with dates for gigs and wants to be able to quickly add them to his calendar without manually adding them in iCal.

So the idea is that you should be able to copy any semi-sanely formatted date/time and quickly add it to the iCal calendar of your choice and provide an event title.

There are some instructions around, but they’re a little incomplete. They omit the first step which I’m posting here for googlers. Here it is:

Enable iCal Plugin

  1. Invoke Quicksilver, go to Preferences.
  2. Check “Enable advanced features” an relaunch Quicksilver when prompted.
  3. Invoke Quicksilver, go to Preferences -> Plugins. Click “All Plug-ins” on the left, select “Calendar”, then check the “iCal Module”.
  4. Optional Step. After enabling this plugin I was able to disable advanced features and the plugin seemed to remain active.

Now we have the ability to use iCal actions. Sweet. Onto the good stuff.

Creating a New iCal Event

  1. Invoke Quicksilver
  2. Type “.” to invoke text mode.
  3. Type “[date] — [ event_name ]“. e.g:

    Next Friday 1PM -- Beer!

    Note that the double-dash (--) is really important here.

  4. Use the “Create iCal Event” action. (i.e. Hit [tab] to go to the “action” field - then type “event”).
  5. Select the Calendar you want to add the event to. (again, hit [tab] to get to this field).

Creating a New iCal To Do

Exactly the same process as above, but choose the “Create iCal To Do” action.

Date Formats

According to the Quicksilver docs for the iCal plugin, the date can be in the following formats:

2/4/07 3pm (default format)
2007-02-04 (note long year number)
feb 4 (english month names are understood)
friday 12pm (english day names are ok)
next wednesday 13:00 (use next because today is wednesday)
15.2.07 (feb 15th 2007, cause 15 can’t be a month)
3.2.07 (march 2nd 2007!!)

Random Parallels Crashes (3188)

Saturday, March 24th, 2007

For the most part I’ve found Parallels to be really stable for running my Windows XP and Linux virtual machines. However, when I upgraded to the latest version (3188) Parallels started to crash after 10-30 minutes of running Windows XP (in window mode, not coherence).

I think this has something to do with the integration with the Apple Dock. I made the following changes to my Parallels preferences and I haven’t had any crashes since:

  1. Go to the Parallels Desktop menu, and choose Preferences
  2. Choose the Appearance tab.
  3. Un-check the following options:
    • Show applications in Dock
    • Show live screen shot in Dock

Installing Ruby on Rails on CentOS/Redhat 4.x

Thursday, March 22nd, 2007

This doesn’t seem to be terribly well documented, so I thought I’d post it here for those googling for a solution.

Problem

Installing Ruby on Rails on CentOS (or Redhat), the RubyGems part of the official installation instructions (or the instructions listed in this excellent SitePoint book which I’m working through at the moment) may yield this result:

# cd /usr/local/src/rubygems-0.9.2
# ruby setup.rb

< --- lib
/usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:4:in `require': no such file to load — zlib (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:4
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:8:in `require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:8
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:501:in `require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:501
from /usr/local/src/rubygems-0.9.2/./post-install.rb:81:in `require’
from /usr/local/src/rubygems-0.9.2/./post-install.rb:81:in `install_sources’
from /usr/local/src/rubygems-0.9.2/./post-install.rb:116:in `try_run_hook’
from setup.rb:584:in `run_hook’
from setup.rb:1322:in `exec_task_traverse’
from setup.rb:1175:in `exec_install’
from setup.rb:894:in `exec_install’
from setup.rb:712:in `invoke’
from setup.rb:681:in `invoke’
from setup.rb:1359

Solution

A zlib error? Hrm. Double check zlib and zlib-devel are installed (I’m not sure if zlib-devel is needed but I installed it for good measure).

# yum install zlib zlib-devel

Then:

# cd /usr/local/src/ruby-1.8.5-p2/ext/zlib/
# ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
# make
# make install

Next, install RubyGems. Note that running “ruby setup.rb” on it’s own doesn’t seem to work, try this:

# cd /usr/local/src/rubygems-0.9.2/
# ruby setup.rb config
# ruby setup.rb setup
# ruby setup.rb install

All’s good in the hood. Now continue with the rest of the installation.

# gem install rails --include-dependencies

Enjoy.

Community Service Announcement

Monday, March 12th, 2007

It will creep up on you when you least expect it. One, two… nine, ten. Before you know it your face and neck are littered with red circles and you could be mistaken for showing symptoms of a disease which could only be contracted in a part of the world far (far) more exotic than Texas; don’t get me wrong - I really like Austin.

That’s right, it’s fricken Cameron Adams. He’s armed with a short range ink-weapon and he’s coming to a SXSW party near you.

This type of behaviour is normally reserved for the poor guy that’s passed out in the corner of the room. Stamps are the new branding device, stickers and badges are so last year don’t ya know?

Austin

Saturday, March 10th, 2007

It’s pretty cool here. Things seem to be back on track after a major laptop death (Apple replaced the mother-board super quick, yay) and a toilet over-flow in San Fran.

Matt and I were woken up by gun-shots last night. Awesome.

It was nice meeting up with the Aussie SXSW crew tonight. Looking forward to the official kick off tomorrow.

Edit: Ben Brown is the coolest.

Moving Outlook Calendar items to Mac OS X iCal

Tuesday, January 30th, 2007

A few people have emailed me in response to this post, asking me how to move Outlook Calendar Items to Mac OS X. Here are the steps I took:

  1. Open Calendar.
  2. Tools >> Find >> Find
  3. Click in “Look For” field, then hit Enter (this should find all your Calendar entries).
  4. Select all Calendar entries (hint: click on the blue Calendar icon in the left column first).
  5. “Actions” >> “Forward as iCalendar”. (trying to forward more than 1000 seemed to fail - you might have to perform this operation in batches).
  6. Send this email to yourself.

Importing Calendar items is less elegant.

  1. Save all your attached iCalendar files to a folder your Mac can access.
  2. Open this folder in the Finder.
  3. Select all files within.
  4. Drag these files onto your iCal icon in the dock.
  5. iCal pops up a dialogue for each file, asking which Calendar you’d like to import it into. I just held down the enter key. :) Annoying, but much better than paying for 3rd party migration software.

Enjoy.

Rant

Thursday, December 14th, 2006

Digg is dead.

So is email.

Kthxbye.