Tip of the Day

Sunday, April 5, 2009

Tip of the Day

Today, I am gonna start a new section "Tip of the Day".

TipsAs a Computer professional, I come across lots of problems daily... some issue with C Code, some unexpected behavior of Linux/Windows, some problem with my tools/editors, some hardware glitch... etc. etc. Usually I solve them, sometimes with the help of others... and I forget them... but someone else may have come across the same problem and may need a quick solution...

What I am gonna do is, write them down in here... so everyone can benefit from it...

There is a widget added at the right, titled "Tip of the Day". Each day, it will contain a computer related tip... and the tip will be appended to this post as comment...

You can add your own tip as comment, if it is useful, it will be put into the widget the next day along with your name/website.

You can subscribe to the comments by adding this URL to your favourite RSS reader : http://www.atoztoa.com/feeds/5643746495639506872/comments/default.


ATOzTOA : Latest Headlines


35 comments:

atoztoa said...

Topic: Linux Shell
If a shell script is executed using source script, the script is executed within the current shell. So, if the script contains an exit statement, then the script will kill the shell.

One method is using ./script, this executes the script in a new shell of its own, specified by the first line in the script starting with #!. (The script must have execute permission)

Another method is putting the whole source script inside parenthesis '(' and ')', which will spawn a new shell for the command.

atoztoa said...

Topic: Linux Shell

When I need to read some input from user with a prompt in a shell script, I use echo -n and then read.

There is an easier way...
read -p "This is the prompt" name

If you want to read passwords without showing on screen,
read -s -p "Enter Password:" pass.

atoztoa said...

Topic: PDF

You download a PDF for studying something, and you are gonna prepare a presentation, but the PDF won't allow you to even copy the text... you are stuck...

Use this website to remove the PDF restrictions online... upload the PDF and download the unrestricted version... simple...

http://www.ensode.net/pdf-crack.jsf

atoztoa said...

Topic: Linux Command

Whatis

By typing "whatis" followed by a command, Linux returns the first line of the Man-page (manual page) for that command.
Create whatis database: /usr/sbin/makewhatis

Apropos

The Apropos command lists all the man pages containing a specific term.

atoztoa said...

Topic: Linux Command

If you want to know where a command binary is present...

You can directly execute a command only if that command binary is present in your PATH. Try echo $PATH.

But, you can execute any binary if you give full path...
To know where the binary is, use 'whereis'...
whereis ifconfig
It will list all the locations where ifconfig binary is present.

To know which of the binaries is executed when the command is given, use 'which'...
which ifconfig

atoztoa said...

Topic: VIM

I was missing 'Block Indent' in VIM, it is too easy...

Use these keys in normal mode (ESC)

Indent a line right : >> (Hold SHIFT and press .)
Indent a line left : <<

Indent 5 lines right : 5>>
Indent 7 lines left : 7<<

In Visual mode, select the lines and press > or < to indent the selected lines left or right.

atoztoa said...

Topic: Windows XP/Vista USB Disabled

If you have accidentally disabled Generic Volume by right-clicking USB Drive... then the USB drive won't work again...

Use System Restore...

System Restore can be run from Command Prompt or from Task Manager by giving the full path...
Windows XP: %systemroot%\system32\restore\rstrui.exe
Windows Vista: %systemroot%\system32\rstrui.exe

atoztoa said...

Topic: Firefox Search Bar

How do you search in Firefox? Go to Google and search? Firefox Search Bar is too easy...

What I do is, CTRL + T; TAB; Enter search term; ENTER, too easy...

When in the Search Bar, CTRL + UP / DOWN will change the Search Engine...

atoztoa said...

Topic: Windows Key

Today we will look into some of the shortcuts using the Windows Key (key beside the Alt key).

Windows Key + d : Show Desktop
Windows Key + e : My Computer
Windows Key + f : Search
Windows Key + l : Lock Desktop
Windows Key + m : Minimize All
Windows Key + r : Run
Windows Key + u : Utility Manager

Windows Key + Break : System Properties

atoztoa said...

Topic: Blogger

If you own a blog, you will have readers posting comments... some may post a comment and delete it, you may not get to read what they wrote... it will just say 'the comment was removed by the author'...

To read what they wrote,
- Click on Delete Comment (recycle bin)
- Click Remove Forever, the comment will be deleted
- Now, press Back, it will show what was the content of the comment :)

atoztoa said...

Topic: VIM

Some quick tips...

- '#' and '*' will search the word under the cursor in opposite directions.

- '=' is the magic key for indentation

