Saturday, December 1, 2007

An A-Z Index of the Linux BASH Command Line.














alias -Create an alias
awk - Find and Replace text within file(s)

break - Exit from a loop
builtin - Run a shell builtin

cal - Display a calendar
case - Conditionally perform a command
cat - Display the contents of a file
cd - Change Directory
cfdisk - Partition table manipulator for Linux
chgrp - Change group ownership
chmod - Change access permissions
chown - Change file owner and group
chroot - Run a command with a different root directory
cksum - Print CRC checksum and byte counts
clear - Clear terminal screen
cmp - Compare two files
comm - Compare two sorted files line by line
command - Run a command - ignoring shell functions
continue - Resume the next iteration of a loop
cp - Copy one or more files to another location
cron - Daemon to execute scheduled commands
crontab - Schedule a command to run at a later time
csplit - Split a file into context-determined pieces
cut - Divide a file into several parts

date - Display or change the date & time
dc - Desk Calculator
dd - Data Dump - Convert and copy a file
declare - Declare variables and give them attributes
df - Display free disk space
diff - Display the differences between two files
diff3 - Show differences among three files
dir - Briefly list directory contents
dircolors - Colour setup for `ls'
dirname - Convert a full pathname to just a path
dirs - Display list of remembered directories
du - Estimate file space usage

echo - Display message on screen
ed - A line-oriented text editor (edlin)
egrep - Search file(s) for lines that match an extended expression
eject - Eject CD-ROM
enable - Enable and disable builtin shell commands
env - Display, set, or remove environment variables
eval - Evaluate several commands/arguments
exec - Execute a command
exit - Exit the shell
expand - Convert tabs to spaces
export - Set an environment variable
expr - Evaluate expressions

factor - Print prime factors
false - Do nothing, unsuccessfully
fdformat - Low-level format a floppy disk
fdisk - Partition table manipulator for Linux
fgrep - Search file(s) for lines that match a fixed string
find - Search for files that meet a desired criteria
fmt - Reformat paragraph text
fold - Wrap text to fit a specified width.
for - Expand words, and execute commands
format - Format disks or tapes
free - Display memory usage
fsck - Filesystem consistency check and repair.
function - Define Function Macros

gawk - Find and Replace text within file(s)
getopts - Parse positional parameters
grep - Search file(s) for lines that match a given pattern
groups - Print group names a user is in
gzip - Compress or decompress named file(s)

hash - Remember the full pathname of a name argument
head - Output the first part of file(s)
history - Command History
hostname - Print or set system name

id - Print user and group id's
if - Conditionally perform a command
import - Capture an X server screen and save the image to file
info - Help info
install - Copy files and set attributes

join - Join lines on a common field

kill - Stop a process from running

less - Display output one screen at a time
let - Perform arithmetic on shell variables
ln - Make links between files
local - Create variables
locate - Find files
logname - Print current login name
logout - Exit a login shell
lpc - Line printer control program
lpr - Off line print
lprint - Print a file
lprintd - Abort a print job
lprintq - List the print queue
lprm - Remove jobs from the print queue
ls - List information about file(s)

m4 - Macro processor
man - Help manual
mkdir - Create new folder(s)
mkfifo - Make FIFOs (named pipes)
mknod - Make block or character special files
more - Display output one screen at a time
mount - Mount a file system
mtools - Manipulate MS-DOS files
mv - Move or rename files or directories

nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups

passwd Modify a user password
paste Merge lines of files
pathchk Check file name portability
popd Restore the previous value of the current directory
pr Convert text files for printing
printcap Printer capability database
printenv Print environment variables
printf Format and print data
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory

quota Display disk usage and limits
quotacheck Scan a file system for disk usage
quotactl Set disk quotas

ram ram disk device
rcp Copy files between two machines.
read read a line from standard input
readonly Mark variables/functions as readonly
remsync Synchronize remote files via email
return Exit a shell function
rm Remove files
rmdir Remove folder(s)
rpm Remote Package Manager
rsync Remote file copy (Synchronize file trees)

screen Terminal window manager
sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
shift Shift positional parameters
shopt Shell Options
shutdown Shutdown or restart linux
sleep Delay for a specified time
sort Sort text files
source Run commands from a file `.'
split Split a file into fixed-size pieces
su Substitute user identity
sum Print a checksum for a file
symlink Make a new name for a file
sync Synchronize data on disk with memory

