12 May, 2010

Default Ubuntu directories and their purposes

The root of the virtual directory. Normally, no files are placed here
 
/bin 
The binary directory, where many GNU user-level utilities are stored 

/boot 
The boot directory, where boot files are stored
 
/dev 
The device directory, where Linux creates device nodes
 
/etc 
The system configuration files directory
 
/home 
The home directory, where Linux creates user directories
 
/initrd 
Location of files used during the boot process if a RAM disk is required
 
/lib 
The library directory, where system and application library files are stored
 
/lost+found 
Directory where lost filesystem nodes are stored. If your disk crashes, look here for missing files
 
/media 
Mount point used to mount external disks in the virtual directory
 
/mnt 
The mount directory, a common place for mount points used for removable media
 
/opt 
The optional directory, often used to store optional software packages
 
/proc 
Controlled by the kernel, this special directory provides information about
internal kernel processes and can be used to send information to the kernel
 
/root 
The root home directory
 
/sbin 
The system binary directory, where the GNU admin-level utilities are stored
 
/srv 
Used as a base directory on the Ubuntu server platform for data that is served to others, such as web pages
 
/sys 
Similar to the /proc directory, used by the newer Linux kernel to communicate with plug-in kernel modules
 
/tmp 
The temporary directory, where temporary work files can be created and
destroyed
 
/usr 
The user-installed software directory
 
/var 
The variable directory, for files that require write privileges, such as log files
Read rest of entry

How to Mount Your Partitions Permanently in Ubuntu

                                    Linux machines are very much aware in the case of security, but this extra security may sometimes become a headache for simple linux users. For example, if u have separate partitions or hard drives (for your backup, music collection or photo collection), every time you boot up, you have to mount those when required, providing a password which is sometimes very much irritating. The time-saving solution is to mount such media permanently. There are two steps in this process. Firstly to tell Ubuntu where to find the mount and where you want it mounted. Secondly, to create the folder within Ubuntu's recognised file structure to house the mounted media. After you perform this configuration, your backup folder on a secondary disk can be accessed from within your /home/username folder.

Tell Ubuntu Mount & Local Associated Folder Locations 
Open the fstab file that controls your mounts:-
 
sudo gedit /etc/fstab

Find out the name of partition that you are planning to mount  by issueing the following command. It lists recognized partition tables

sudo fdisk -l 

At the bottom of the file, for each partition or drive you wish to mount forever, paste:-
 
/dev/sdb1 /mnt/mydrives 
ext3  users,noatime,auto,rw, nodev,exec,nosuid 0 0

Read man page of mount for more details
 
• /dev/sdb1 - media to mount
• /mnt/mydrives - location to mount to with a friendly name
• ext3 - filesystem
• users - allow all users, alternatively use user
• noatime - don't waste resources recording last access time or, if you  
                                                                          want this info, change to atime
• auto - mount on boot
• rw - read write access
• nodev - prevents unauthorized device mounts
• exec - execute programmes from disk
• nosuid - do not allow set-user-identifier
• 0 - dunno, probably should though
• 0 - ditto
 
Save the file when you’re done. Check out the figure if you have doubts

 

 
Create the Local Folder to House Mounted Media

Now create the folder location for the mount. So, in this example:-

sudo mkdir /mnt/mydrives

Reboot your system to see the Ubuntu automatically mounting the device @ boot time... In Nautilus look for /mnt/mydrives. You can create a launcher for easier access if needed.
 
Symbolic Link to Permanent Mounted Partition

Here's an optional third step for simplifying the navigation. Rather than having to navigate each time to your /mnt folder to find your media, you can shortcut to there from, say, your /home/username folder. An easy way to do this is to open nautilus twice, once navigating to your /mnt folder and, with the other, to your /home folder.
Now, holding down the Ctrl and Shift keys, simply drag the newly mounted media file accross to your /home/username folder which you can see in your /home folder. From now on, when you navigate to your /home/username folder, click on that symlink to  jump  to the contents of the mounted partition. If you delete a file from a symlink in your /home/username folder, you really really do delete the original file.


Read rest of entry

Speed up the startup and shutdown process in Windows XP : registry tweak

