Excel to Python (with revision control)

My brother recently started programming in Python.

He’s been working as an economist for a number of years, and has spent a fair amount of time in Excel. So he’s familiar with functions and macros. Going back a bit further, he has some programming experience (albeit in BASIC on a Commodore 64) and an appreciation of programming concepts (acquired via his love of video games and fascination with how they work).

Since he lives on the other side of the country, I suggested that we setup a shared code repository so that I can take a look at what he’s working on if he gets stuck, has some questions, or wants some help. He seemed interested in working on something together, especially since he was having trouble deciding what to code.

Ha! As if I have any interesting ideas! 😛

Onto setting up the repository. Personally, I feel that revision control is essential for programming even at the earliest stages. However, learning about it at the same time as learning about programming (and a new language) can be daunting. So I decided to use something that would be easy to understand and use.

I considered using git (which I use for other projects), but there aren’t any good graphical clients for it yet (IMHO). He’s an Ubuntu user and I remembered that RabbitVCS (formerly NautilusSVN) provides a nice GUI frontend to Subversion, so I figured that would be a fine option and a soft introduction to version control.

RabbitVCS isn’t yet included in the Ubuntu package repositories, but there is a .deb package that works well in the latest version of Ubuntu (10.10). Just download the Nautilus plugin from the RabbitVCS Ubuntu installation page. It should load in the Ubuntu Software Centre and install without any problems. (There’s also a Thunar plugin for those Xfce types).

I created the standard basic directory structure and added a few files. So now my brother can check stuff out by right-clicking within a folder window in Nautilus and selecting “Checkout…”. That should bring up a dialog similar to this one:


(click for larger image)

I won’t got into the ins-and-outs of version control here, since I can just direct him to Version Control with Subversion and the Subversion FAQ. Although I will have to email him the repository login details…

Simple SSH authentication with keys

This is for anyone who uses passwords (exclusively) to login to remote machines.

With ever-increasing computing power available to those that want to access your accounts, chances are that your passwords aren’t strong (ie. long and random) enough to represent decent security. You should be using SSH authentication keys. Thankfully, it’s quick and easy to do so!

In a terminal on your (client) machine, generate an private/public key file pair.

If you don’t yet have a key file (usually because you haven’t run ssh-keygen before), run:

ssh-keygen

Otherwise, run:

ssh-keygen -p

Now install your public key on remote servers:

ssh-copy-id -i ~/.ssh/id_rsa.pub user@server

Congratulations! You can now login to remote servers more securely, and without the need for a password! (Although you can choose to encrypt the key using a password – for that extra little bit of security.)

Thanks (and keep being awesome) debian administrator website.

Update: As Jack points out, there isn’t any security benefit if the server still allows password authentication. So either disable it, or set the password to something very long and very random.

Update: Added a note about what to do if you don’t already have a key file.

Clean install of Ubuntu 10.10

I’ve been upgrading my Ubuntu installation since 8.04, and it’s collected a fair amount of cruft. So I decided on a clean install of Ubuntu 10.10. I suppose that this post may be of interest to people planning something similar.

Step 1: Backup

To be honest, I usually ignore this step (and just trust that I won’t overwrite the wrong partition, and that the installer won’t accidentally corrupt files).

Anyhow, this time I decided to backup my entire home directory. Since there are always a bunch of temporary files, I first ran BleachBit to remove unnecessary files. I then used grsync to backup to an external USB HDD. The great thing about rsync is that you can easily (and quickly) verify that everything copied properly by just running it again.

Step 2: Sync

I figured that it would be easier to return all my application settings to normal if I synced my data with an external resource (so that I could later sync the new install).

I considered using Ubuntu One, but it wasn’t really the one-click secure process I had hoped for. It looked like I would need to setup sync for Evolution, Tomboy, and Empathy separately. Also, I hasn’t too happy about sending my data to a third party.

In the end I decided that I just needed to copy my KeePassX passwords database, Evolution contacts, and Tomboy Notes to some storage media. So I copied the KeePass database, synced Tomboy to a folder, and dumped a vCard file with all contacts to the USB HDD.

I also copied the KeePass database to my new Android phone so that I would have the wifi network settings handy immediately after installation (since I wouldn’t be able to install KeePassX before the wifi was setup).

Step 3: Installation

Installation went without a hitch. Rather than burn a CD, I used a 2GB USB stick to create a startup disk (using the handy Startup Disk Creator program included with Ubuntu). Incidentally, the USB drive created is also setup with Wubi for installation under Windows.

Since this is a desktop machine, I decided not to encrypt my home directory. My passwords and such are already encrypted and I’ll use an encrypted partition for other confidential data.

