April Fools' Day – All Fools' Day

in Categories Beyond nixCraft, Humor last updated March 31, 2007

Today is Sunday, 1st April and I’m going to see some practical jokes everywhere…

I was just wondering about the origin of this custom. Unfortunately Wikipedia has no information.

I will update this post later on with some good jokes and other stuff 🙂

Dell says Linux driver Support is Key and promises to work with other Vendors

in Categories Linux desktop, Linux distribution, News last updated March 31, 2007

I was too busy with the projects I was doing. Anyway I’m back now and free to blog again.

Dell has a blog post to their report about upcoming Linux offerings on desktop and laptop systems:

A few trends emerged from the comments and I want to address them directly in this and future posts. This post focuses on our strategy for device drivers. All of the practices described here are available today — you can enact them yourselves too.

I hope dell will start to offer Linux desktop system, as I need to upgrade my Intel 1.7Ghz desktop system with 24” LCD display.

Also Dell need to make sure that Linux based hardware available across the globe, not just in US. There are some desktop/laptop models not available in India. These days I don’t have much time to build whitebox PC. Also I don’t like HP desktop systems at all.

Linux programming – system call howto

in Categories News last updated March 23, 2007

Learn about kernel command using Linux system calls – explore the SCI and add your own calls.

A system call is an interface between a user-space application and a service that the kernel provides. Because the service is provided in the kernel, a direct call cannot be performed; instead, you must use a process of crossing the user-space/kernel boundary. The way you do this differs based on the particular architecture. For this reason, I’ll stick to the most common architecture, i386.

System calls are an efficient way of traversing between user-space and the kernel to request services in the kernel-space. But they are also tightly controlled, and it’s much easier simply to add a new /proc file system entry to provide the user/kernel interactions. When speed is important, however, system calls are an ideal way to squeeze the greatest performance out of your application.

Linux’ system calls — we use them every day. But do you know how a system call is performed from user-space to the kernel — Explore the Linux system call interface (SCI), learn how to add new system calls (and alternatives for doing so), and discover utilities related to the SCI.)

Read more

Microsoft listed as most secure os

in Categories News, RedHat/Fedora Linux, Security, UNIX, Windows, Windows server last updated March 22, 2007

Here goes most secure os listing…
#1 Microsoft
#2 Redhat
#3 Apple OS X


The Symantec Internet security threat report offers analysis and discussion of threat activity over a six-month period. It covers Internet attacks, vulnerabilities, malicious code, phishing, spam and security risks as well as future trends.

Sun Solaris and HP-UX listed at last position. My personal experience shows that both Linux and BSD offer superior security. I’m just wondering what if they consider OpenBSD next time 😉

From the article:

Microsoft is frequently dinged for having insecure products, with security holes and vulnerabilities. But Symantec , no friend of Microsoft, said in its latest research report that when it comes to widely-used operating systems, Microsoft is doing better overall than its leading commercial competitors.

The report is available here.

Download Solaris UNIX Intel x86 / Sparc Adobe Flash players

in Categories Download of the day, Links, Linux desktop, News, Solaris, UNIX last updated March 22, 2007

This is a good move, especially considering increase in AMD64 workstation from Sun.

From the official blog:

The fact that Flash Player 9 Unix support is presently limited to Linux/x86 has been the source of some consternation to the users of some non-Linux/non-x86 Unix systems. You may be interested to learn that Unix platform support has recently been expanded. There are now beta versions of Flash Player 9 available from Adobe Labs

Download Adobe Flash player for Sun Solaris

=> Get flashplayer for Solaris

You can find more details here (via penguin.swf)

Why Linus Torvalds Loves GPL v2

in Categories Beyond nixCraft, GNU/Open source, News last updated March 22, 2007

This is the Torvalds Transcript about – Why he ‘Absolutely Love’ GPL Version 2.

On March 6, Linus Torvalds responded to e-mail questions on GPL version 3 sent by InformationWeek editor at large Charles Babcock.

Torvalds said:

First off, I don’t even know what the GPLv3 will look like. I would be totally crazy to accept a license for my code sight unseen

Oh on a related note this post talks about why GPL should help Microsoft in a long run:

