CrunchBang is Simply Awesome

I had a half-forgotten netbook lying around collecting dust, running Ubuntu 10.04 faithfully for a few years. It’s a Dell Inspiron 1012 with Intel Atom N450 and 1GB of memory. When I got my hands on it again I thought it was time to revive it for some light tasks around the house, something that I could hand to kids and let them watch You Tube or whatever.

I had been meaning to try out CrunchBang for a while now but always did it in VMs. This was my chance to try it out on “real” hardware. I got a 64-bit ISO downloaded, dded it to a USB flash drive, and booted the netbook with it.

The install was very simple and fairly fast. I overwrote the whole disk (after backing it up, of course) and the installer went on its merry way. After the installation completed it ran the cb-welcome script automatically, asking a bunch of questions to configure the system or install additional packages. After running updates and a reboot the netbook was ready to use.

CrunchBang is awesome because it’s Debian at its core with a functional desktop based on Openbox. It can take some getting used to because it doesn’t exactly function like a DE new users are used to. However, the keyboard shortcuts presented right on the desktop are a great starting point. And don’t get me started on the awesomeness that’s the low memoery usage. Less than 125MB after login is exceptional on this machine.

I made a few tweaks: auto-login (hint: edit /etc/slim.conf); reduce virtual desktops to a single desktop (hint: edit ~/.config/crunchbang/rc.xml); make DuckDuckGo the default search engine in Iceweasel (Firefox). Everything else is mostly default stuff.

I am beginning to think I may use this revived netbook for more things than just a plaything for the kids. All thanks to the awesome work of Debian and CrunchBang.

The Importance of a Pleasurable User Experience

I’ve been thinking of getting myself a Raspberry Pi and configuring it to be my home network wireless gateway. While researching all the hardware pieces to get I thought I should try to decide on a Linux distribution. That quest prompted this post.

I’ve been using Fedora 19 with KDE for a good while now in an ESX VM. It does all the things I need and then some. But beyond that it’s been a pleasure working with it. I love the organized output yum provides. Other features like delta rpms and yum ps are also useful and just nice. I find the systemd user experience to be fantastic. It’s easy and simple to use. SELinux hasn’t bothered me so far. I can’t wrap my head around firewalld just yet but it stays out of my way as well. Fedora’s policy of sticking to upstream defaults means I get a purer upstream experience in an integrated distro. This is not always a good thing because KDE really has cumbersome or missing default settings. But once set up properly, KDE just runs and runs. I am in a Windows environment at work and RDP is just natural to use. Fedora 19 with KDE runs well enough over RDP using the xrdp package. I do get some harmless(?) error messages when first logging in over RDP but my work continues unabated.

With the release of Fedora 20 Beta I decided to give GNOME a try. My first impression is that it has a really good design for the shell, albeit on the minimalist side, and has great keyboard shortcuts. Some default settings don’t make sense to me but exploring gsettings has fixed some of the ones I care about. For the kind of work I do I have found GNOME Shell 3.10 to be an absolute pleasure to work with. It stays out of my way and I can focus on the things that really matter. Unlike all the hoopla about “power users” disliking GNOME Shell’s minimalism I found it to be very refreshing.

Coming back to Raspberry Pi, I’m quite comfortable with Fedora these days. In fact, when I use CentOS 6.4 I miss a lot of the things I’ve gotten used to in Fedora. So my first choice for RPi is Fedora, or Pidora, the spin specially made for it. The downside is that Pidora is tracking Fedora 18 and I want something new. I had hoped Fedora 20 would support RPi out of the box but can’t find any information on it.

My second option for RPi is Raspbian, a spin of Debian. Having gotten used to yum and systemd I find apt-get/aptitude and /etc/init.d to be far less pleasurable to work with. They get the job done equally well but I don’t like using them all that much. It’s just a matter of preference. I tried to dabble with creating deb and rpm packages and my initial take was that rpm is easier to create and manage. I’ll keep Raspbian as a second option for my RPi because I have experience with Debian. But I’d also like the Debian project to focus a bit more on making their tools more “fun” to use. Adopting systemd will be a good first step.

Ubuntu isn’t an option for RPi since they don’t support it just yet. I installed Ubuntu 13.10 in a VM to see how much it has changed since 12.04. I have to say the first thing I did was disable online searches in Dash, remove the Amazon icon from the launcher, and enable workspaces. These three things mean that Unity is no longer the same pleasurable experience it was in 12.04. Having used GNOME Shell 3.10 I missed the HUD but Unity’s “feature” of hiding the menu items became annoying quickly. It wasn’t so when I used 12.04 but KDE and GNOME Shell have made me realize you don’t really need to hide menu items even if you have HUD.

Ubuntu also has the issue of Upstart. It’s great to be able to use start/stop commands but not all services recognize them. I have to use start/stop, /etc/init.d, or service to start or stop my services. There’s no single method to do so. Enabling and disabling services is also cumbersome. I also dislike the policy of starting services right after installing or upgrading. Given these issues I find Ubuntu to not be a pleasurable experience anymore.

openSUSE 13.1 released today and it has some great things going for it. I haven’t tried it out but it’s because of one main thing: YaST. At the core of my being I find YaST to be a redundant tool for a lot of things, especially networking, firewall, and package management. I’d be very happy to skip YaST and just use CLI tools to manage most core things. I find those tools to provide a better experience than YaST’s CLI. I asked Jos Poortvliet, openSUSE’s community manager, on Twitter whether YaST was necessary and he said it wasn’t. I’ll take his word and try out openSUSE again, especially since they have a special build for RPi. I’ll revise my stance and make openSUSE my first choice for RPi. Maybe YaST will be helpful in creating my wireless gateway.

I also tried out Arch for the first time. It took me about 3-4 hours to make a customized list of steps to do a UEFI install as well as a BIOS install in a VM. I can say with all honesty that it wasn’t hard to install Arch at all since the wiki is so helpful. The wiki could be better but it’s still very useful. I thought that Arch’s simplicity and DIY nature would be a perfect fit for my RPi. I can install only the things I need and nothing more. I was excited.

And as I configured my VM further I realized I really have to do everything myself. Even the useradd command needs all the flags, compared to Fedora where you just provide the username. This brought me to my first crossroads: do I really want to create my own distro (so to speak) or have fun with setting up a wireless gateway? I think I’ll choose the latter. I want a distro to work out of the box which I can then use to do things other than creat emy own version of a Linux distro. Arch is a pleasure to use if you want to learn Linux but a burden if you want to use Linux to build something. I also feel like I want to go beyond re-inventing the wheel every time I do a new install, instead I want to build on top of the thousands of hours volunteers have spent building a solid distro, be it Fedora, openSUSE, Ubuntu, Debian, or whatever. I want to build a solution not a distro. I’ll still keep Arch as a candidate for my RPi because its simplicity is a very compelling factor.

So there you have it. I have tried to describe a pleasurable user experience by intertwining reviews of different distros with my needs for a wireless gateway using RPi. I find Fedora to be the most pleasurable distro today. It represents the hard work of a lot of upstream contributors in a package that’s friendly. It may not be the distro for new users but if I’m setting up a system for someone new to Linux, and I had to provide support for it, I’d use Fedora. For my RPi I’ll use openSUSE, Pidora, Raspbian, and Arch in that order. I’ll stop when I find the most pleasurable distro for that use case.

Wait and watch on systemd

I have been pondering the systemd situation for a while. My biggest concern has been that Debian and Ubuntu have not made decisions to adopt it as default, especially when Fedora, OpenSUSE, Mageia, and others have. Maybe Red Hat Enterprise Linux (RHEL) 7 will include it as well. So it seems like on the init system level, two fragmented groups are emerging: those who use systemd and those who don’t. My second concern is the ability for a casual/intermediate user to transition from a systemd-using system to one that doesn’t use it.

I have finally decided, after a long period of thinking, forecasting, etc., that I will use Ubuntu for the foreseeable future. This means that whether other distributions adopt systemd or reject it does not have much of an impact on me. If Ubuntu decides to adopt it then I’ll simply start using it. But I won’t worry about the fragmentation because it should not and does not matter to me. And it also shouldn’t matter to you either. Here’s why.

