Praise for Fedora 11 “Leonidas”

July 5, 2009 by Bozhidar

I finally decided to dump my Radeon HD2900 video card and X-Fi XtremeMusic sound card, because of the sorry state of the Linux support for them. It’s true that the situation with the Radeon drivers is constantly improving, thanks to the released documentation from AMD, but not as fast as I would have liked. Anyways I got myself a new GeForce 9600GT video card, which is known to be well supported by the free Nvidia nouveau driver and an Asus Xonar DX sound card, also known to be well supported under Linux thanks to the excellent Oxygen ALSA driver.

You might be wondering why I came to install Fedora 11 since I’ve only recently started enjoying an Ubuntu 9.04. Although I was very impressed by 9.04 I decided to try out Fedora 11, because of its much better integration with the nouveau driver(its the default driver for newer Nvidia cards) and the inclusion of ALSA 1.0.20 by default, which contains various improvements in oxygen since 1.0.18(the ALSA version bundled in Ubuntu 9.04). Fedora Core 2 was also the first Linux distribution I’ve ever used so it will always have a special place in my heart.

  • Installation

I downloaded the Fedora 11 32bit edition DVD image and burned it. It booted into the familiar, nice looking and fairly intuitive Anaconda installer program, which we all know and love ;-) The installation went smoothly, nothing fancy about it. The only bothersome thing was the partitioning – although ext4 is the new default file system, it seems that grub cannot boot from ext4 filesystems. The workaround is pretty easy – simply create a small /boot partition to house the Linux images and bootloader files – a couple of hundred MB should be more than enough. I’ve selected for the installation most of the office and productivity tools, some development tools and a couple of database servers. Overall the package selection available with the DVD is excellent. The installation finished in about 15 minutes on my Pentium Dual Core @ 1.8 GHz wtih 4GB DDRII RAM and 500GB SATA2 HDD. Luckily for me Fedora installed a PAE(Physical Address Extension technology extends the address space of 32bit CPUs that support it to 36bits) enabled kernel automatically and I was able to enjoy the whole amount of memory. This was much better that what Ubuntu does(you have to install the server kernel if you want PAE support). The installer properly detected my Win XP installation on the same drive and set up a GRUB entry for it.

  • First impressions

I rebooted my computer after the installation to find that not so much had changed since Fedora 10. The plymouth boot loader looked exactly the same, the initial GDM login screen and the GNOME theme are the same as well. The only difference in the artwork is the wallpaper. This is not an issue though – I personally find the Fedora 10 artwork very appealing.  The boot time was more than that of 9.04, though not by much. The new unified volume control is simple, but functional. Though I personally hate PulseAudio and think it is one of the biggest errors in the Linux history it worked remarkably well on Fedora 11 with my new card. My biggest gripe with it being that it doesn’t support more than stereo output and that it’s so tightly integrated into the distribution that its removal is a rather complex process. All in all I doubt that there is a distribution on which PulseAudio works better than on Fedora. The nouveau driver worked pretty well and for now I plan to stick to it. Video playback with it(even HD) is pretty good, at least on my setup. The update manager had a minor facelift and looks pretty good as well. The addition of newer versions of software such as Firefox 3.5 and OpenOffice 3.1 deserves nothing, but praise. Overall my initial impressions of Fedora 11 were mostly positive.

  • Post installation setup

Fedora bundles only free software by default, so you want in it stuff like proprietary audio/video codecs, flash, adobe reader, ati and nvidia binary drivers, sun java and so on. They are easily acquirable though. There are also things like setting up sudo, zsh, emacs… ;-)   I recommend everyone to have a look at this excellent site I’ve been consulting for years. I want repeat what the guide states, but all you need to get Fedora 11 filled with all the goodies that you probably require is add the rpm fusion repository and issue a couple of yum install commands.  I was a little disappointed to see that Fedora 11 does not have an Emacs 23 package, so I had to build it from source, but this probably want bother a lot of people.

  • Conclusion

Fedora 11 is a solid release full of innovation. Yes, there are some rough edges in this release, but you get to use the newest and coolest technologies the open source world has offer. And you get to use some really nasty stuff like PulseAudio, but nobody is perfect :) I’d heartily recommend Fedora 11 to every casual Linux user and every professional as well, though I’d suggest total beginners to turn to Ubuntu 9.04 instead.

P.S. I did some tests with Fedora 11 on my ThinkPad T61 laptop and have a few things to report for laptop users. First of all the fingerprint reader support in Fedora 11 is simply fantastic. It is basically as good as the one you’ll find in Windows. In the past I’ve used the rather clumsy thinkfinger solution, but what the Fedora developers offers us now is light years ahead of the competition.