tac Concatenate and write files in reverse
tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program Resource Use
times User and system times
touch Change file timestamps
top List processes running on the system
traceroute Trace Route to Host
trap Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command

ulimit Limit user resources
umask Users file creation mask
umount Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
useradd Create new user account
usermod Modify user account
users List users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode

v Verbosely list directory contents (`ls -l -b')
vdir Verbosely list directory contents (`ls -l -b')

watch Execute/display a program periodically
wc Print byte, word, and line counts
whereis Report all known instances of a command
which Locate a program file in the user's path.
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un')

xargs Execute utility, passing constructed argument list(s)
yes Print a string until interrupted

.period Run commands from a file
### Comment / Remark

Sunday, October 21, 2007

Installing MPlayer on Linux

Before you install MPlayer, it asks for DivX or XVid codecs.


Fetch them from

http://www.xvid.org/
http://download.divx.com/labs/divx611-20060201-gcc4.0.1.tar.gz


First install these two, so mplayer can support these codecs as well. It’s not a big deal to install these codecs. DivX has a shell script called install.sh just run it using ./install.sh command

Bytheway, to extract a tar.gx or a tgx file, use the following command tar –xzvf file_name.tar.gx
To extract a tar.bx2 file or a tbz file use the following command.
tar –xBvf file_name_here.tar.bz2

for xvid codec uncompress it and go to that directory and in that, go to build/generic
and then do the following
./configure
make
make install

Older wmv versions are supported by MPlayer anyway.

This file you are downloading is a ‘bunzip2’ file, not a ‘gzip’ file http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre8.tar.bz2


So to uncompress it you have to use the –B option.
So it should be
tar –xBvf MPlayer-1.0pre8.tar.bz2

Then start installing MPlayer uncompress it
tar -xBzf MPlayer-1.0pre8.tar.bz2

Go into that directory, it’s creating
./configure –enable-gui
If you don’t unset h –enable-gui option it will not compile it for the GUI skin.
make
make install

Then install a font
Copy a ttf file form anyware to the /user/local/share/mplayer/ directory and rename it so subfont.ttf

Then install a skin.
Download any skin from http://www.mplayerhq.hu/MPlayer/Skin/ and then make a director inside /user/local/share/mplayer/ calles skins. Copy the skin (.tar.bz2 file) into the newly created directory and uncompress it.

Then rename the skin (the name of the directory which was created by uncompress) that you want to appear as the default skin for Mplayer, to default.

Then you can play music and movies. Use gmplayer file_name.mp3 in a terminal or you can set file association and then use it like any other player you are already familiar with.




























How to make Firefox Faster

















Here is the way of doing it…

1. Type "about:config" into the address bar and hit enter. Scroll down and look for the
following entries.

2. Alter the entries as follows:
Set "network.http.pipelining" to "true"
Set "network.http.proxy.pipelining" to "true"
Set "network.http.pipelining.maxrequests " to some number like 30. This means it will make 30 requests at once.

You can set this value in to any number,but i guess 30 would be more than enough..

3. Lastly right-click anywhere and select New à Integer.
Name it "nglayout.initialpaint.delay" and set its value to "0". This value is the amount
of time the browser waits before it acts on information it receives.

Visual Studio 2008 and .NET 3.5






















What’s New with .NET 3.5


CLR Enhancement.
Compiler Enhancement.
LINQ.
Performance Improvement.
Networking Changes.
Windows Information APIs.
WCF works with POX and JSON.
So many more..



















What’s New with Visual Studio 2008


Supports .NET 2.0, 3.0 and 3.5.
Enabling Flexibility to switch on / off.
Works on HTML, XML and Code Editor.
Semi-Transparent IntelliSense.
Multi-Targetting.
Organized Using.
Split View.
WPF IDE Integration.
Nested Master Page.
Richer support for JavaScript.
Good for AJAX Developers.
So many more..

This Blog Post is based on the Presentation of Chua Wen Ching (Solutions Engineer, Mesiniaga, Malaysia and Microsoft MVP Visual Developer – Visual C#) which was presented at the Microsoft Developer Day 2007 Sri Lanka.

You can Download those Presentation Slides from following URLs.

Discover Next Generation Visual Studio and .NET Framework 3.5.zip

An Adventure with CSharp and LINQ.zip


Saturday, October 20, 2007

Microsoft® Silverlight™









"Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications. Silverlight supports fast, cost-effective delivery of high-quality video to all major browsers running on the Mac OS or Windows."















For more information about Microsoft® Silverlight™ visit..

http://silverlight.net/

How to get the Read & Write Permissions to ntfs File Systems using Linux






1st Install the fuse Package..

http://fuse.sourceforge.net/

Here is the steps for installing fuse..

tar -xBvf filename
./configure
make
sudo make install

Then Install the ntfs-3g Package..

http://www.ntfs-3g.org

Here is the steps for installing ntfs-3g..

tar -xBvf filename
./configure
make
sudo make install

If you have done it correctly ntfs-3g is ready for your Linux Computer..
You have got the right to read & write ntfs file systems..

Follow the following steps to mount your ntfs partitions with ntfs-3g..

Unmount all the partitions those are already mounted..
Use the below command..
sudo umount -a

Then mount them back with ntfs-3g..
Use the following command..
sudo ntfs-3g /dev/sda(Partition #) /mnt/(Partition Name)

For more information read the manual pages for fuse & ntfs-3g..
Use man -ntfs-3g and man -fuse..



How to Repair a Corrupt MBR and boot into Linux

There are times when you inadvertently overwrite your Master Boot Record. The end result being that you are unable to boot into Linux. This is especially true when you are dual booting between windows and Linux OSes. Once when I was working in Windows XP, I accidentally clicked the hibernate button instead of shutdown. And windows somehow overwrote my MBR which housed the GRUB boot loader. At such times, it pays to have this cool tip at hand.

This is what you do to restore the GRUB boot loader when faced with the above problem. First you need a Linux distribution CD. If you are using Fedora (RedHat) then the first CD is sufficient. But you may also use any of the live CDs like Knoppix, Ubuntu Live CD and so on.


With Fedora CD

Boot your computer with the first CD of Fedora in your CD drive (You have to enable your PC to boot from the cdrom, which you can set in the BIOS settings). At the installation boot prompt that you get, enter the following command:

boot: linux rescue

... and press Enter. The installer will ask you a few questions like the language you would like to use, the type of keyboard etc. Then, if you have linux previously installed on your machine, the Fedora installer will automatically detect it and mount it in the /mnt/sysimage directory. Once the linux partition is mounted, you are dropped into the command shell prompt. The next step is to make your newly mounted directory the root (or parent) directory. This you do by running the chroot command as follows:

# chroot /mnt/sysimage

# _

Now you are in the shell with respect to the parent directory which is the linux partition on your harddisk.

From here, the steps needed depends on which bootloader you are using. You have to have a fair idea what is the device node of your harddisk partition housing your MBR. In most cases, it is /dev/hda if you have an IDE harddisk. But if you have a SCSI harddisk, it will be /dev/sda.


Restoring GRUB
Execute the following command :

# grub-install /dev/hda

... to install GRUB boot loader on to your MBR. And then type exit to reboot the machine. Now your GRUB boot loader is fixed.


Restoring LILO

LILO stands for LInux LOader which was the boot loader used before GRUB was developed. It is fairly cryptic and is the default bootloader prior to and in RedHat 7.0 .

Here you just type the command :

# /sbin/lilo

... to install the bootloader on to the MBR.

If you don't have a Fedora CD, then you need not despair. You can also repair the boot loader using one of the numerous live CDs available.


Using Knoppix CD to repair the boot loader

Here you have to boot into knoppix (either GUI mode or text mode). Once you are logged in, fire up a terminal (in GUI mode) and type the following commands:

$ su -

# fdisk -l

This will list your hard disk partition information. From the listing, you can know in which partition you have linux installed. Now you have to mount the partition which contains the linux filesystem. For the sake of this discussion, let us assume it is /dev/hda3 .

# mount -t ext3 -o rw /dev/hda3 /mnt

#_

Now your linux partition is mounted at /mnt . Next you have to use the chroot command as follows:

# chroot /mnt

#_

The rest of the steps are the same as listed above for Restoring GRUB and LILO boot loaders.