Mac terminal tips
I still love the power of the terminal and command shell. By default however, the Mac Terminal leaves a little to be desired. Luckily, you can use Terminal to er… fix Terminal. Here are a few handy tips.
Make your terminal window show you your current directory:
export HOSTNAME
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"'
Add some color to your prompt:
export PS1="\033[0;36m\][\u@\h: \w] [\033[0;36m\]\$\[\033[0m\] "
Make your ls commands show directories as color:
alias ls="ls -G"
alias ll="ls -lG"
Just add this into e.g. your $HOME/.bashrc file.
Technorati Tags: osx, mac, terminal
Quite possibly the best stop-mo surfing movie ever
As you know, I like to surf. So this movie stop motion movie really appeals to me! ‘Nuff said.
Technorati Tags: stop motion, surfing, play mobile
Unexpected popularity with C++
You know, blogging is such a strange experience. You try to write stuff that will interest people. You try to have a commentary on popular subjects. But you never know what is actually going to be popular. [Of course, I could be writing about the Twitter outages, but why follow the sheep?
] Take my post on using libcurl with C++. This was something that I threw out there a couple of years ago as a result of a small project on which I was working. Just a throwaway post really.
Currently, it accounts for at least half of the new traffic to my blog and a large number of repeat visitors. It’s even the top result in Google when searching for libcurl and C++.

Who knew!!
And I’m not really a C++ fan. Not that it’s not a useful language, but it’s just not really my favorite. Donnie would be amazed!
So the moral of the story? You can’t always choose that for which you are famous. Or, in this case, what generates a bit of traffic to your blog (but certainly doesn’t count as fame!).
Filed under C++ | Comment (0)Mint Site Statistics Review

