How To: Build an Embedded Linux Distribution From Scratch

Posted on in Categories GNU/Open source, Hardware, Linux, Linux distribution, Linux Embedded devices, Ubuntu Linux last updated August 16, 2008

Embedded Linux is the use of a Linux operating system in an embedded computer systems such as a mobile phones, personal digital assistants, media players etc. This tutorial shows you how to install Linux on a target system. Not a prebuilt Linux distribution, but your own, built from scratch.

WordPress 2.5 Released

Posted on in Categories Download of the day, GNU/Open source, Linux, UNIX, Windows server last updated March 29, 2008

WordPress 2.5 has been released and available for download.The dashboard is cleaner, faster, less cluttered. From the release note:

WordPress 2.5, the culmination of six months of work by the WordPress community, people just like you. The improvements in 2.5 are numerous, and almost entirely a result of your feedback: multi-file uploading, one-click plugin upgrades, built-in galleries, customizable dashboard, salted passwords and cookie encryption, media library, a WYSIWYG that doesn’t mess with your code, concurrent post editing protection, full-screen writing, and search that covers posts and pages.

wordpress-25-dashboard.png
(Fig. 01: My Dashboard)

wordpress-35-write-post.png
(Fig. 02: Writing a post)

scapy – Interactive Packet Manipulation / Generation Tool for Linux / UNIX

Posted on in Categories Debian Linux, Hardware, Linux, Security, Ubuntu Linux, UNIX last updated January 28, 2008

Recently I started to play with scapy – a powerful interactive packet manipulation and custom packet generation program written using Python. Please note that this tool is not for a new Linux / UNIX users. This tool requires extensive knowledge of network protocols, packets, layers and other hardcore networking concepts. This tool is extermly useful for
a] Understanding network headers
b] Testing network security
c] Write your own utilities using scapy
d] Decoding protocols etc

From the man page:

You can use this tool to check the security of your own network as it allows to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery. It also performs very well at a lot of other specific tasks that most other tools can’t handle, like sending invalid frames, injecting your own 802.11 frames, combining technics such as VLAN hopping+ARP cache poisoning, VOIP decoding on WEP encrypted channel, etc.

Continue reading “scapy – Interactive Packet Manipulation / Generation Tool for Linux / UNIX”

Bash Shell Completing File, User and Host Names Automatically

Posted on in Categories CentOS, Debian Linux, File system, RedHat/Fedora Linux, Shell scripting, Suse Linux, Tips, Ubuntu Linux, UNIX last updated November 14, 2007

Bash can auto complete your filenames and command name. It can also auto complete lots of other stuff such as:
=> Usernames

=> Hostname

=> Variable names

=> Fine tuning files and names with ESC keys

Match variable

If the text begins with $, bash will look for a variable. For example, open terminal and type echo $T and press TAB key, shell will complete that to echo $TERM:
echo $T {hit-tab-key}

Match Username

If the test begins with ~ (tilde), bash will look for a user name. For example, open terminal and type cat ~g and press TAB key, shell will complete that to cat ~guess/file.txt:
cat ~g {hit-tab-key}

Match hostname

If the test begins with @, bash will look for a host name. For example, open terminal and type scp file.txt [email protected] and press TAB key, shell will complete that to scp file.txt [email protected]:
scp file.txt [email protected] {hit-tab-key}
Please note that you need proper host resoultion configured to work with this hack via NIS or hosts file. Also after shell completes the command name / username or filename hit the [ENTER] key.

Fine tunning Shell Completing stuff with ESC key

Bash allows you to fine tune file completion using ESC key combinations. People get amazed when I use ESC combination in front of them. For example, to inserts all possible completions into your command use ESC+*. Let us see how to backup all /etc/*.conf files, type the command:
tar -zcvf /dev/rt0 /etc/*.conf {hit ESC followed by *}
As soon as you hit Esc+*, shell replaces the /etc/*.conf part with names of all matching wild card patterns
tar -zcvf /dev/rt0 /etc/aatv.conf /etc/adduser.conf /etc/apg.conf /etc/brltty.conf /etc/ca-certificates.conf /etc/cvs-cron.conf /etc/cvs-pserver.conf /etc/debconf.conf ....

To displays all possible completions of command or filenames or username type ESC+?, to display all username start with the word le, type
cat ~le {hit ESC followed by ?}

complete command

There is also in built command called complete. It is used to specify how arguments are to be completed for a command. For example, when you type passwd (or any other user admin command such as su / usermod etc) and hit tab key, bash will show you a list of all available users i.e. all user admin related commands will see only user names:
complete -u su usermod userdel passwd chage write chfn groups slay w
Now type passwd and hit tab key to see all username:
passwd {hit tab key}
Output:

avahi          bin            dhcp           gdm            haldaemon      klog           mail           news           root           sys            uucp
avahi-autoipd  cupsys         dnsmasq        gnats          hplip          list           man            nobody         sshd           syslog         vivek
backup         daemon         games          guest          irc            lp             messagebus     proxy          sync           telnetd        www-data
[email protected]:/tmp$ passwd 

Cool, huh? There is a nice file included with almost all distro to complete lots of stuff using complete command. Just add following line to your bash startup file:
source /etc/bash_completion

Further reading: