≡ Menu

gnu linux

This is an interesting documentary video which traces the history of GNU, Linux, and the open source and free software movements. It features several interviews with prominent hackers and entrepreneurs (and hackers-cum-entrepreneurs), including Richard Stallman, Michael Tiemann, Linus Torvalds, Larry Augustin, Eric S. Raymond, Bruce Perens, Frank Hecker and Brian Behlendorf.

The film begins in medias res with an IPO, and then sets the historical stage by showing the beginnings of software development back in the day when software was shared on paper tape for the price of the paper itself. It then segues to Bill Gates's Open Letter to Hobbyists in which he asks Computer Hobbyists to not share, but to buy software. (This letter was written by Gates when Microsoft was still based in Arizona and spelled "Micro-Soft".) Richard Stallman then explains how and why he left the MIT Lab for Artificial Intelligence in order to devote his life to the development of free software, as well as how he started with the GNU project.

(Note: There is a video embedded within this post, please visit the site to view the video - Time: 1 hr 25 min 9 sec)

Linus Torvalds is interviewed on his development of the Linux kernel as well as on the GNU/Linux naming controversy and Linux's further evolution, including its commercialization.

Richard Stallman remarks on some of the ideological aspects of open source vis-á-vis Communism and capitalism and well as on several aspects of the development of GNU/Linux.

Michael Tiemann (interviewed in a desert) tells how he met Stallman and got an early version of Stallman's GCC and founded Cygnus Solutions.

Larry Augustin tells how he combined the resulting GNU software and a normal PC to create a UNIX-like Workstation which cost one third the price of a workstation by Sun Microsystems even though it was three times as powerful. His narrative includes his early dealings with venture capitalists, the eventual capitalization and commodification of Linux for his own company, VA Linux, and ends with its IPO.

Frank Hecker of Netscape tells how Netscape executives released the source code for Netscape's browser, one of the signal events which made Open Source a force to be reckoned with by business executives, the mainstream media, and the public at large.

PS: You can download video from Google Video for Apple iPOD here.

Switch to Linux – a beginners guide

Recently I came across a small but useful resource about making the switch to Linux from Windows. The site has information about:
=> What Linux is?
=> How to get it?
=> How to install it? etc

The site is useful for new Linux users who wish to make the switch.

This website is run by a non-profit organization, GNU/Linux Matters, to promote GNU/Linux amongst everyday users. We believe in a widespread use of free software – as part of a truly free society; and wanted to say how useful and fun Linux is.

=> get GNU/Linux website

Finally Debian GNU/Linux 4.0 updated.

The Debian project has updated the stable distribution Debian GNU/Linux 4.0 (codename Etch). This update adds security updates to the stable release, together with a few corrections to serious problems. As always, the first point release also corrects a few issues that have been noticed too late in the release process to stop the release, but still should be fixed.

As usual, upgrading to this revision online is done by running the apt-get / aptitude package tool.

Download Debian 4.0r1

=> Visit official site.

Download advanced Linux programming book PDF version

If you are a developer for the GNU/Linux system, this book will help you to write and/or develop GNU/Linux software that works the way users expect it to.

Advanced Linux Programming is published under the Open Publication License, Version 1, no options exercised. (Due to an oversight in final production, the copyright notice on the book is incorrect.) The full text may be downloaded from this site. Code samples in the book are covered by the GNU General Public License and are also available.


Chapter 01 - Advanced Unix Programming with Linux
Chapter 02 - Writing Good GNU/Linux Software
Chapter 03 - Processes
Chapter 04 - Threads
Chapter 05 - Interprocess Communication
Chapter 06 - Mastering Linux
Chapter 07 - The /proc File System
Chapter 08 - Linux System Calls
Chapter 09 - Inline Assembly Code
Chapter 10 - Security
Chapter 11 - A Sample GNU/Linux Application

Download link

=> Advanced Linux programming book, by Mark Mitchell, Jeffrey Oldham, Alex Samuel (via Digg)

How to: Compile Linux kernel 2.6

Compiling custom kernel has its own advantages and disadvantages. However, new Linux user / admin find it difficult to compile Linux kernel. Compiling kernel needs to understand few things and then just type couple of commands. This step by step howto covers compiling Linux kernel version 2.6.xx under Debian GNU Linux. However, instructions remains the same for any other distribution except for apt-get command.

Step # 1 Get Latest Linux kernel code

Visit http://kernel.org/ and download the latest source code. File name would be linux-x.y.z.tar.bz2, where x.y.z is actual version number. For example file inux-2.6.25.tar.bz2 represents 2.6.25 kernel version. Use wget command to download kernel source code:
$ cd /tmp
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2

Note: Replace x.y.z with actual version number.

Step # 2 Extract tar (.tar.bz3) file