For a while now (well, several years) I’ve been using the venerable analog and Report Magic to generate the statistics for my hosted sites. Unfortunately, they have become a little dated in appearance and currency. Nightly reports were fine five years ago, but we live in faster times now!
Enter Mint. A relatively new entrant to the statistics gathering scene, released by the ever present Shaun Inman. Ok, it’s not that new, I’ve been wanting to try it for a while. Version two seemed a good enough excuse. Rather than trawl through your logs after the fact, Mint takes the approach of logging statistics about your site as live as people browse it. That’s pretty common nowadays I guess, pioneered by Google Analytics, with clones like Piwik (an open source competitor) using the same mechanism.
The Good
- The UI is excellent! Orders of magnitude better than the Report Magic reports
- Installation was a breeze, and pretty much driven through the web interface. I had only had to make changes to a single php file before uploading
- Even better, there’s a compatibility suite that will figure out whether your hosting environment is suitable for Mint
- Mint is extremely extensible, something I’m a big fan of, and there is already a thriving community of extensions
- I love the Junior Mint dashboard Widget, which saves me hitting Refresh all the time
The Bad
- The collection mechanism depends on you inserting a custom script link into the HEAD of your pages. This is fine for well structure PHP apps like Wordpress of zenphoto, but more tricky if you have a bunch of static pages
- I find myself wanting to drag and re-order the Pepper containers around all the time, a la “pick your favorite portal”. The mouse icon even turns into a hand, making me think something will happen. Piwik does support this.
- I’d like to be able to “roll up” (think minimize) some of the Pepper containers
- I have session problems from time and time and find myself having to log in again.
Overall, my impression with Mint has been excellent. The UI is great, installation was a breeze, and it’s easily customizable and extensible. What more could you ask for? I do love my Minty fresh stats. And you can’t argue about the beauty of the logo design!
Filed under Technology, Webapps | Comment (0)Mac Screen Sharing via SSH
With Leopard you can now use your .mac account to get back to your home machine using the Back to my Mac feature. However, I’m a little paranoid and don’t like leaving a bunch of ports open on my firewall. I still want to get back to my home machine though and can easily do so using SSH. This is great for most things I need to do, but occasionally I want to actually drive the desktop. This requires a bit more SSH magic:
ssh -L 8888:hostname.yourhost.com:5900 hostname.yourhost.com
will open a local port 8888 and pass all traffic from there to port 5900 on your remote machine. You can now use this to open a screen sharing session to your remote machine.
- In Finder select Go -> Connect to Server
- Then enter vnc://localhost:8888
This will start Screen Sharing and allow you to control your remote mac’s desktop. Neat!
SSH bouncing
The above example was pretty simple and should suffice for most people. However, what if your network setup is a bit more complicated? Let’s say you have multiple machines in your home network, but only one is visible to the outside world (pretty likely if you have just got a single IP from your Internet provider). You can still open a screen sharing connection using some more SSH magic:
ssh -L 8888:otherhostname.yourhost.com:5900 hostname.yourhost.com
this will open a local port 8888 and pass traffic from there to port 5900 on your other machine, bouncing through your first host. Follow all that? Easy really
If you’re wondering how you can address your home machine and don’t want to have to keep remembering your IP address, use a DNS alias service like DynDNS to create an easy to remember name.
Technorati Tags: screen sharing, macos, ssh
Daniel Burka’s FOWD London presentation
I was recently at the FOWD London event, put on by the ever busy Carsonified team. There were a slew of good presentations, of which I haven’t really said much (yet), but one of the standouts was from Daniel Burka of Digg, Pownce and Mozilla fame.
What I liked about the presentation was that although Daniel was actually talking about design, the core principles are exactly the same as those I’ve been pushing in my software teams for a while. They also are extremely reminiscent of the key tenets of Agile development.
Less is More
One of my favorite tenets for software development. My preferred way of stating this is:
A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.
Antoine de Saint-Exupery
This is always the first principle I try to establish with any of my software teams. In Daniel’s parlance, it comes out as “Iteration is subtraction too. Try to remove as much as you add”. For those of us practicing Agile, that might sound like “Refactor, refactor, refactor”!
Build extensible frameworks
The mantra:
Leverage, extensibility and re-use. Todd Papaioannou (yeah, I’m claiming it!)
will be extremely familiar to those who have worked on my projects. By this I mean that a key goal for all software that I build is to continually review whether it is stove piped, or whether it is either a) leveraging other software already out there, or b) someone else can leverage or extend it. Think plugin architectures. Nothing drives me more crazy than people with the NIH attitude wanting to reinvent the wheel. Do you know how many XML parsers/serializers I’ve seen??
In Daniel’s presentation he talks about the difference in Architecture, the High and Low road. His preference is the Low road, which gives you lots of reusable idioms to construct your final product. This is the same message I push in software development. Which leads nicely onto …
Continually Iterate
Again, one of the core tenets of Agile development, this is summed up in the KISS approach. Do the simplest thing first that works, get it out there, and then see if it works. If it doesn’t iterate quickly. Lots of software developers get mired in the mud of trying to build super edifices, when all they need to do is to do something much more simple.
In fact, Iterative design as a means of designing adaptable websites was the general theme of Daniel’s presentation, and I think it’s spot on. You never know exactly how the humans that use your interface, game or software product are going to react, and what they are going to do. That’s a lesson I learnt with running Terafirma. But you have to be prepared to iterate quickly if there is a problem, or a concerted need for improvement.
Here’s the video of the presentation:
From Future of Web Design on Vimeo.
You may also want to follow along with the slides:
[Updated - May 25]
Looks like Daniel has updated his slides for Mesh Conference. They now include a case study of the Digg Comments system.
Technorati Tags: fowd, webdesign, agile, daniel burka
Now built with Marsedit