After the initial installation, I had two more reboots in store for me before I had a base setup. The first reboot was to install security updates and the second was to install the NVIDIA proprietary accelerated graphics driver. All reasonable stuff I suppose.

Step 4: Basking in the Glory of a Clean Installation

Sniff. It’s so beautiful.

I had already been using 10.10, but as I mentioned earlier it had collected a lot of cruft (unnecessary programs and files). The new default installation boots quickly, presents a clean login screen, and then loads an empty desktop with Firefox ready to go. Even the shut-down graphics and terminal appear to be native resolution now (1920×1080) rather than low resolution (80 character wide) screens. Ahhh.

Step 6: (re)Sync

I synced some data before overwriting my previous Ubuntu installation, so that I could easily and quickly sync it back into the new installation:

  1. Startup Tomboy and set the sync directory to the folder on the USB HDD
  2. Load the KeePass database so that I can configure my other accounts

Since I have Windows 7 installed on another hard drive, I might move these sync files from the USB HDD to a new shared partition so that I can access them from either Ubuntu or Windows.

Step 5: User Interface Changes

I’m generally pretty happy with the default Ubuntu 10.10 user interface, but I like to make a few minor tweaks.

  1. Install “Advanced Desktop Effects Settings (ccsm)” via the Ubuntu Software Centre
  2. Install “compiz-fusion-plugins-extra” via Synaptic Package Manager
  3. Launch “System > Preferences > CompizConfig Settings Manager”
  4. Enable “Window Previews” under “Effects”
  5. Enable “Grid” under “Window Management”

Incidentally, Grid is the best window management plugin ever. If you use Ubuntu, you should definitely install and use it. It will change your life. Guaranteed.

Step 5: Software Installation

As much as I love the minimalism of a new installation, I need to install a few programs in order to be productive. I won’t go into this in too much detail other than to provide a list:

  1. Ubuntu restricted extras (Java, Flash, Codecs)
  2. KeePassX (Password management)
  3. Inkscape (Vector drawing/illustration program)

Actually, I’ll probably just stop there for now and only install other programs as I run into a need for them. I expect that I may end up installing most of the following (in no particular order):

  1. Gnome Partition Editor
  2. GIMP
  3. MyPaint
  4. ScribusNG
  5. QuickSynergy
  6. VirtualBox OSE
  7. Blender
  8. Getting Things Gnome
  9. Miro
  10. Chromium
  11. Wine
  12. Skype

Step 6: Things Left to do

I still need to setup mail, instant messaging, and social broadcasting services. I also want to put some decent fonts into my .fonts directory and setup by bookmarks toolbar with a handful of my frequently visited sites.

Then I’ll get onto importing photos and videos from the backup. Unfortunately, there doesn’t appear to be a photo-and-video manager under Ubuntu. So I’ll still have to manage videos manually and import them into Shotwell at a later date. I’m also a little bummed that Shotwell doesn’t handle hierarchical tags or tag icons (which I used in F-Spot). Oh well.

Finally, I’ll probably selectively copy other files (documents etc.) as required. Hopefully this install will last another couple of years!

Update: Turns out Evolution can export all its settings (and tasks, events, email presumably) for import into another instance. I probably should have done that.

Tweeting vs. Blogging

I’m concerned that tweeting (which I do most days) is compromising my blogging (which I seem to do only around once a week now).

To a certain degree, blogging is something that requires perseverance. It’s very much like keeping a diary (albeit generally a public one). You need to set aside regular writing time. Writing about what’s happening in your life is a great mechanism for quiet reflection and also a way to organise your thoughts. I’m not a commercial blogger, so I don’t care much for advertising products or self-promotion. I do occasionally write about causes or topics that I’m passionate about, but it’s usually just because they are occupying my thoughts at the time.

I tend not to blog about work or anything too personal, so there are months with no posts back from when work was occupying most of my time (late 2008 to early 2009). I think that it’s a bit of a shame that I have little record of what I was thinking during those times. I like that this blog is a record of my thoughts and memories for the last 5 years, and missing entries probably represent times that I will tend to eventually forget as a result (which may not be a bad thing). Importantly, this blog is a record that I own. I can take it with me if my hosting company goes belly-up, decides to charge for hosting, or starts deleting old content to save space.

Which brings me onto tweeting.

Twitter is definitely better at capturing immediate thoughts and impromptu online conversations. Granted I could post a bunch of very short posts to my blog, but: most people wouldn’t see them until they next visited my site; some people may read my site via a feed reader, but it may take a while for the posts to appear; people wouldn’t be able to respond as easily as on twitter; and it would take a lot more of my time (since the writing interface isn’t as fast).

