Monday, December 17, 2007

Top 10 Tips for Linux Users

 Everyone develops their favorite tips and tricks for using Linux based on their own experience and the kind of work they are doing. Here are some of mine. These tips may seem simple, but I've found it's often the simple tricks that are the most useful in day-to-day work.

  1. Switch to another console. Linux lets you use "virtual consoles" to log on to multiple sessions simultaneously, so you can do more than one operation or log on as another user. Logging on to another virtual console is like sitting down and logging in at a different physical terminal, except you are actually at one terminal, switching between login sessions.

    Virtual consoles are especially useful if you aren't running X, but you can use them even if you are.

    In early versions of the kernel (pre-1.1.54), the number of available virtual consoles was compiled into the kernel. With more recent kernels, 63 virtual consoles are available, with 6 set up by default in the file /etc/inittab.

    Use the key combination Alt+Fn to switch between virtual consoles, where Fn is one of the function keys F1-F6. (If you are in X, you'll probably need to use Ctrl-Alt-Fn instead.) Alt+F7 gets you back to your X session, if one is running. You can rotate between consoles with the Alt-right arrow and Alt-left arrow key combinations.

  2. Temporarily use a different shell. Every user account has a shell associated with it. The default Linux shell is bash; a popular alternative is tcsh. The last field of the password table (/etc/passwd) entry for an account contains the login shell information. You can get the information by checking the password table, or you can use the finger command. For example, the command "finger ellen" shows, among other things, that I use /bin/tcsh.

    Related Reading

    Linux in a Nutshell The command chsh changes the login shell for all future logins; that is, it changes the account entry in the password table to reflect the new shell. However, you can also temporarily use another shell at any time by simply running the new shell. For example, if I want to try something out in bash, I can type "bash" at the prompt and be put into a bash shell. Typing either Ctrl-d or exit gets rid of that shell and returns me to my tcsh session.

Print a man page. Here are a few useful tips for viewing or printing manpages:

To print a manpage, run the command:

man <manpage> | col -b | lpr

The col -b command removes any backspace or other characters that would make the printed manpage difficult to read.

Also, if you want to print a manpage that isn't in a standard man directory (i.e., it's in a directory that isn't specified in the MANPATH environment variable), you can specify the full pathname of the manpage, including the full filename:

man /work/myapp/mymanpage.1

If you use the Emacs editor, you can view a manpage with the command Meta-x man; Emacs then prompts you for the name of the manpage. You can view the page or print it as you would any other Emacs buffer.

As a last resort, you can format the manpage directly with the groff command. However, the default output is a PostScript file, so you'll want to either send it to a PostScript printer or to a viewer such as ghostview:

groff -man /work/myapp/mymanpage.1 | ghostview -i

You can get ASCII output with the -a option, but the result is unformatted text. Not pretty to read, but it might suffice if nothing else works.

  1. Use command substitution to simplify complex operations. Command substitution lets you use the output of one command as an input argument to another command. To use command substitution, determine what command will generate the output you want, put that command in backquotes, and use it as an argument to another command. For example, I often use command substitution to recursively grep the files in a directory tree:

    grep 'Title' `find /work -type f -name 'chap*' -print` > chaptitles

    The portion of this command in backquotes is a find command that builds a list of chapter files in the /work directory. That list is then used to provide the set of input files for grep to search for titles. The output is saved in a file called chaptitles.

  2. Look inside a non-text file. Sometimes you really want to see inside a binary file. Maybe there isn't a manpage and you're looking for usage information, or perhaps you're looking for information about who wrote a program or what application a file is associated with.

    The strings command is perfect for that purpose--it searches through a file looking for sequences of printable character strings and writes them to standard output. You can pipe the output through a pager like more, or if you are looking for particular text, you can pipe the output to the grep command.

  3. Use the locate command. Looking for an easier way to find files than the find command? Try using locate. In contrast to find's complexity, locate is the ultimate in simplicity. The command:

    locate <string>

    searches an internal database and prints the pathnames of all files and directories that contain the given string in their names. You can narrow down the search by piping the output to grep. For example, the following finds all files containing the string "kde" that are in bin directories:

    locate kde | grep bin

    The strings don't have to be complete names; they can be partial strings, such as "gno" instead of spelling out "gnome". The -r option lets you use a regular expression (in quotes):

    locate -r 'gno*'

    One thing to be aware of is that locate is case-sensitive: Searching for HOWTO and for howto will give you different results.

    Rather than searching the disk each time, as find does, locate depends on the creation and maintenance of a database. Because it only has to search the database, not the disk, locate is faster than find. On the other hand, the results are only as current as the database.

    The locate database is generally updated daily by a cron job, but you can update it manually by running the command updatedb (usually as root). If you are adding new applications or deleting old files and you don't want to wait for the next day to have an up-to-date database, you might want to run it manually.

  4. Use dmesg to view startup messages. The dmesg command provides an easier way to see the boot messages than trying to read them before they scroll off the screen. When Linux boots, the kernel startup messages are captured in a buffer known as the kernel ring buffer; dmesg prints the contents of that buffer. By default, dmesg prints its output to the screen; you can of course redirect the output to a file:

    % dmesg > bootmsg

  5. Find out what kernel version you are using. Do you ever need to know what version of the Linux kernel is running on your system? You can find out with the uname command, which prints information about the system. Issued with the -r option, uname prints the kernel version:

    % uname -r

    Other uname options provide information such as the machine type, the name of the operating system, and the processor. The --all option prints all the available information.

  6. Use df and du to maintain your disk. Use the df (display filesystem) command to keep an eye on how much space each of your filesystems occupies and how much room is left. It's almost inevitable that if you like to download new software and try it out, you'll eventually fill up your disk. df has some options, but running it without options provides the basic information--the column labeled Use% tells you how full each filesystem is:

    % df Filesystem 1k-blocks Used Available Use% Mounted on /dev/hda3 1967156 1797786 67688 96% /

    Oops, time to clean house... and that's where du (disk usage) comes in handy. The du command provides the information you need to find the big space users, by printing the amount of disk space used for each file, subdirectory, and directory. You can specify the directory du is to start in, or let it default to the current directory.

    If you don't want to run du recursively through subdirectories, use the -s option to summarize. In that case, you need to specify all the directories you are interested in on the command line. For example:

    % du -s /usr/X11R6
    142264 /usr/X11R6

    % du -s /usr/X11R6/*
    34490 /usr/X11R6/bin
    1 /usr/X11R6/doc
    3354 /usr/X11R6/include

    97092 /usr/X11R6/lib
    7220 /usr/X11R6/man
    106 /usr/X11R6/share

    With the information provided by du, you can start in the directories that occupy the most disk space and delete or archive files you no longer actively use.

  7. Permit non-root users to mount or unmount drives. While hard drives are normally mounted automatically when the system is booted, other drives such as the floppy drive and the CD-ROM are generally not mounted until they are going to be used, so that disks can be inserted and removed. By default, root privileges are required for doing the mount (or unmount). However, you can modify the entries in the filesystem table, /etc/fstab, to let other users run the mount command. Do this by adding the option "user" to the appropriate entry:

    /dev/fd0 /mnt/floppy auto noauto,user 0 0 /dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,unhide 0 0

    You can see what filesystems are currently mounted, and what options they were mounted with, by looking at the file /etc/mtab or by running the mount command with no options or arguments.


Excel Tips : The easiest way to find Duplicates of cell in a column

Dates in column A   Text in Column B
03/10/2003 | AAA
03/15/2003 | BBB
03/20/2003 | CCC
03/25/2003 | AAA
03/30/2003 | BBB
04/04/2003 | CCC
03/25/2003 | AAA
03/30/2003 | BBB
04/04/2003 | CCC
03/25/2003 | AAA
03/30/2003 | BBB
04/04/2003 | CCC

1> Enter the formula : =A1&B1 to cell C1 and copy / paste the formula to cells C2:C12

2> Enter the formula : =IF(COUNTIF($C$1:C1,C1)>1,"Duplicate","Unique")
                                      to cell E1 and copy / paste the formula to cells E2:E12



** (you can use the second formula directly if you have only a single column  : Like

Column A


Column A        

Insert this Formula in Column B : =IF(COUNTIF($A$1:A1,A1>1),"Duplicate","Unique")

and  you are done ..

Technorati Tags: ,,,

Thursday, December 13, 2007

7 Simple ways to work fast on slow Internet connections

Microsoft's simple 7 optimizations

Summary :

  1. Sending multiple file faster by compressing .
  2. Turning images and flash can boost faster loading .
  3. Sending E-mail using Distribution list
  4. Working Offline Using Cached Exchange Mode in Outlook
  5. Reducing E-Mail Size With Simple E-Mail Signatures
  6. Browsing offline by saving web pages on Your computer
  7. Open Web Pages Faster by Increasing Your Cache

In Details :

1. Sending multiple file faster by compressing .

If you're sending multiple files—for example several files related to a project—you can reduce their combined size by using a compression utility. Compressing your files can dramatically reduce the time needed to send files online, and won't take up as much space in your (or the recipient's) e-mail Inbox. WinZip is one of the most common compression tools.

2. Turning images and flash can boost faster loading .

Graphics are important to Web pages, but they also take time to download if you're online. You can turn them off to speed your Internet browsing.

To disable graphics in Internet Explorer:

  1. On the Tools menu, click Internet Options.
  2. In the Internet Options dialog box, click the Advanced tab.
  3. In the Settings box, scroll down to the Multimedia section. Clear the following boxes.
  • Play animations in Web pages
  • Play sounds in Web pages
  • Play videos in Web pages
  • Show pictures

4 . Click Apply.


3 . Sending E-mail using Distribution list

If you're sending an e-mail to multiple people, create a distribution list instead of listing each recipient separately. Messages are sent faster and more efficiently when you're using a distribution list. Your company may have established procedures for creating mailing lists.

4 .Working Offline Using Cached Exchange Mode in Outlook

Even if you lose your network connection, you can continue to working in Outlook if you're using Cached Exchange Mode. With Cached Exchange Mode, a copy of your mailbox is stored on your computer. This copy provides quick access to your data and is frequently updated with the mail server. If you work offline, whether by choice or due to a connection problem, your data is still available to you instantly wherever you are. Cached Exchange Mode does require you to work with a Microsoft Exchange Server e-mail account.

5 .Reducing E-Mail Size With Simple E-Mail Signatures

E-mail signatures leave a professional stamp on your messages, but elaborate signatures that include multiple images take up a lot of unnecessary storage space in each e-mail. Ultimately, they can slow down the time needed to send each message. Instead create distinctive text signatures combining fonts, type sizes, and colors to make your e-mail signature smaller and quicker to transmit and receive.

6.Browsing offline by saving web pages on Your computer

If you use reference a Web page often, save it locally to your computer. If you lose your connection or are working on a slow connection, you'll still be able to read and find the information you need.

To save a Web page on your computer:

  1. In Internet Explorer, go to the Web page you want to save.
  2. On the File menu, click Save As.
  3. In the Save As type drop-down menu, select Web page, complete.
  4. Click Save.
7. Open Web Pages Faster by Increasing Your Cache

If you increase the size of the Temporary Internet files cache in Internet Explorer, your computer won't have to work so hard when you revisit Web pages. Many of the images will already be downloaded on your computer, decreasing the amount of time it takes to open a page.

To increase the Temporary Internet Files cache:

  1. On the Tools menu, click Internet Options.
  2. On the General tab, in the Temporary Internet Files section, click Settings.
  3. In the Settings dialog box, under Check for newer versions of stored pages:, click the Automatically radio button.
  4. In the Temporary Internet files folder section, set the Amount of disk space to use: to at least 250 megabytes (MB).
  5. Click OK.