- While in insert mode, CTRL + o will let you execute a normal mode command and return to insert mode. (Courtesy: http://dailyvim.blogspot.com/2009/04/ictrl-o.html)

atoztoa said...

Topic: Windows Commandline

Don't like the old black 'cmd'?

You can change the color, size etc.

- Right Click on Title Bar (the top bar where the close button is...)
- Select Properties

atoztoa said...

Topic: Microsoft Word

This is for the one's who use "Format Painter" a lot...

+ You can copy the format under the cursor using CTRL + SHIFT + c.
+ To paste that to another location, select the text and press CTRL + SHIFT + v. (Yeah, analogues to Copy and Paste)
+ When you press the Format Painter button, you have that format copied until you copy another format. You can use Format Paste any number of times.
+ By Double Clicking the Format Painter button, the Format Paste mouse pointer can used any number of times until you click the Format Painter button again to turn it off

atoztoa said...

Topic: Microsoft Windows

When you are copying a folder where there is duplicate files, Windows will prompt you for each duplicate file with a choice for replacement (Yes, YesToAll, No, Cancel).

There is no choice called No To All. For choosing not to replace any files, hold SHIFT and press No

atoztoa said...

Topic: Java Decompiler

The best Java Decompiler as far as I know is the one which comes with Gel. It is an old IDE mainly for Java, but supports a lot of languages including HTML preview.

The development has been stopped long time back, you can download the last version from http://www.gexperts.com/products/gel/download.asp

atoztoa said...

Topic: Windows Boot

For restoring/fixing a corrupted Windows Boot partition, run fixboot from Windows Setup Disk.

- Insert the Bootable Disk (it can be bootable disk for ME, NT or higher...)
- Get to the command prompt (in NT and XP, select Recovery Console option)
- Now type fixboot.

Check this post for more info: Trouble Shooting aka Trouble Booting

atoztoa said...

Topic: Mozilla Thunderbird

This is how to make Thunderbird download Emails automatically at specific interval...

- Go to "Tools -> Account Settings -> Server Settings" and then check the appropriate box for "Check for new messages every __ minutes."

- Go to "Options -> config_editor".
- Find the entry 'mail.check_new_mail'. (You can copy n paste this text into the search bar)
- If the value is false, change to true by double clicking.

atoztoa said...

Topic: Ubuntu

Here is how to install .deb packages in Ubuntu...

$ sudo dpkg -i package.deb

atoztoa said...

Topic: Ubuntu

Did you know? In File Browser in Tile mode, just hover the mouse over an mp3 file and the audio starts playing... isn't it kool :)

atoztoa said...

Topic: Income Tax India

To know the refund status of Income Tax Returns, check this website...


https://tin.tin.nsdl.com/oltas/refundstatuslogin.html

atoztoa said...

Topic: Income Tax India

To electronically file Income Tax Returns...



https://incometaxindiaefiling.gov.in/

atoztoa said...

Topic: Ubuntu

To edit Ubuntu Main Menu (similar to start menu), go to

System->Preferences->Main Menu

atoztoa said...

Topic: Vim

To view / edit a file in Hex Mode,

:%!xxd

To change back to normal mode,

:%!xxd -r

atoztoa said...

Topic: HTML/JavaScript

Schedule a command to be executed after a delay using setTimeout function...

Syntax: setTimeout("command", milliseconds);

Always put the command in quotes, or it may not work properly...

atoztoa said...

Topic: Ubuntu

How to set filetype associations...

Right click the file -> Properties.
Go to 'Open With' tab

atoztoa said...

Topic: Ubuntu

How to change the default editor used by Ubuntu programs.

sudo update-alternatives --config editor

atoztoa said...

Topic: SMPlayer AC3 Error!

AVI media with AC3 audio not playing.

Go to Preferences.
Under General->Audio.
Uncheck 'AC3/DTS pass-through S/PDIF'

atoztoa said...

Topic: Ubuntu Panel Autohide Issue!!!

Sometimes when you autohide desktop panel, the panel will disappear and never come back. The other panel(s) may also stop responding.

Reboot the machine.
Execute gconf-editor
Go to apps->panel->toplevels
Uncheck auto_hide in the panel you have modified (top or bottom)
Reboot

atoztoa said...

Topic: Linux Hardware Architecture

To find the Hardware name of your Linux box

uname -m

atoztoa said...

Topic: Linux

To find the version of glibc in your machine...

1. $ /lib/libc.so.6 | head -1

2. $ getconf GNU_LIBC_VERSION

3. $ rpm -q glibc

atoztoa said...

Topic: Google Translate

The easiest way to translate some text into English...

Just go to Google and search with the following...

translate "guten morgen"

Keep the text in double quotes... Google will automatically identify the source language and convert to English...

atoztoa said...

Topic: Mounting .mdf in Linux

For mounting a .mdf image...

sudo mount /somewhere/image.mdf /media/isoimage -o loop

atoztoa said...

Topic: LAMP Server in Ubuntu

For instaling LAMP Server (LINUX APACHE MYSQL PHP) in Ubuntu Karmic...

$ sudo tasksel install lamp-server

atoztoa said...

Topic: Ace archive in Ubuntu

For creating and managing .ace archives, use unace...

$ sudo aptitude -y install unace-nonfree

atoztoa said...

Topic: DNS in Ubuntu

For adding a DNS server... add a line at start of /etc/resolv.conf

nameserver <DNS ip>

Post a Comment