Type the following command:
# tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
# cd /usr/src

Step # 3 Configure kernel

Before you configure kernel make sure you have development tools (gcc compilers and related tools) are installed on your system. If gcc compiler and tools are not installed then use apt-get command under Debian Linux to install development tools.
# apt-get install gcc

Now you can start kernel configuration by typing any one of the command:

  • $ make menuconfig - Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.
  • $ make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop
  • $ make gconfig - X windows (Gtk) based configuration tool, works best under Gnome Dekstop.

For example make menuconfig command launches following screen:
$ make menuconfig

You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help.

Step # 4 Compile kernel

Start compiling to create a compressed kernel image, enter:
$ make
Start compiling to kernel modules:
$ make modules

Install kernel modules (become a root user, use su command):
$ su -
# make modules_install

Step # 5 Install kernel

So far we have compiled kernel and installed kernel modules. It is time to install kernel itself.
# make install

It will install three files into /boot directory as well as modification to your kernel grub configuration file:

  • System.map-2.6.25
  • config-2.6.25
  • vmlinuz-2.6.25

Step # 6: Create an initrd image

Type the following command at a shell prompt:
# cd /boot
# mkinitrd -o initrd.img-2.6.25 2.6.25

initrd images contains device driver which needed to load rest of the operating system later on. Not all computer requires initrd, but it is safe to create one.

Step # 7 Modify Grub configuration file - /boot/grub/menu.lst

Open file using vi:
# vi /boot/grub/menu.lst

title           Debian GNU/Linux, kernel 2.6.25 Default
root            (hd0,0)
kernel          /boot/vmlinuz root=/dev/hdb1 ro
initrd          /boot/initrd.img-2.6.25

Remember to setup correct root=/dev/hdXX device. Save and close the file. If you think editing and writing all lines by hand is too much for you, try out update-grub command to update the lines for each kernel in /boot/grub/menu.lst file. Just type the command:
# update-grub
Neat. Huh?

Step # 8 : Reboot computer and boot into your new kernel

Just issue reboot command:
# reboot
For more information see:

  • Our Exploring Linux kernel article and Compiling Linux Kernel module only.
  • Official README file has more information on kernel and software requirement to compile it. This file is kernel source directory tree.
  • Documentation/ directory has interesting kernel documentation for you in kernel source tree.

Restore Debian Linux Grub boot loader

Recently my hard disk went bad (some bad sectors developed), my boot.ini (Windows XP boot file) corrupted. I was using NT boot loader to load Linux. So I need to repair the Grub i.e. restore Grub in master boot record (MBR).

Today is national holiday (I-DAY) and I wanna watch TV. Problem is neither I can boot to Linux nor using XP. So I just took my Debian GNU/Linux DVD and booting started when I had presented installation option (after networking dialog prompt) :
1) Press ALT+F2 (or ALT+CTRL+F2) to get shell prompt
2) Then get the partition tables for the devices using fdisk command:
# fdisk -l

3)When you type fdisk -l, you should see your partition name: /dev/scsi/host0/bus0/target0/lun0/part1 (for IDE disk it display same device file in IDE directory)

4)Once you identified your device file, mount disk using mount command:
# mkdir /mydisk
# mount /dev/scsi/host0/bus0/target0/lun0/part1 /mydisk

5) Next use chroot command to start interactive shell with special root directory i.e. /mydisk will act as root directory.
# chroot /mydisk

6)Use grub-install command to reinstall grub (SCSI disk):
# grub-install /dev/sda

If you have IDE device following command :
# grub-install /dev/hda

Again replace /dev/hda and /dev/sda with your actual device names.

7)Type exit and reboot the system. You should see your GRUB and Linux again.
# exit

Other choice was to use Linux Live CD (e.g. Mepis) and do the above procedure. Well, I could have used the Mepis to watch TV but I had some data and emails in Tunderbird so I opted to restore the Grub; watched TV, took backup of emails and now I will put new 120 GiB hard disk tomorrow :D

Here is small script that does this. Debian or Ubuntu GNU/Linux does not comes with any SYS V init script (located in /etc/init.d directory) .

You create a script as follows and use it to stop or flush the iptables rules.

Please don't type rules at command prompt. Use the script to speed up work.

Procedure for Debian / Ubuntu Linux

A) Create /root/fw.stop /etc/init.d/fw.stop script using text editor such as vi:

echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT

(B) Make sure you can execute the script:
# chmod +x /root/fw.stop

(C) You can run the script:
# /root/fw.stop

A note for RedHat and friends Linux user

Please note that RedHat enterprise Linux (RHEL) and Fedora / Centos Linux comes with pre-installed script, which can be used to stop the firewall:
#/etc/init.d/iptables stop
Sample outputs: