Curing Skype's Ugliness on Ubuntu

Tuesday, April 04

For anyone interested in installing Skype on Ubuntu linux and making it not look like shit, here’s how I did it (ubuntu breezy + gnome, that is).

Download and install Skype using dpkg,

$ wget http://www.skype.com/go/getskype-linux-deb
$ sudo dpkg -i skype_1.2.0.18-2_i386.deb

Go ahead and launch Skype from the Applications/Internet menu (or by typing skype on the console) and notice how ugly it looks while shaking your head in dissapointment. Now close it and prepare for its extreme makeover.

Qt is a cross platform development framework on which Skype is dependent and version 3.2 should already be installed. You will however need to install the qtconfig manager, a theme called ‘polymer’, and using qtconfig, apply said theme. Unless, of course, you are into the ugly look, in which case I urge you to avoid reading on.

$ sudo apt-get install qt3-qtconfig
$ wget http://www.informatik.tu-cottbus.de/~mkrause/debian/polymer/polymer_0.3.2-1_i386.deb
$ sudo dpkg -i polymer_0.3.2-1_i386.deb

When dpkg is finished its dance, launch the qtconfig program in the following manner,

$ qtconfig

Other than making sure you select ‘Polymer’ as the GUI Style under the Appearance tab, you are free tweak things to your heart’s content. I set my font to 9pt sans-serif.

Launch Skype again for the reveal and say a quiet thank-you to these guides:

How have I managed to avoid Skype for this long, I wonder.

RadRails on linux with JRockit 1

Saturday, February 25

Lately, I’ve been using RadRails for Rails development on my laptop (ubuntu linux), and for some reason I find it painfully slow. I decided to google “RadRails performance” and stumbled upon JRockit, an optimized JVM for multiple platforms.

I downloaded JRockit from the BEA site and followed the installation instructions for linux to get it running. So, here’s the quick summary of how I put RadRails on JRockit.

Download the JRockit installer, put it somewhere, and make it executable:

$ chmod +x jrockit-R26.0.0-jdk1.5.0_04-linux-ia32.bin

Now you can run the installer in console mode and it will walk you through the rest of the process. I used the defaults for everthing and just Next’d my way through.

$ ./jrockit-R26.0.0-jdk1.5.0_04-linux-ia32.bin -mode=console

With JRockit installed, getting RadRails to use it is a simple matter of appending the -vm argument when launching it. You can do this directly from the command line, or if you’ve created an icon launcher, you can edit its command:

$ ./radrails -vm ~/jrockit-R26.0.0-jdk1.5.0_04/bin/java

The speed improvement is noticeable, but it’s nothing earth shattering. Still, it saves me a few seconds when I open files—before JRockit it would take ~3-5 seconds to open a file. Now it’s down to about one second which is at least bearable. I’m really starting the feel the hurt of not having TextMate on linux. I think it’s time to bite the bullet and pick up one of those new MacBooks. Now, if I could only convince my wife…

UPDATE: after several crashes and a decision to revert to the default (Sun) JVM, I found Christian Pelczarski’s article on the subject in which he claims “[the] new Sun JVM seems a bit faster than JRockit.” (Granted, his article pertains to Windows, but I figured I’d try it anyways.) I’ve been running RadRails with it for about an hour now; performance is about the same as with JRockit 5, but it’s certainly more stable.

Comfortable, Color CLI

Friday, January 13

Torn as I now am between my iMac and my laptop (Ubuntu linux), I invariably find myself using both: OS X at the desk, Ubuntu on the couch. My brief tenure in linuxland taught me to embrace the CLI (Command Line Interface), and upon returning to mactopia, I find I use the CLI almost exclusively. (That and VIM. I decided early on that rather than waste time learning yet another GUI editor, I’d take the opportunity to learn VIM and promptly fell in love. I’m typing this in VIM right now, even as my TextMate icon stares up at me from the dock.) For me, Linux and Darwin are sufficiently similar that I’m at home on either and I’ve come to respect their subtle differences.

That said, one thing I really liked about the default bash terminal in Ubuntu was its color, so I sought to bring this feature over to my OS X Terminal. Using ls with color makes things faster—colors can tell you about files in ways that ls -F never could. To enable this in OS X (bash), you’ll need to add some options to your .profile:

export CLICOLOR=1
export TERM=xterm-color

The first line turns on color, and the second ensures that your terminal is declared as color capable. While this will work as advertised, it won’t necessarily look very good if you use a dark background. By default, directories are listed in blue, and while this looks good in Ubuntu it’s just too dark on the Mac. For those of us who rock a black background, you might want to change the ls colors.

export LSCOLORS=gxfxcxdxbxegedabagacad  # cyan directories

In the above example, I’m using cyan for directories; this is a fair compromise and looks nice in both OS X and Ubuntu. If you want to know about each of the color codes above, they’re listed in the ls manual (man ls).

For the complete linux effect on OS X, a green prompt will also be necessary. Without getting in the sordid details of customizing your prompt (it’s a long and arduous tale that I’ll save for another article), I offer this:

export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '

When we put it all together, we get a comfortable and portable CLI that looks quite nice, no matter where you’re logging in from.

# colors
export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=gxgxcxdxbxegedabagacad  # cyan directories
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '

Enable CPU frequency scaling in Ubuntu 2

Thursday, November 24

I’ve been using the CPU frequency monitor applet in Gnome to see the speed at which my Pentium-M chip is running, and noticed that it rarely gets up to the 1.6Ghz that it’s capable of. While I tend to prefer the dynamic scaling behaviour when running on batteries, when I’m plugged in I want top processor performance.

I did a little digging and found the answer (where else), in the README (/usr/share/doc/gnome-applets-data/README.Debian). It turns out that the cpufreq applet ships with the SUID bit unset (for security reasons), but you can enable it using by reconfiguring using dpkg-reconfigure:

$ sudo dpkg-reconfigure gnome-applets

Just choose ‘Yes’ to set the SUID bit for the cpufreq-selector executable and you’ll be able to left-click on the applet and set the the CPU frequency manually.

.vimrc

Thursday, November 24

Since I won’t have my iMac for a while, I’ve had to give up my beloved Textmate. In its absence, I’ve been doing most of my Ruby programming in console VIM. Since I’m tired of having to recreate my preferences in .vimrc every time I’m on another system, I’m archiving it here for future reference:

" no war for heavy metal
syntax on           " syntax highlighting
filetype on         " detect the filetype
filetype plugin on  " load filetype plugins

set nocompatible    " turn off vi compatiblity
set nowrap          " don't wrap long lines
set background=dark " I use a black background
set tabstop=2       " Ruby-style tabs
set number          " line numbers
set ai              " autoindent
set si              " smartindent

If you’re new to VIM or are looking for a few sensible defaults for programming, you might want to try these options (put them in ~/.vimrc). Pretty colors, syntax highlighting, line numbers, auto-indents, a small tabwidth, and a few others. Simple. Just the way I like it.