I’ve recently ditched Firefox as my regular browser in favour of Safari. The consequence of doing so however is that I’ve had to find a new blog writing tool. I used to use the ScribeFire plugin for Firefox (which was great by the way) to write my blog entries. Marsedit seems to get a lot of good press in the Mac world, so I thought I’d give that a try for at least as long as the eval version will let me.
Setting it up for my Wordpress blog was relatively simple, although contrary to the documentation, it didn’t not immediately recognize my blog as such so I had to configure it manually. Pointing the API URL here:
http://www.luckyspin.org/xmlrpc.php
was the main key, as was setting the Blog ID to 1. Now we’re off to the races!
First impressions are good. Writing blog entries is extremely easy, but I’m already missing some of the “extra” stuff Scribefire used to do for me. Like auto pinging blog networks, adding tracking pings to other blogs or easily allowing me to insert technorati tags like this:
Technorati Tags: marsedit, scribefire
Bye bye Firefox (for now)
Fashions come and fashions go, and for now Firefox is falling out of fashion. At least for me. I’m ditching FF 2 in favour of Safari as my default browser. I’ve been using FF for years but of late have fallen out of love with it. My ennui centers mainly around performance and responsiveness of the user interface. Yes, I know it could be down to my plugins, but I run very lean with only a handful of plugins so I don’t believe that is the problem.
The main problem is with startup time as it seems to take an age for Firefox to start and then display a page. Safari on the other hand positively springs to life as soon as I need it. I toyed with Safari as my default browser a while back, but after Leopard came out, it really wasn’t that stable. The new 3.1.1 version appears to have fixed all that, and I’m now extremely happy with it’s stability and performance.
I did try the newest FF 3 beta 5 and that looks and feels a lot closer to what I’m looking for, but unfortunately it handles IFRAMES differently to 2.0, and since I’m constrained to using FF to access our corporate Exchange mail via the web it’s a non starter for me. I can’t really do email in a 100px wide iframe!
No doubt at some point in the future I’ll switch again, probably if my workload skews back towards heavy web development, but for now Safari it is! My biggest gripe? What’s up with the Safari icon?? Time for a refresh me thinks.
Technorati Tags: dhh, startupschool
The Global 5 million
A couple of weeks ago I watched DDH’s presentation at Startup School. It was actually a lot better than I was expecting. The guy has charisma, clearly. There was a lot of really good stuff in it, but the thing that really resonated with me was his characterization of what should be the target audience for a web startup: the Global 5 million. Instead of trying to do a Youtube, why not build a profitable, successful business and enjoy life? Right on! I think it hit the nail square on the head with the problem I have with a whole host of startups out there, even the ones I have worked for. Youtube is a freak occurrence, albeit a great one for the guys who started it. But if you set out with that goal in mind, take a bunch of VC cash and succumb to the pressure to generate 10’s of million in revenue, you’re in for a hiding. It’s something that Ryan has been talking about too.
If you haven’t seen the presentation, check it out:
Watch live video from HackerTV on Justin.tv
Technorati Tags: dhh, startupschool
Time Capsule errors
All of a sudden I started getting errors when backing up to my Time Capsule. Time Machine was only able to to mount the backup drive in read-only mode. Apparently it had got corrupted. No beuno! While I could have followed the recommended approach to format the drive (!) and start again, I didn’t really want to lose my backup history.
First of all I tried good ol’ Disk Utility, but that was unable to repair the disk. It did give me a valuable clue however with this cryptic message:
“Invalid siblings link”
Since this is just a file system, in this case HFS I figured there must be some command line utility to run that could have a go at fixing the problem. Enter “fsck_hfs“, which works in a very similar manner to it’s Linux cousin e2fsck. The only tricky part was figuring out what the path to the drive was, but luckily you can get that from Disk Utility by selecting the drive and choosing Info. In my case, /dev/disk2s2. Putting this all together I typed this into a terminal window as root:
fsck_hfs -r /dev/disk2s2
and waited. And waited and waited! A good 20 hours later fsck_hfs finally announced it had successfully repaired the drive. Whew! Worth the wait I guess.
Technorati Tags: time capsule, apple