Ubuntu has been making big strides recently in adoption and popularity. More often than not you’ll find Ubuntu being deployed wholesale by organizations all over the world for desktop use. Google also uses a customized version within its own organization. Granted, Ubuntu is not as well adopted as RHEL on servers but it’s adoption is increasing at a rapid pace nonetheless. All this makes Ubuntu a viable alternative in the present and future.

Canonical, and by extension Ubuntu, sometimes does really annoying things. They have made me question my loyalty to the distribution many times. Not adopting systemd for 12.04 was one thing but to reject it outright, as Mark Shuttleworth did, did cause a bit of panic. But I overcame the systemd decision like I did other decisions because I support the diversity in the level of influence a distribution has over the future of Linux. RHEL has a big say in how organizations use Linux all over the world. Fedora, by extension, has the same influence because it prepares the technology of tomorrow. There’s a need for an equally influential player, Ubuntu in this case, to counter that excessive influence, not because RHEL is “evil” but because healthy competition is good.

Given the future viability of Ubuntu and the need to have another influential player, the fragmentation does not matter for those using Ubuntu exclusively. As long as you and I and millions more are using Ubuntu, any technology it uses to build itself is a viable and successful technology. So what if Ubuntu uses AppArmor instead of SELinux and Upstart instead of systemd? Both AppArmor and Upstart do their job and work on millions of installations.

The day when Ubuntu adopts systemd or SELinux I will happily use them. It’s not because Ubuntu can do no wrong but because I trust Ubuntu to make a better decision for millions of users than I can.

P.S. Ubuntu is not just a product. It’s a collection of people who care about FLOSS, Linux, and users. They are led, capably in my opinion, by Shuttleworth. And by joining the Ubuntu bandwagon I ensure that the product and project succeeds resulting in the success of many others tied to it.

Politics and Pragmatism in Using Linux Distributions

Recently I’ve been making decisions on which Linux distribution deserves my support when I write how-to or similar articles. I started my journey with Ubuntu. Out of all, this is the distribution closest to my heart and may be it always will be. I ventured into CentOS for work-related reasons and found it to be a workhorse. I forayed into Fedora on a netbook with some success. I have had to use a bit of SLES for more work-related stuff. And I have been attracted to, used, and migrated businesses to Debian. Both politics and pragmatism have played a part each time I used a distribution. And thus this post.

You can see from my recent posts that I have made a decision to go with Fedora. It was mostly for political (philosophical) reasons but also for pragmatism (cutting-edge technology, etc.). When the time came for me to choose something other than Debian or Ubuntu, I chose Fedora over openSUSE mainly for philosophical reasons. And I’ve been re-evaluating my decision ever since.

I am very happy I picked Fedora. It’s making bold decisions in the future direction of a Linux distribution, especially with the two most controversial and highly-debated steps: /usr unification and systemd. I have started using Fedora 17 alpha and find systemd a joy to use. I only care about systemctl enable/disable or systemctl start/stop as a user (or sysadmin) and it does exactly what I want it to. Much better than chkconfig, service or invoke-rc.d. The /usr unification hasn’t affected me so much so far. Package availability has also been excellent for the server use cases to which I have put Fedora 17.

Fedora seems like a good fit for me for now. But a second question still remains: which distribution should I recommend to others for home/workstation use when asked? My gut feeling is Ubuntu because they do a lot of good work for this sort of user. I’m also well-versed in it so I can provide ample support if required. But I also want to provide a different answer for users who don’t want to use Ubuntu. A very valid answer for this would be Linux Mint but it’s so similar to Ubuntu that it might not be an option in some cases. This leaves a few distributions that I would really like others to use (if only because they’ll come to me for answers most of the time).

The first distribution is openSUSE. Yes, I have some misgivings about the whole openSUSE, SUSE, and Microsoft triangle. But purely on technical merits is openSUSE good enough to replace Ubuntu as my default recommendation for others? This is a question I have asked myself and the one I’ll try to answer over the next few months. I’ve decided to be pragmatic about this particular case rather than political. I’m willing to be pragmatic if openSUSE can bring in new users to Linux like Ubuntu has done for a while. It’s a tall order but openSUSE looks like a good candidate from where I stand.