Second – the nouveau driver does not support suspend, so if you need suspend you’re out of luck – you need the proprietary binary driver from nvidia.

Third and last – I have no sound which is particularly strange since I had sound on the same laptop with Fedora 10. My sound chip gets detected. When I start some playback the app doing the playback shows in sound preferences, but there is no sound. I assume that maybe pulseaudio is incorrectly outputting to the digital out or something like that, but there are no settings I can change. The old sound settings panel had the option to configure such stuff.

Emulate the behaviour of Return+Shift(insert new line) from popular IDEs(IDEA, Eclipse) in Emacs

May 19, 2009 by Bozhidar

I’m very fond of the ability to insert a new line below the line I’m currently at, and to position the cursor at the beginning of that new line, offered by most IDEs, such as IntelliJ IDEA, Eclipse. It’s usually bound to  Return(Enter)+Shift. Emacs(as far as I know) doesn’t have a function that does this thing by default, but one can easily create one, combining several well known functions in the process and bind that new function to the desired key combination. Here’s the snippet one might have in his .emacs(or other) “configuration” file:

;; insert an empty line after the current line and position the cursor on its beginning
(defun insert-empty-line ()
 (interactive)
 (move-end-of-line nil)
 (open-line 1)
 (next-line 1))

(global-set-key [(shift return)] 'insert-empty-line)

A switch on String idiom for Java

May 4, 2009 by Bozhidar

I’ve always been frustrated with the inability to write a switch on String in Java.  However the enum type introduced in Java 5.0 somewhat diminishes the issue. Read this excellent article on the subject.

Generating X Logical Font Descriptions(XLFD) for Emacs with xfontsel

May 2, 2009 by Bozhidar

Emacs prior to version 23 was unable to use TTF fonts. The type1 fonts that it uses are described by a XLFD line containing all the info about the font – its family, slant, weight and stuff like that. Guessing all of these while trying to find the perfect font for Emacs is boring and the process can the eased substantially with the help of the xfontsel application, which is generally available by default on most Linux installations with X.

The xfontsel application provides a simple way  to  display  the  fonts
known  to  your  X  server, examine samples of each, and retrieve the X
Logical Font Description (”XLFD”) full name for a font.

In other words you simply fire it up, select the properties of the font you need, see a preview of you selection and receice  XLFD line that you can pass to an Emacs Lisp function set-default-font for instance.

I myself am a fan of the terminus font and the XLDF line that I generated with xfontsel looks like that:

“-*-terminus-medium-r-*-*-20-*-*-*-*-*-*-*”

Ubuntu 9.04

May 1, 2009 by Bozhidar

As most of you probably know I generally use Arch Linux, at least at home. Recently the Arch Linux developers decided to drop the support for the ATI Catalyst proprietary video driver and I happen to own a RadeonHD 2900PRO so I was not very happy about this decision. So I thought I might give Ubuntu another try and installed the latest and greatest version 9.04 hot off the press. Here are some quick thoughts of mine about that release.

The installer was very polished. No issues, no complaints. I’d like however to see someday the option to select packages in the default installer.

The boot time was fantastic. Great job, Ubuntu team. I was pleasantly surprised by it. The new artwork looked great as well. Especially the New Wave theme which I simply love(except the issues it has with non-native GTK applications such as firefox, thunderbird). I found the new OSD notifications system good, although it seemed pretty much stolen from OSX :) As Pablo Picasso once said – “Good artists create, great artists simply steal”

The default software selection was decent enough. And there are the rich Ubuntu repos in which you can find almost everything. No worries here.

PulseAudio with OSS is still problematic, but I guess this is to be expected since probably only X-Fi owners use OSS. Flash performance is terrible on the 64 bit version at least. Skype 64bit is buggy as well. This is no fault of the Ubuntu team however. Video performance was satisfactory with Catalyst, though Desktop Effects are still almost unusable with it in the long run.

The overall experience with the system has  been overwhelmingly positive so far. I hope it’ll remain in the same general area. Stay tuned for further updates.

Ruby 1.9.1 is finally here

January 31, 2009 by Bozhidar

Hot off the press read the release announcement for Ruby 1.9.1(the first stable version from the 1.9 series) here.

The best way to implement the Singleton pattern in Java and Ruby

September 29, 2008 by Bozhidar

I haven’t posted anything lately, but I just received my brand new “Das Keyboard” and now I simply can’t stop typing. Recently I’ve been going through some effective technics to implement popular design patterns and I was surprised to see how few people where aware of them. For example since Java 5 the best way to implement the Singleton pattern is simply to use an enum like this:


public enum SomeClass {

INSTANCE;

}

This is possible due to the fact that in Java(unlike in C++ and C#) enums are full-blown classes(although they do not support features like inheritance for example). You get an added bonus when using an enum class – you do not have to worry about serialization – this is handled for you behind the scenes.

And this is how one should implement the Singleton pattern in Ruby:


require 'singleton'

class Some

  include Singleton

end

Through the magic of Ruby’s mix-ins you get a private constructor for your class and an ‘instance‘ method with which you can obtain a reference to the single instance of the class. And best of all – because this library has undergone a substantial degree of testing it is pretty much bulletproof. Things hardly get simpler than that.

The most valuable guides and articles about Git

August 18, 2008 by Bozhidar

Although Git is gaining a lot of momentum these days there are still obstacles to its adoption. One of the most often cited is the lack of good documentation. I agree that there are a lot of resources out there that can seriously confuse people beginning with git, so I want to share here a list of the guides and articles I have found most helpful in my git explorations. So here we go:

The Git Community Book – my personal favourite. A nicely written book, with succinct, but very helpful chapters. The book has one drawback though – it’s not finished yet.

Git QuickStart – if you’re really in a hurry to pick up a trick or two about Git check the QuickStart.

Git Cheat Sheet – the cheat sheet is also a source of highly compressed knowledge about git.

My Git Workflow – a bit more advanced, but extremely enlightening article about the mighty git.

I hope you’ll enjoy these articles and find them helpful.

A nice simple prompt for zsh

July 27, 2008 by Bozhidar

Recently I switched to zsh, after being a bash user for almost 5 years. I was in love with everything in zsh from day one, except one thing – the default prompt. Although zsh ships with several prompt themes, I didn’t like any of them so I looked around a little bit and constructed my own humble prompt. Here it goes:

PROMPT=’[%n@%m %~]$ ‘

In case you’re wondering what this gibberish means:

%n stands for your username(e.g. bozhidar)

%m stands for the first part of your machine’s hostname(you can use %M for the fully qualified name)

%~ stands for the current directory path with your home dir aliased with an ‘~’ (if you want to see the path in its natural form use %d instead)

All of this strange looking character combinations are called “escape sequences” and they have special significance to zsh. The rest of the characters in the prompt definition are represented literally in the resulting prompt. It looks like this(on my machine):

[bozhidar@drow ~/store]$

If you like it simply put the prompt definition like in your .zshrc file. You may want to put a little bit different version of the prompt in the root user’s .zshrc(if you use root at all that is):

PROMPT=’[%n@%m %~]# ‘

This follows the well established pattern that a normal shell and a root shell should be easily distinguished visually.

Using Emacs for Rails development – The perfect setup

July 19, 2008 by Bozhidar

Lately, I’ve started digging more and more into Rails, preparing for the start of a Rails powered project. Although there are some IDEs offering decent Rails support(namely NetBeans, Komodo and Aptana Studio) I have always preferred the comfort of Emacs for various reasons. So naturally I embarked on a quest to setup a suitable environment for Rails development in Emacs. After a couple of days of searching and evaluating possible solutions I finally set up a wordy environment. It consists of a couple of components – ruby-mode, ruby-electric, nxhtml-mode and rinari.

As you probably have guessed by now ruby-mode provides support for editing ruby source files. The mode is pretty feature complete and under active development, headed by none other than Matz himself. You can get it from the ruby svn repository. ruby-electric provides auto insertion of closing braces, quotes, ends, etc. It can also the found in the ruby repo. Instructions how to setup both modes can be found here. Although many people recommend adding pabbrev(a mode which provides auto-completion) to the setup, I don’t recommend it – I find the mode mostly annoying and stick to the old school dumb auto-completion with M-/ .

nxhtml-mode is a pretty comprehensive package for web development in general. We need it for its excellent support for erubis templates(.rhtml, .erb.html) and of course xhtml and css.

rinari is a mode for Rails development – it contains rich functionality such as the ability to easily navigate between models, views and controllers in a Rails application amongst other features. Instructions how to set up rinari together with nxhtml-mode can be found on rinari’s home page.

It’s always a good idea to add ecb(the Emacs code browser) to the mix, though this is entirely optional.

I hope you enjoy this setup and it helps boost your Rails productivity in Emacs!