Let's try some trick for increasing the speed of booting and shutting down of Windows XP through the group policy editing. 

Open the RUN command using Windows+ R key combination or from the  start menu and type notepad.

In NOTEPAD, copy del C:windowsprefetch tosboot-*.*/q

And save it as ntosboot.bat in your computer

Again open the RUN command and type gpedit.msc 

Click on the COMPUTER CONFIGURATION in the left side pane , under that double click WINDOWS SETTINGS and then double click on the  scripts in the  right pane



 
Again Double Click on the SHUTDOWN in the right window. Then click the  ADD button and then BROWSE to select the saved file ntosboot.bat and open it. (shown in figure)


 

Choose OK and APPLY , Once again click OK and then exit.

Now open the device management window. Take the RUN prompt and type in as  devmgmt.msc

A new window will open under that double click on IDE ATA/ATAPI controllers. Right Click on Primary IDE Channel to select properties
(Shown in the figure)
 
 

Choose the tab called ADVANCED SETTINGS then click on the device 0 or 1, The device contain device type which is not highlighted and chose none in the place of autodetect and Click OK


Now select Secondary IDE Channel and select properties and repeat the process as done above.
 
That's all  for the time being. Just restart your system to see the changes.

Read rest of entry

10 May, 2010

Keyboard shortcuts for Mozilla Firefox

CTRL + A
Select all text on a webpage

CTRL + B
Open the Bookmarks sidebar

CTRL + C
Copy the selected text to the Windows clipboard

CTRL + D
Bookmark the current webpage

CTRL + F
Find text within the current webpage

CTRL + G
Find more text within the same webpage

CTRL + H
Opens the webpage History sidebar

CTRL + I
Open the Bookmarks sidebar

CTRL + J
Opens the Download Dialogue Box

CTRL + K
Places the cursor in the Web Search box ready to type your search

CTRL + L
Places the cursor into the URL box ready to type a website address

CTRL + M
Opens your mail program (if you have one) to create a new email message

CTRL + N
Opens a new Firefox window

CTRL + O
Open a local file

CTRL + P
Print the current webpage

CTRL + R
Reloads the current webpage

CTRL + S
Save the current webpage on your PC

CTRL + T
Opens a new Firefox Tab

CTRL + U
View the page source of the current webpage

CTRL + V
Paste the contents of the Windows clipboard

CTRL + W
Closes the current Firefox Tab or Window (if more than one tab is open)

CTRL + X
Cut the selected text

CTRL + Z
Undo the last action
Read rest of entry

08 May, 2010

Spice your terminal with fortune telling cow and tux in Ubuntu

                              Usually working with the terminal for a long time is a boring task even if you are a geek. Let spice up your gnome terminal with some add-ons, say a cow speaking interesting fortunes. If you are familiar with linux mint, you can see it is an unavoidable feature in the mint's terminal.





. . . installation

Take the gnome terminal and type in as follows . . .

                                   $ sudo apt-get intall cowsay                                   

This is a very small package and the installation will commence in few seconds.


. . . configuration


Take the terminal and type as any of the following methodes


1.
$ cowsay

Then type the message that you want the cow to say and press  Ctrl+D to save and terminate. On pressing this key the cow will start speaking the fortunes.




2.

$ fortune | cowsay

On executing this command cow will display any of the fortune in random from a set of fortunes in the fortune database.




3.

$ fortune | cowsay -n -f -tux.cow

This command will replace the cow with the tux. See the tux saying fortunes instead of the cow.  

Read rest of entry