The other distribution I may recommend is Mageia. It’s on its way to the second release. These people have a very pragmatic, user-centric approach to their distribution and them being a community allays many misgivings I have about openSUSE. Technically they also appear to be sure-footed and thus deserve the support of people like me. Maybe Mageia can serve Ubuntu’s role of bring new users to Linux.

I wouldn’t recommend Fedora because of two things: (a) hardware support can mean using other repositories (such as RPMfusion); and (b) it’s too bleeding-edge to keep users on it for a while without too many issues.

Now that I have to give up my moral high ground, how does it feel? Very liberating, actually. When I use FreeBSD license instead of GPL, I consider the freedom of people over freedom of code. So why should I take such hard stances when it comes to Linux? People should matter more than code or a distribution. If Ubuntu or openSUSE are not ideal Linux ecosystem participants, they are productive and willing participants nonetheless. It may be about time I gave up on idealism and focus more on doing good for more people.

Generate HTML and PDF from DocBook in Debian

DocBook is a widely-used format for writing documentation, articles, books, etc. For my purposes, I needed to generate XHTML and PDF files from documentation in DocBook format on a Debian Wheezy server.


You need to install the following packages.

sudo aptitude install xsltproc docbook-xsl-ns docbook5-xml

Convert single DocBook file to XHTML

Now comes the conversion. Run xsltproc as below and it will create an HTML file (mybook.html in this case) in the current directory.

xsltproc -o mybook.html /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/xhtml-1_1/docbook.xsl mydocbook.xml

You can explore the /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/ path for more options.

Convert modular DocBook file to XHTML

You can create a modular DocBook document (a book in my case) by separating out chapters of the book into separate files and including them in the main file. For example, there’s only one chapter in my book so I’ll have two files: and docbook.chapter.xml. These two files would look something like the following:

An example of file

<?xml version="1.0" encoding="UTF-8"?>
<book xml:id="wikiply_doc" xmlns="" version="5.0" xmlns:xi="">
    <title>Sample Book</title>
            <para>Copyright 2011-2012 Code Ghar. All rights reserved.</para>
            <para>Redistribution and use in source (SGML DocBook) and 'compiled' forms (SGML, HTML, PDF, PostScript, RTF and so forth) with or without modification, are permitted.</para>
    <copyright><year>2012</year><holder>Code Ghar</holder></copyright>
    <xi:include href="docbook.chapter.xml" />

An example of file docbook.chapter.xml

<?xml version="1.0" encoding="UTF-8"?>
<chapter xml:id="installation" xmlns="" version="5.0" >
<title>Sample Chapter</title>
    <section xml:id="sample_chapter">
        <title>Sample Chapter</title>
        <para>This is example text in sample chapter</para>

Run xsltproc as below and it will create an HTML file (mybook.html in this case) in the current directory from both files.

xsltproc -xinclude -o mybook.html /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/xhtml-1_1/docbook.xsl

Note the use of the -xinclude flag in the command and the xi:include XML tag in the file. These two things make the magic of modular DocBook possible.

bash alias

Since I work with a DocBook book often, I have created a bash alias as below:

alias dbtohtml="xsltproc -xinclude -o /home/codeghar/book/mybook.html /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/xhtml-1_1/docbook.xsl /home/codeghar/book/; sed -e 's/</\n</g' -e 's/<meta name/\n<meta http-equiv="Content-Type" content="text\/html; charset=utf-8" \/> \n <meta name/g' -i /home/codeghar/book/mybook.html"

The generated file does not have the HTML meta tag to identify it as UTF-8 and so space characters display as the character  in the web browser. Therefore, sed is used to enter the appropriate meta tag in the file.

Convert DocBook to PDF

Using the same example files ( and docbook.chapter.xml), we will create a PDF instead of an XHTML file.

You need to install Apache FOP.

sudo aptitude install fop

