huh!?

Jan 11 ’10

Installing ArchLinux on laptop

Having had Ubuntu installed briefly on my laptop, I thought it was a bit bloated and wanted something a bit more lean (OK, a LOT more lean) on the machine.

Enter ArchLinux. Having read good things about it, I decided to give it a go. It is a lot more bare bones than many of the other distributions, which aim to be one-click installers. With arch linux, you configure everything, from network to keyboard input drivers, video drivers etc.

It is more time consuming, but it is an excellent way to learn about the building blocks of the operating system. The documentation guiding the beginner through installation and configuration is excellent and very detailed.

First I had to remove the existing Ubuntu installation and prepare for arch. I removed the existing GRUB boot by using the MBRFIX utility to restore the Master Boot Record of the harddrive, so that the machine again booted directly into XP.

I then booted with a Ubuntu Live CD and use the GParted partition utility to delete, create and resize partitions necessary for the installation.

Windows already had two partitions on the disk, and I needed another three, so extended partitions were needed (as a disk can only have four primary partitions).

The partition map then looked like this:

/dev/sda1 -> NTFS (windows drive C:)
/dev/sda2 -> NTFS (windows drive D:)
/dev/sda4 -> ext3 (root)
/dev/sda5 -> ext4 (home)
/dev/sda6 -> swap (linux swap)

The actual installation of archlinux is straightforward, and then there is the matter of configuration. The installer walks you through it step by step, and indicates which configuration files need to be edited, and what the various entries could and should be set to.

According to my naming standard, caffeinux was chosen as the host name of the machine.

The network installation was straightforward with regards to wired networking, but wireless was causing me some problems. A quick bit of googling revelead that I was missing the microcode for the wireless card, and once this was corrected (by choosing the correct package from the core installation disk), the wireless network also was working correctly.

Archlinux uses a package management system (pacman) which makes installing and uninstalling applications a breeze. I decided to try KDE, but found it too bloated as well, so for the moment I am trying a tiled window manager (so far I have looked at ratpoison and dwm). Awesome is also an option. Ratpoison had trouble with dialogs in java apps, showing them as full screen windows, but dwm seems to handle this better. awesome seems to have more features, but is configured with Lua scripts, and I am not sure I want to learn another scripting language just to configure a window manager.

So now I have started installing applications, and have java (openjdk), git, eclipse, ruby, rubymine end emacs installed.

I will try awesome to see what it is like, and the final outcome of the quest to find a decent window manager will result in another post on the blog.

1 note

Dec 22 ’09

ruby 1.9 and unicode strings

I was playing around with some unicode strings to test string handling in Ruby 1.9, and realized a couple of things. Unicode string handling in 1.9 is fairly basic. For instance, the upcase method of a string, only knows how to handle letters from A to Z. I realized this when I was trying to run upcase on a string containing my name (Helge André Gudmundsen), and the resulting string was “HELGE ANDRé GUDMUNDSEN”.

This is by design, as different locales may handle case cases (pun intended) differently.

Stefan Lang has written a gem called Unicode Utils which handles unicode strings nicely. Using this gem I can call:

UnicodeUtils.upcase("Helge André Gudmundsen")

and have my name appear like “HELGE ANDRÉ GUDMUNDSEN”. The methods take an optional locale parameter to make sure specific locales are treated correctly. Installation is simple:

$ gem install unicode_utils

Highly recommended.

Dec 21 ’09

peepcode - bad name, excellent content

I do not like the name of the company, but their content is top notch. Peepcode offer technical screencasts, and although you would think that one hour is little time, the material covered is extensive. $9 for each episode is cheap given the material covered, and there are also bundles and subscriptions making the per-episode-price even lower.

Sep 1 ’09

nesting vim configuration files

I am on a quest to put all my various configuration files under source control, so I now have a folder called ~/dotfiles which contains various configuration files in a git repository. The dotfiles in the home directory simply call files inside the dotfiles folder.

I wanted to do this also for the vim configuration file, but I was not sure what the syntax was for calling a configuration file from within another configuration file. For files like .bashrc or .zshrc, I can use the source keyword, or simply the dot.

It turns out that we can use the source keyword in the vimrc as well, so in my home directory I now have a one-line .vimrc file containing the following line:

source ~/dotfiles/vimrc

Maybe this is obvious to most, but it took me a while to find it out, so maybe this information can be useful for others as well.

Aug 24 ’09

organizing files with leap

While I now try to keep most of my written personal information in a single text file, I have a lot of external reference material (e-books, articles etc.) that reside in folders on my harddisk.

Earlier I have tried to maintain a folder structure where material rests in specific folders based on content.

Lately I have thought about changing this, and to put all the files in a single folder, and organize them with tags instead of putting them in folders. This would allow me to assign more than one tag to a file, and a book like about RubyCocoa could then be tagged with “ruby”, “osx”, “cocoa”.

The best application I have found to organize tagged files is Leap. Instead of folders, I now have predefined searches that allow me quickly drill down to the files that I require. Leap has many more functions also, and allows drill-downs on file dates, types, size etc.

1 note

Aug 21 ’09

Aug 21 ’09
when you don’t create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
— _why the lucky stiff

Aug 20 ’09

insert timestamp with vim

I often find myself inserting timestamps in text documents. I added two quick lines to my .vimrc files that allows me to insert a timestamp using the F3 key:

" Insert timestamp with F3
nmap <F3> a<C-R>=strftime("%Y%m%d %H:%M")<CR><Esc>
imap <F3> <C-R>=strftime("%Y%m%d %H:%M")<CR>

In normal mode, the timestamp is appended at the current position and in insert mode, it is inserted.

I have seen many tips using the date command for inserting the time stamp, but using strftime makes it platform independent.

I found this tip in Swaroop CH’s vim book, which I highly recommend for download.

Aug 20 ’09

personal information repository

I put a lot of information in a lot of different systems. Login info, account numbers, to do lists, work logs, personal journal etc.

In my current quest to cut back on inefficiencies, I am considering switching to a reduced set of tools, one of which would be a personal information repository, which, let’s face it, is a pretentious way of naming a big-ass text file.

Starting today, I am pulling a lot of stuff out of a lot of systems, and dumping them in hagbatf.txt, (Helge A Gudmundsen’s Big Ass Text File.

For now, it is a dumping ground. Eventually some kind of structure will emerge, but for now, the focus is on input.

As a bonus side effect, I will get to hone my vim skills.

Aug 12 ’09

priorities

when your friends die, you realize the stupidity of some of your priorities. what is doubly sad, is that it takes such events to reach this realization. r.i.p. carla