Website debugging in Safari?

Here’s a surprise! Safari includes some comprehensive debugging tools as standard. How do you get it? Just open a terminal and run the following:

defaults write com.apple.Safari IncludeDebugMenu 1

Now, restart Safari, and heypresto!

Ruby on Rails development on Mac OS X (Leopard)

For quite a while now I’ve been developing websites on my MacBook Pro using Ruby on Rails. I’d been waiting for a particular website to move to the live server before I upgraded to Leopard, so that I didn’t have to rely on my laptop for a working Ruby on Rails environment. Recently I got the opportunity to upgrade, and so here I am with Leopard installed trying to figure out how to get a working Ruby on Rails environment again.

Since the release of Leopard, OS X ships with Ruby on Rails pre-installed. However, it’s not in a particularly useful configuration. For a start MySQL isn’t installed, and Rails instead uses SQLite as the default database. Hopefully this will give you some guidance on creating yourself a useful Ruby on Rails environment in Leopard.
(more…)

Ice Skating at Somerset House

Since Vicky and I wont see each other at Christmas, we went to London at the weekend to celebrate then instead.
Somerset House on The Strand has a very atmospheric ice rink at Christmas, not to mention a bar close to hand serving mulled wine and boxes of nibbles! We had a fantastic time, and managed to only fall over once or twice. :D If you’re looking for a festive evening I’d definitely recommend it.

Thankfully I managed to survive the skating without destroying my camera!
(more…)

How to set up a Linux serial console connection

The other day at work I had to set up a console connection between two linux servers via a null modem cable connected to their serial ports. We have some servers that are regularly rebooting themselves, and we have been unable to capture any data from the console until now.

First, connect your servers together using a null modem cable connected to the serial ports.

Next, on the source server you want to run the console from, modify the /boot/grub/grub.conf such that the kernel gets passed the following parameters at boot time: console=ttyS0,9600n8
This configures a console session on the first serial device, with a baud rate of 9600, one start bit, eight data bits, no parity, one stop bit, and no CTS/RTS flow control.

Here’s an example of a complete section of a working grub boot loader:
title Red Hat Enterprise Linux AS (2.6.9-42.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.ELsmp ro root=/dev/rootvg/rootvol rhgb quiet console=ttyS0,9600n8
initrd /initrd-2.6.9-42.ELsmp.img

Add the following line to the /etc/inittab file on the server the console session is running on, making sure the co identifier is not used anywhere else in the file:
# Console connection
co:2345:respawn:/sbin/mingetty ttyS0 CON9600 vt102

Finally reboot the source server.

Once the server is back up, on the second ‘display’ server, open a terminal session and run a piece of software called minicom.
When minicom is running press CTRL-A to open the menu. Press Z to display the help screen. Press O to cOnfigure minicom. Use the arrows to select ‘Serial port setup’ and press enter. Press A to configure the serial device and change it from ttyS1 to ttyS0. Press E to configure the baud rate, and press E again to select 9600. Press enter twice to exit, move down to ‘Save setup as dfl’ and press enter. Move down to ‘Exit’ and press enter.

If needs be, exit minicom (CTRL-A, x) and restart it. Your console connection should now work.

By default, you wont be able to log into this console directly as root. To enable you to do so, edit /etc/securetty and add the new console device to the list (ttyS0). Changes to this file take effect immediately. No need to reboot or restart anything.

“Apple Mail To Do” crashes Mail.app 3.0 in Leopard

Last night there were some problems with the internet. 1&1 had some severe network issues, which in turn caused Virgin Media to lose it’s routing tables to Germany somehow.

Anyway, the outcome was that I couldn’t access my server, or more specifically my mail hosted on my server. Somehow Mail.app got it’s knickers in a twist, and even after access to my server was restored it crashed whenever I ran mail with the following error:

“Some actions taken while the account “xxxxxxx” was offline could not be completed online.

Mail has undone actions on some messages so that you can redo the actions while online. Mail has saved other messages in mailbox “Apple Mail To Do” in “On My Mac” so that you can complete the actions while online.

Additional information: The IMAP command “APPEND” (to Apple Mail To Do) failed with server error: Invalid mailbox name..”

After some fiddling with my mailboxes, I eventually resorted to Google and found the answer on this website. Basically, you open terminal and delete the folder ~/Library/Mail/IMAP-email_address@mailserver/.OfflineCache.
The folder is hidden, hence the reason you need to use terminal and not Finder.

Once you’ve deleted your offline cache, restart mail and all will be fine.

Next Page »