Important RUN commands for Windows users

             Following are the important run commands that can be used easily for starting some programsin Windows.  To open the run dialog box press the  Windows+R key or goto start and then run.   

      Accessibility Controls  -  access.cpl
      Accessibility Wizard     – accwiz
      Add Hardware - Wizardhdwwiz.cpl
      Add/Remove Programs - appwiz.cpl
      Administrative Tools control – admintools     
      Adobe Acrobat (if installed) – acrobat
      Adobe Photoshop (if installed)- photoshop
      Automatic Updates - wuaucpl.cpl

      Bluetooth Transfer Wizard – fsquirt

      Calculator – calc
      Character Map – charmap
      Check Disk Utility – chkdsk
      Command Prompt – cmd
      Computer Management - compmgmt.msc
      Control Panel – control

      Date and Time Properties - timedate.cpl
      Device Manager - devmgmt.msc
      Disk Cleanup Utility- cleanmgr
      Disk Defragment- dfrg.msc
      Disk Management- diskmgmt msc
      Disk Partition Manager- diskpart
      Display Properties- control desktop

      Event Viewer- eventvwr.msc
    
      Files and Settings Transfer Tool- migwiz
      Findfast- findfast cpl
      Firefox (if installed)- firefox   
      Folders Properties- control folders
  
    Fonts- control fonts
     
      Group Policy Editor (XP Prof)- gpedit.msc

      Help and Support- helpctr
      HyperTerminal- hypertrm

      Indexing Service- ciadv.msc
      Internet Explorer- iexplore
      Internet Setup Wizard- inetwiz
      Internet Properties- inetcpl.cpl

                 try the following on command prompt also if you see nothing

      IP Configuration (Display Connection Configuration) - ipconfig/all 
      IP Configuration (Display DNS Cache Contents)- ipconfig /displaydns
      IP Configuration (Delete DNS Cache Contents)- ipconfig /flushdns
      IP Configuration (Release All Connections)- ipconfig /release
      IP Configuration (Renew All Connections)- ipconfig /renew
     


      Keyboard Properties - control keyboard


         
      Logs Out Of Windows - logoff    


      Microsoft Excel (if installed) – excel
      Microsoft Frontpage (if installed)- frontpg
      Microsoft Movie Maker – moviemk
      Microsoft Paint – mspaint
     
Microsoft Powerpoint (if installed)- powerpnt
      Microsoft Word (if installed)- winword
      Mouse Properties - control mouse
     
      Nero (if installed)- nero
      Network Connections - ncpa.cpl
      Network Setup Wizard - netsetup.cpl
      Notepad – notepad
      
      On Screen Keyboard – osk
      Outlook Express – msimn
    


      Password Properties - password.cpl
      Performance Monitor - perfmon.msc
      Phone and Modem Options - telephon.cpl
      Phone Dialer – dialer
      Power Configuration - powercfg.cpl
      Printers and Faxes - control printers
      Printers Folder – printers
      Registry Editor – regedit
      Remote Desktop – mstsc
      Removable Storage - ntmsmgr.msc
    
      Scanners and Cameras - sticpl.cpl
      Scheduled Tasks - control schedtasks
      Security Center - wscui.cpl
      Shared Folders - fsmgmt.msc
      Shuts Down Windows – shutdown
      Sounds and Audio - mmsys.cpl
      System Configuration Editor - sysedit
      System Configuration Utility - msconfig
      System Properties - sysdm.cpl

    
      Task Manager – taskmgr
      Telnet Client – telnet
    
      User Account Management- nusrmgr.cpl
      Utility Manager – utilman
    
      Windows Backup Utility (if installed)- ntbackup
      Windows Explorer – explorer
      Windows Firewall- firewall.cpl
      Windows Magnifier- magnify
      Windows Media Player – wmplayer
      Windows Messenger – msmsgs
      Windows Picture Import Wizard (need camera connected)- wiaacmgr
      Windows System Security Tool – syskey
      Windows Update Launches – wupdmgr
      Wordpad – write
Read rest of entry

Registry hack : Speed up internet in Windows

In Windows the Microsoft uses a good amount of your internet bandwidth for Windows Updates. Lets do the following registry edit to avoid this bandwidth sharing.

Follow the steps below :

Go to Start, open Run and type gpedit.msc, then enter. This will open the group policy editor.

Navigate to Local Computer Policy / Computer Configuration / Administrative Templates / Network / QOS Packet Scheduler.

Now, Click QOS Packet Scheduler and then double click Limit Reservable Bandwidth. You will see that is not configured. But the truth is Under ‘Explain’ tab. By default, Microsoft reserves 20% of the bandwidth. But you can change this setting.

ENABLE reservable bandwidth, then set the bandwidth limit to 0%.

Thatz all the hack. Now microsoft reserves 20% of 'nothing'
Read rest of entry

07 May, 2010