…Some open source licenses don’t readily lend themselves to commercial open source. Apache/BSD licensing, for example, is hard to monetize (directly). But the GPL is very easy to monetize directly: customers get the value they want and competitors are scared to touch it. Everyone (that matters) wins. Microsoft needs to ditch its weird view on the GPL. It used to call it anti-American. It’s actually the exact opposite. It is the most American of open source licenses…

Generally I agree with author but I don’t see M$ opening its Vista or Office 2007 source code in a near future.

How to optimize a web page for faster and better experience

in Categories Apache, High performance computing, Howto, lighttpd, Linux, Tips, Tuning, UNIX last updated March 21, 2007

You may have noticed that most my webpage are loading bit faster. Here is what I did:

a) CSS code moved to its own file and included CSS at the top

b) Removed unnecessary (read as fancy web 2.0 stupid stuff) external javascript snippets

c) I’ve moved external javascript to bottom of page/template engine. For example google analytics JS code moved to bottom of webpage.

d) Turn on Apache gzip/mod_deflate compression

e) Turn on WordPress caching

f) Turn on php script caching (I’m using eAccelerator)

g) Tweak MySQL for optimization. Turn on query cache and other settings.

h) If possible switch to lighttpd or use squid / lighttpd as caching server for old good Apache.

If you have tons of cash to burn (assuming that your web app demands performance):

  • Consider using CDN (Content Delivery Network) such as Akamai or SAVVIS.
  • Server load balancing

However there are some external JS script snippets such as Google Adsense which slows down loading of a webpage. In few months I may roll out a new template and I will try to fix this issue 🙂

I’m interested to know what other people’s experiences with web page optimization. Feel free to share your tips.

Linux Shell script to add a user with a password to the system

in Categories Debian Linux, Gentoo Linux, Howto, RedHat/Fedora Linux, Shell scripting, Suse Linux, Sys admin, Tips last updated March 21, 2007

Our regular reader Imtiaz asks:

How do I add a user with password? I’d like to take input such as username, password from keyboard and add to the system under Linux.

A. You can easily write a shell script that reads username, password from keyboard and add to /etc/passwd and /etc/shadow file using useradd command (create a new user command).

General syntax is as follows:
useradd -m -p encryptedPassword username


  • -m : The user’s home directory will be created if it does not exist.
  • useradd -p encryptedPassword : The encrypted password, as returned by crypt().
  • username : Add this user to system

Task: Create an encrypted password

You need to create encrypted password using perl crypt():
$ perl -e 'print crypt("password", "salt"),"\n"'


Above will display the crypted password (sa3tHJ3/KuYvI) on screen. The Perl crypt() function is a one way encryption method meaning, once a password has been encrypted, it cannot be decrypted. The password string is taken from the user and encrypted with the salt and displayed back on screen.

You can store an encrypted password using following syntax:
$ password="1YelloDog@"
$ pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
$ echo $pass



Sample shell script to add a user

Based upon above discussion here is a sample shell script (Download link):

# Script to add a user to Linux system
if [ $(id -u) -eq 0 ]; then
	read -p "Enter username : " username
	read -s -p "Enter password : " password
	egrep "^$username" /etc/passwd >/dev/null
	if [ $? -eq 0 ]; then
		echo "$username exists!"
		exit 1
		pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
		useradd -m -p $pass $username
		[ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!"
	echo "Only root may add a user to the system"
	exit 2

Close and save the script:
$ ./adduser.sh
Only root may add a user to the system

Run as root:
# ./adduser

Enter username : roja
Enter password : HIDDEN
User has been added to system!

Now user roja can login with a password called HIDDEN.

Microsoft FoxPro going open source

in Categories News, Windows, Windows server last updated March 20, 2007

Old good Foxpro v2.0 is a text-based procedural programming language and RDBMS for MS-DOS, MS Windows, Macintosh and UNIX etc. Next version is called Visual FoxPro which is an object-oriented programming language and RDBMS for MS Windows only.

Now Microsoft has announced that it will not be releasing any new versions of its Visual FoxPro development software past Version 9.0, but the company will continue to support the technology through 2015.

Instead of releasing new versions of FoxPro, Microsoft will release core portions of the FoxPro software to its CodePlex community development site, said Alan Griver, a group manager within the Microsoft Visual Studio team, which leads the FoxPro team. You can expect to see the Sedna code on CodePlex sometime before the end of summer 2007.

This is great news for open source software.

Read more