Next you need to create an intermediate file ( as below.

xsltproc -xinclude -o /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/fo/docbook.xsl

Finally, run the following command to create the PDF file:

fop -pdf mybook.pdf

Hat Tips

DocBook Ubuntu Documentation; How to generate pdf from docbook 5.0; Getting Started with Docbook Book Authoring on Ubuntu; Writing Documentation; Playing With DocBook 5.0

Automated Customized Debian Installation Using Preseed

I’ve always wanted to create a custom Debian installer CD with a preseed file for automated installation. This post is the first step in realizing that dream. There are many steps and details involved in the process but creating a CD with a preseed.cfg file is the easiest because it’s repeatable step-by-step. So that’s where I start my quest.

I tested these steps using a Debian Squeeze 64-bit VM. I downloaded the daily Debian testing netinstall ISO image to use for customization. Therefore, the steps may need to be altered based on the contents of the downloaded CD.

Install required software

I found that I needed the following packages to create my customized Debian installer. You may need to install some of the other required packages based on your installation.

sudo aptitude install curl
sudo aptitude install rsync
sudo aptitude install genisoimage

Create directories

You will need to create some directories for your work. I like to create them all at once.

cg@codeghar:~$ mkdir cgdeb
cg@codeghar:~$ cd cgdeb
cg@codeghar:~/cgdeb/$ mkdir iso loopdir isofiles workspace

Download testing installer

cg@codeghar:~/cgdeb/$ cd iso

The URL used here may not always work. Your best bet is to download directly from Debian FTP/HTTP site.

cg@codeghar:~/cgdeb/iso$ curl -o debian-testing-amd64-netinst.iso

cg@codeghar:~/cgdeb/iso$ cd ..

Mount installer ISO and extract files

cg@codeghar:~/cgdeb$ sudo mount -o loop iso/debian-testing-amd64-netinst.iso loopdir
cg@codeghar:~/cgdeb$ rsync -v -a -H --exclude=TRANS.TBL loopdir/ isofiles/
cg@codeghar:~/cgdeb$ sudo umount loopdir
cg@codeghar:~/cgdeb$ chmod u+w isofiles

Extract initrd.gz

You need to add your preseed.cfg file to initrd.gz so you first need to extract it.

cg@codeghar:~/cgdeb$ cd workspace
cg@codeghar:~/cgdeb/workspace$ gzip -d < ../isofiles/install.amd/initrd.gz | cpio --extract --verbose --make-directories --no-absolute-filenames

Create preseed.cfg file

You can create the preseed.cfg file in the workspace directory. You can look at the Debian Squeeze preseed example file and customize it for your needs.

cg@codeghar:~/cgdeb/workspace$ vim preseed.cfg

Create new ISO

Create a new initrd.gz and replace the original one with it.

cg@codeghar:~/cgdeb/workspace$ su -c 'find . | cpio -H newc --create --verbose | gzip -9 > ../isofiles/install.amd/initrd.gz'

cg@codeghar:~/cgdeb/workspace$ cd ../isofiles

cg@codeghar:~/cgdeb/isofiles$ chmod u+w md5sum.txt

Create new md5sum.txt file with updated MD5. You may see an error “find: File system loop detected; `./debian’ is part of the same file system loop as `.’.” but it seems harmless and may be ignored (please correct me if I’m wrong).

cg@codeghar:~/cgdeb/isofiles$ md5sum `find -follow -type f` > md5sum.txt

Finally, create the new customized automated installer ISO.

cg@codeghar:~/cgdeb/isofiles$ sudo genisoimage -o debian-testing-amd64-netinst-custom-preseed.iso -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/ .


You can burn the ISO to a CD and install from there. When using the installer, use command line install NOT GUI install because we only modified the command line initrd.gz. If you want to use GUI install, I assume you would need to add the preseed.cfg file to that initrd.gz as well.

Hat Tips

This post would not have been possible without the following resources.

Debian-Installer: How to modify an existing CD image to preseed d-i; Automating the installation using preseeding; Debian Remaster Netinstaller – Integrate Firmware bnx2x and Preseed; Genisoimage – Creates ISO-9660 CD-ROM filesystem images

I’m back home with Debian

I have been struggling with my conscience recently over using Ubuntu as a server. From a technical perspective, it’s an excellent choice. It has regular releases, can be both stable and cutting edge, has thousands upon thousands of packages, supports a lot of hardware, has a very pragmatic approach to enterprise server requirements, and much, much more. With all these benefits Ubuntu has been a favorite of mine for a long time. But recently I have been thinking more philosophically.

At its very core Ubuntu is still Debian. Without Debian, Ubuntu would lead a very crippled life. A vast majority of packages in Ubuntu have their origination in Debian. They would have a huge hill to climb if Ubuntu were to start managing all packages themselves. For Canonical this would be a huge cost to bear and for the Ubuntu community a huge task to manage especially when they are poised to take Ubuntu to the masses. This confirms for me the fact that Debian needs to successfully exist for Ubuntu to survive (in the short term) and prosper (in the long term).

I’m really not concerned with the hoopla surrounding Unity because it’s an admirable goal for Canonical to push Ubuntu to form factors other than desktops and servers. I may not like the decisions but I want to support the idea behind them: make it easier for organizations to use and support an open source GUI. Just want to make clear that Unity has nothing to do with this post.

Where does Debian fit in today’s ecosystem? They are not jumping on the cloud bandwagon, they haven’t made systemd default yet, GNOME 3 is slowly coming to Testing, etc. They are still the strong, stable, dependable distribution they always have been. This stability makes Debian an excellent OS for server use. But not all servers need older and well-tested versions of applications and libraries; some really do need the latest and greatest. Here come the advantages provided by apt pinning: you can choose to use newer versions of some packages while keeping the rest of the system at the stable version.

More than anything else, it’s the independence of Debian that’s attractive. Sure you won’t always get a stable release every two years. You won’t see Debian pre-installed in your Cisco server. But what you do get is a product above the influence of corporate interests. Debian is truly a community-managed product and one person’s vision (good or bad) doesn’t derail the vision of the community. There’s no possibility of a corporate entity being bought by an anti-Linux entity and then the hard work of free and open source developers being used against them.

I believe in this hostile environment where patents are being used as weapons and shady deals are being forged to undermine the Linux movement (and the greater open source and free movement), independent Linux distributions need to be supported. I count Debian and Mageia as two really good examples of independent distributions and ones I would support as best I can (at least by using these products and not others).

Although there are tons of differences between Debian and other distributions, I’ll try to list some significant differences (in my view) so others who are looking for a distribution have another point of view when making a decision.

Ubuntu: It seems to be too reliant on Canonical for its existence; if Canonical doesn’t exist, Ubuntu will be crippled. Then Canonical has a policy of copyright assignment that just doesn’t sit well with me.

Fedora: It’s direction is independent but when a user wants to move up from using Fedora as a desktop to RHEL/CentOS on the server, the number of available packages shrinks dramatically. Thus servers have to rely on other repositories like EPEL and IUS.

Linux Mint: They are doing great work on the desktop but their recent announcement that “It won’t only be down to donations and sponsorships anymore, your activity on the web, every search query you make and product you buy will help fund our project” makes we wary of the long-term community-vibe of this project. It’s still a few developers working on a distribution and although the community has a lot of say in its direction, it’s still a long way off from being truly community controlled.

openSUSE: I tried openSUSE 12.1 for a few hours and absolutely loved it. It’s a very polished distribution and has some nice features missing from other distributions. But I still can’t get over the fact that it’s still at the mercy of corporate interests, be it Novell or Attachmate. If an independent openSUSE Foundation ever comes to fruition and the community controls the project then I would certainly support and use it more.

Mageia: I have used Mageia 1 and it’s a very good distribution. But it’s still in its infancy. Many of the packages I would like to use (e.g. Python 3, Virtualenv) were not included in the first release. I have my eyes on this distribution and will certainly give it another try when they release version 2.

PCLinuxOS: I am pretty much ignorant when it comes to PCLinuxOS. I have used it for a few hours here and there and liked it. It’s focused on creating a good desktop distribution so immediately I know that they are not a good choice for a desktop and server ecosystem (within the same distribution). Plus I can’t figure out if it’s a small team of independent developers or a corporate entity backing it.

In short, I think I use Debian because it’s not only a great product for my use cases but also independent. It has the stability of Stable, newness of Testing (plus I feel like I’m contributing to the next Stable by using Testing), and cutting-edge-ness of Unstable. I can use free software only or I can taint it with non-free codecs, drivers, applications, etc. I can use the Linux kernel or the kFreeBSD one (although I have never tried it in real life). So a user has many choices within the same distribution. When Debian says it’s a universal OS, these developers and packagers work really hard to mean it.