How to hide a hard disk drive in Windows


Through this hack you can disable the display of local or networked drives when you open My Computer

To Do this Follow The Steps

1
Open the run dialog box from the start menu.
Open Registry editor by typing regedit in the run dialog box.

2
HKEY_CURRENT_USER\Software\Microsoft\Windows\
 
3
Now in the right pane create a new DWORD item and name it NoDrives (it is 
case sensitive).
 
4
Now modify its value and set it to 3FFFFFF (Hexadecimal).
 
5
Now restart your computer.
 
Now when you click on My Computer, no drives will be shown.
To enable display of drives in My Computer, simply delete this DWORD item that you created. Restart the computer to see the changes happened.
  

Read rest of entry

How to change the My Documents, Program Files location in Windows


 How to change the location of the 
My Documents  folder

 
By default the location of the my documents folder in Windows is C: drive (not alwys, usually the drive where you installed Windows)

Open the run dialog box from the start menu.

Open Registry editor by typing regedit in the runn dialog box.

Go to HKEY_CURRENT_USER\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ Shell Folders

3
Double click on the "Personal"  on the right pane to edit the location of the My Documents. Better copy paste the location from the windows explorer to avoid errors in the path names.




How to change the location of the Program Files folder

The Program Files folder is the default loocation preferred by the wondows on
installing the application softwares unless it is specified manually.

1
Go to
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion

2
Change the value of "ProgramFiles", or "ProgramFilesDir"



Read rest of entry

02 May, 2010

Hacking the cd command

                                                                                                               
The cd command is a bash command in linux is meant for changing the directory in a terminal environment. This post is about a hacking the cd comment.

There is an environment variable called PATH related to the cd command. When you type a command, your system looks through all the directories defined in the PATH environment variable until it finds the command. If it doesn't find the command by the time, it tells you it can't find the file. There's a similar environment variable called CDPATH. Let's use the CDPATH for the tweak.

The basic syntax of cd command is


$ cd somewhere

We can use this CDPATH to avoid typing an entire path of the frequently accessed directories..
Here's how it works.

/home/blogger/Documents/nw/folder1
/home/blogger/Documents/nw/folder2
/home/blogger/Documents/nw/folder3
Here's what you want to do. You want to be able to jump right to the folder2 directory without having to type the entire path. Here's how to set the CDPATH environment variable so that you can do that:

$ export CDPATH=:.:/home/blogger/Documents/nw

This command does not include any of the chapter directories in the CDPATH. That's because you want the CDPATH to define the directory immediately above the directory you want to find. Remember, the system searches the directories listed in the path for the contents you specify on the command line. The argument folder2 is what you're looking for. folder2 exists in the directory /home/blogger/Documents/nw, so that is the directory you want to include in your search CDPATH.

If you need to access the directory folder2, you only need to type this


 $ cd folder2

The command should take you immediately to the directory /home/blogger/Documents/nw/folder1

The problem ???

Suppose you also created the following directories according to the same pattern mentioned earlier:

/home/blogger/Documents/internet/folder1
/home/blogger/Documents/internet/folder2
/home/blogger/Documents/internet/folder3

Naturally, you have to add a new path to your CDPATH environment variable:


$ export CDPATH=:.:/home/blogger/Documents/nw:/home/blogger    
                                                                                           /Documents/internet  

As with the PATH environment variable, you separate different search paths with a colon. The system searches through each path from left to right.

Now issue this command:

$ cd folder2

The problem is that, it puts you in the same place as before, /docs/pub//home/blogger/Documents/nw/folder3. That is not what you expected or desired. But it happened because the cd command searches the CDPATH environment variable paths from left to right. It searched the linuxhacks location first and found folder2. So, that's where it assumed you wanted to go. 

The Solution

One way to avoid the problem described earlier is to define the CDPATH in this way:

$ export CDPATH=:.:/home/blogger/Documents/

If you want to get to folder of internet, you simply type the following:

$ cd internet/folder2


Another cd Trick
This is one among the simplest of all tricks for cd, yet few people know of it. Suppose you are working in the directory /home/blogger/Documents/nw and then you change to the directory /usr/X11R6/lib/X11/fonts/TrueType. You can jump back to the previous directory simply by typing the following:

$ cd  -

This simple command returns you to the last directory you were using before you changed to the current one.

Read rest of entry

01 May, 2010

How to take a Screenshot from the Command Line

There is no need of a graphical utility to take the screen shot of your desktop, no need to wonder how.. Lets try it with your terminal. Terminal is a powertool and solution to all the problems in linux

The advantage of using commandline tool is that if you need to take a screenshot in an environment, where you cannot run a graphical screenshot utility prefer this method.

1. Take a Screenshot from an X Terminal

Take the gnome terminal and type in as follows

   $ sleep 5; import -window root screen.png   
                       
                        The sleep command delays the process for five seconds before the screenshot is taken. This is the time to minimize windows, expand menus, or make other necessary adjustments before the screenshot is taken. By changing the sleep value you can control the delay before the screenshot is taken.                         

                        The import utility that is part of the ImageMagick suite of tools to take a screenshot of the entire window and name the image screen.png. If you want to grab a particular part of the screen, you also can use the -crop option to grab that specific area

                      $import -crop 500x400                  

And if you run import without -window your cursor will change to a crosshair, which you can drag over the area you want to capture. PNG is a recommended screenshot format, but ImageMagick supports a range of different formats, so you can use what you need. Type as below to see the man page to know more about import.

                            $ man import                              


2. Take a Screenshot from a Command-Line Terminal

               If you need to take a screenshot from a command-line console while X is running elsewhere on the system, adjust the command line and add a few additional features to it. This method is commonly used when you need a screenshot of an installation routine or a program running on an embedded device.To do this, first access the shell that runs behind the installer by pressing Ctrl-Alt-F3.This terminal is called tty3. It provides you with a simple shell in which you can run the commands to grab the shot.

                       Before you can run the command to grab the shot, find out the display number of the running X server. Every X server has a unique display number that is mapped to the particular user who is using X. You can find this by typing in the  terminal as follows

                        $ echo $DISPLAY                            

Let your display number returns :0.0, Then the command to grab the screenshot is:

 $ chvt 7; sleep 5; import -window root screen.png -display :0.0 ; chvt 3  

Three actions will take place following to this,

process of switching to the X terminal
grabbing the screenshot
switching back to your current command-line terminal.


The first command (chvt 7) switches to the X terminal say gnome (usually the 7th terminal is the X), and then the second command (sleep 5) pauses the process for two seconds to switch to the 7th terminal. Then the import command is used to grab the root window on display :0.0 and save the shot as screen.png. Finally, the terminal is switched back to terminal 2 (chvt 2).

You can change the virtual terminal by changing the number after the chvt.
Read rest of entry

Compiz effects

Enabling, Rotating and playing with Desktop   
cube

On the settings manager, Mark the box corresponding to the Desktop Cube button. Then click on the Desktop cube to configure the behaviour, appearance and transparency options corresponding to the  to the Desktop cube.
 

Rotate the cube

Mark the box corresponding to the Rotate Cube. Click on the icon to change the settings related to the cube rotation.     

 

Cube Reflection and Deformation
Checkout for the icon Cube Reflection and Deformation. Enable this featutre also inorder to deformate your desktop during the rotation.
See the picture below



Enabling the 3D Windows

Enable the 3D Windows to add up the beauty of the cube and rotation...

 

Adding mouse effects

Check the 'Show mouse' to rotate particle around your mouse
 Zooming Desktop
Not the enhanced zooming option. Mark the 'Zoom Desktop option'

Wobbly windows

To add the rubberband effect to windows on the screen

 
Snow effect

The snow will start fall over your desktop...



Window preview

Window preview will enable a thumbnail view of the windows without opening it
Painting fire on the screen

Check this option to paint fire on your desktop.


Window Switcher

Enable the shift switcher option to give effects to window switching



There are many other graphical customization are there available in the compiz. The main advantage of the compiiz is that it won't eat up your entire processor for it's graphical features. Compiz provides a deasent amount utiliization of the processor and RAM without affecting the other CPU activities...  
Read rest of entry
 

Terminal Diary | techblog Copyright © 2009 Gadget Blog is Designed by jintu jacob Powered by Blogger