My main issue with twitter has been that it’s volatile in many ways. For example, they may bork the interface in a future update, or start injecting advertisements, or decide to become a paid service (unlikely), or start deleting old tweets.  I recall reading one day that there is a 3200 tweet history limit, and then another day reading that the federal library is archiving all tweets (as an historical reference). Chances are that twitter won’t be around forever, at least not in its current form as a popular cultural/social online service. Remember myspace, ICQ, geocities, IRC? They’re all around in some way, but most people have moved on.

Still, what’s the point of worrying that my tweets might be lost at some point if the fact is that they would never have existed in the first place if twitter wasn’t around? Also, maybe such fleeting thoughts and inconsequential conversations should be transient anyway. What’s the point or archiving them if you never read them again? There will always be more than enough current posts to occupy your time, without having to live in the past.

Hmmm, this feels a little inconclusive.

I started writing this post because I’ve seen a lot of abandoned blogs, usually written by people who now just spam facebook and twitter. I found it a little sad, and I wondered if I’d end up doing the same thing. After thinking about it, I’m pretty happy with how things are. Sure I write less frequently to this blog, but I write consistently enough to capture key aspects of what I’m up to in my life. I’ve considered installing a twitter archiving plugin, but maybe that’s a vain effort to hold onto communication that should just be enjoyed in the moment.

I guess the only real resolution from all of this thinking and writing is that communication is more enjoyable when it’s participatory. Maybe people abandon their blogs because they don’t get much feedback anymore, and services such as twitter and facebook do more to encourage sharing and comments. I try to counter this by leaving more comments on thoughtful blog posts… I hope that doesn’t make me appear creepy… (you know, when I’m the only one commenting on some stranger’s blog).

Furoshiki

During our trip to Japan in late 2008, Heidi and I bought a couple of basic duffel bags at a 100 yen store. They are made from the same material as the canopy of a modern umbrella, and feature an elegant, minimalist flower pattern. They are perfect for separating clean from dirty clothes, and we take them with us when we go on trips.

We generally also take a whole bunch of cables: a couple of phone chargers, laptop power supplies, and some other connection cables. I have some old bubble wrap that we use to keep them all together. This protects them from damage, and prevents them from shifting around in our bags and becoming difficult to find.

I see a lot of value in lightweight reusable packaging for separation and organisation of groups of items. It’s like putting pencils in a pencil case rather than straight into your schoolbag. It’s neat and tidy, and it makes using the items and then putting them away much easier. Plus you won’t get penl marks in your schoolbag!

Incidentally, I’ve always wondered why there aren’t more standards for containers. Paper comes in standard sizes (eg. A4), so why not boxes? There are bunch of different systems (eg. Tupperware) but, as far as I know, no real vendor-neutral standards.

In the area of travel packing, I’ve noticed that Eagle Creek seem to be targeting that market with the PackIt range of organiser containers. Their concept appeals to me, but their implementation and aesthetics do not. They also seem a little… over-complicated, and I find them rather garish.

Which brings us to Furoshiki.

(Image by katorisi)

Furoshiki are Japanese wrapping cloths, and they can be used to tie up pretty much anything. It’s all about determining a folding pattern that suits the item you want to wrap up. Interestingly, the Government of Japan’s Ministry for the Environment has a guide on How to use Furoshiki.

Here’s an image of their guide:

Intriguing. I imagine that we will be learning a few wrapping patterns, and packing a number of basic square cloths when we travel from now on. I’ve been browsing the designs available at furoshiki.com and they are generally very appealing.

That said, I may experiment with something in between Eagle Creek’s modern products and Japan’s traditional Furoshiki. After all, the duffel bags we bought are more suitable for their purpose than multi-purpose cloths, and that may also be the case for other items. Although, maybe it’s all in the wrapping pattern. 😉

Immediate response

I’ve been pretty bad with replying to people in the past.

Especially when correspondence builds up before I go on a trip (a time when I’m usually very busy) and I have a bunch of people to get back to after I return (when I’m usually still busy). Actually, I’ve still got a list of people to get back to from before my last trip…

A week or so ago I decided that: not having someone get back to you promptly is pretty irritating; I hate it when people do that to me; and accordingly I really shouldn’t do it to other people.

So I decided that I would respond to people immediately.

Phone calls, text messages, emails, invitations – whatever it was, I would respond (not “try to respond”) straight away. It’s been working out very well. I feel more productive, like things are moving faster, and I assume that people appreciate it. Daily life feels that little bit more purposeful too.

I’ve found that the responses don’t need to be perfect, they just need to be prompt. Anything important will be followed up again anyway and you’ll have shared a bit more information. If you need to sleep on something, just send a quick message saying that you will follow-up later (and maybe asking some questions).

I guess it’s all just another way of saying that you shouldn’t put off for later, something that you can easily just do right now. It’s not a new or ground-breaking idea, but it is worth doing. 😉