Roshan Book

My Tech Notebook

Monthly Archives: July 2011

Easy way to embed a mp3 audio on website


Configuring zend framework and zend tools

One command to install and configure zend framework and zend tools on ubuntu

sudo apt-get install zend-framework

Install and Configure phpMyAdmin on Ubuntu LAMP

PhpMyAdmin is a nice database management and administration tool, it is easy to install it, but some people are having problems making it work under apache, that’s because it needs configuration. I presume you already have LAMP installed and configured on your machine, if not, please read this post – Install and Configure LAMP on Ubuntu first.

Just in case you haven’t installed phpMyAdmin yet, type the following line in the Terminal:
apt-get install phpmyadmin

To set up under Apache all you need to do is include the following line in /etc/apache2/apache2.conf, first type the following command to open up this file:
gksudo gedit /etc/apache2/apache2.conf

Add the following line of code inside apache2.conf:
Include /etc/phpmyadmin/apache.conf


Now restart Apache:
sudo /etc/init.d/apache2 restart

Point your browser to: http://domain/phpmyadmin, you should be able to see the phpMyAdmin landing page now!

BOOTMGR missing while booting ubuntu from liveusb

Creating Bootable USB for Windows 7

This guide works 100% for Vista & Windows 7 unlike most of the guides out there. I have seen many sites/blogs that have “Install Vista from USB guide” but either with incomplete steps or not working guide. I have also seen some guides that don’t’ use proper commands in this guide. After spending many hours I have come up with this 100% working guide.

Bootable USB drive

I just did this method on one of my friends machine and installed the new Windows 7BETA. The main advantage is that by using USB drive you will be able to install Windows 7/Vista in just 15 minutes. You can also use this bootable USB drive on friend’s computer who doesn’t have a DVD optical drive.

The method is very simple and you can use without any hassles. Needless to say that your motherboard should support USB Boot feature to make use of the bootable USB drive.


*USB Flash Drive (Minimum 4GB)

*Windows 7 or Vista installation files.

Follow the below steps to create bootable Windows 7/Vista USB drive using which you can install Windows 7/Vista easily.

1. Plug-in your USB flash drive to USB port and move all the contents from USB drive to a safe location on your system.

2. Open Command Prompt with admin rights. Use any of the below methods to open Command Prompt with admin rights.

*Type cmd in Start menu search box and hit CtrlShiftEnter.


*Go to Start menu > All programs > Accessories, right click on Command Prompt and select Run as administrator.

3. You need to know about the USB drive a little bit. Type in the following commands in the command prompt:

First type DISKPART and hit enter to see the below message.

Bootable USB Drive

Next type LIST DISK command and note down the Disk number (ex: Disk 1) of your USB flash drive. In the below screenshot my Flash Drive Disk no is Disk 1.

4. Next type all the below commands one by one. Here I assume that your disk drive no is “Disk 1”.If you have Disk 2 as your USB flash drive then use Disk 2.Refer the above step to confirm it.

So below are the commands you need to type and execute one by one:







(Format process may take few seconds)



Don’t close the command prompt as we need to execute one more command at the next step. Just minimize it.

Bootable USB Drive

5. Next insert your Windows7/Vista DVD into the optical drive and check the drive letter of the DVD drive. In this guide I will assume that your DVD drive letter is “D” and USB drive letter is “H” (open my computer to know about it).

6. Maximize the minimized Command Prompt in the 4th step.Type  the following command now:

D: CD BOOT and hit enter.Where “D” is your DVD drive letter.

CD BOOT and hit enter to see the below message.

7. Type another command given below to update the USB drive with BOOTMGR compatible code.



Where “H” is your USB drive letter. Once you enter the above command you will see the below message.

8. Copy your Windows 7/Vista DVD contents to the USB flash drive.

9. Your USB drive is ready to boot and install Windows 7/Vista. Only thing you need to change the boot priority at the BIOS to USB from the HDD or CD ROM drive. I won’t explain it as it’s just the matter the changing the boot priority or enabling the USB boot option in the BIOS.

Note: If you are not able to boot after following this guide means you haven’t set the BIOS priority to USB. If you got any problem in following this guide feel free to ask questions by leaving comment.

Fixing FFmpeg

A common question is “why doesn’t the repository FFmpeg convert to mp3, aac, mpeg4, etc?”. Ubuntu doesn’t make it very clear to the general user why the repository FFmpeg is limited or how to fix this issue. This is reflected in the number of forum questions relating to this topic.

Why is FFmpeg from the repository so limited?
All application software Ubuntu installs by default must be considered free, but Ubuntu views some encoders and formats to be proprietary or commercial. Users must install these packages on their own. See the Ubuntu Licensing Policy for more details.

How do I fix FFmpeg?
There are several options:

A. Compile FFmpeg yourself
B. Install the extra libraries
C. Use the Medibuntu repository

A. Compiling FFmpeg yourself (for all Ubuntu versions)
The official FFmpeg answer is to compile it yourself, giving you the option to get what you want with the bug-fixes, enhancements, and benefits of the most recent FFmpeg revision. This is an excellent solution and is explained here:

HOWTO: Install and use the latest FFmpeg and x264

This is the option that I personally use, and although it is not too hard, compiling may not be for everyone for a variety of reasons and the next options could be considered easier.

B. Installing the extra libraries
This is the quickest and easiest option for most users. FFmpeg from the repository does not include some encoders for formats such as: H.263, aac (libfaac), mp3 (libmp3lame), H.264 (libx264), xvid (libxvid), and mpeg4. You can fix this by installing the extra FFmpeg libraries. Open up Terminal and enter:

sudo apt-get install ffmpeg libavcodec-extra-52

Note: This package does not support libfaac (an AAC encoder), AMR-NB encoding, and AMR-WB decoding. I recommend using libavcodec-extra-52 from the Medibuntu repository if you need this functionality. See option C. Medibuntu.

C. Medibuntu
Medibuntu is a third-party repository that contains packages that are unable to be included in the official Ubuntu repositories. To install FFmpeg from Medibuntu open Terminal (Applications -> Accessories -> Terminal) and run the following:

sudo wget$(lsb_release -cs).list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update && sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update

This huge command (adapted from Medibuntu – Community Ubuntu Documentation) will install the repository information to your computer then update and authenticate the new repository. Now install FFmpeg:

Ubuntu Natty Narwhal 10.10, Ubuntu Maverick Meerkat 10.10, Ubuntu Lucid Lynx 10.04 & Ubuntu Karmic Koala 9.10

sudo apt-get install ffmpeg libavcodec-extra-52

Ubuntu Hardy Heron 8.04

sudo apt-get install ffmpeg

That’s it. Now you have a non-crippled version of FFmpeg.

Undoing Changes Made By This Guide
B. Uninstalling the unstripped or extra libraries

sudo apt-get remove ffmpeg libavcodec-*-5*

C. Uninstalling FFmpeg and the Medibuntu Repository

sudo apt-get autoremove ffmpeg medibuntu-keyring && sudo rm /etc/apt/sources.list.d/medibuntu.list && sudo apt-get update

Applications you must install after installing Ubuntu

This is a ripoff from

10 Best Applications for Ubuntu 10.10

Submitted by beakkon on Fri, 10/08/2010 – 20:08


Whether you have already installed Ubuntu 10.10 , or you are going to, this article will inform you nonetheless about the 10 best applications for the newbie Ubuntu 10.10. From enhancing looks toutilities this article best describes the ten applications that you must install on Ubuntu 10.10 and whats more? You can also follow the simple download and installation instructions and get these 10 best applications on your Ubuntu 10.10  working easily.

The open source Ubuntu community is working hard to make sure that Ubuntu is no longer meant just for geeks to use.  Enhancing the looks of your out of the box Ubuntu system to make it pleasing to the eye, more comfortable to work on, and adding its powers are the priorities. So lets try and make Ubuntu 10.10 a beautiful monster!  by downloading and installing these 10 best applications for Ubuntu 10.10 –


 Bisigi Themes 

 This is the collection of most amazing gnome themes available for Ubuntu , makes Ubuntu look more attractive. Once installed, you do not need anything else to make your Ubuntu 10.10 system look more attractive than it ever was.

So what are you waiting for?

Open your Ubuntu 10.10 terminal and copy the following commands,

sudo add-apt-repository ppa:bisigi/ppa

After this,

sudo apt-get update

and now install the collection using,

sudo apt-get install bisigi-themes



After installation completes, go to System -> Preferences -> Appearance and the first look of it makes you amazed. More then a dozen of some beautiful themes that are eagerly waiting to get applied on your desktop!


Select theme of your choice and enjoy .

Screenshots of some of my favourite themes –




After enhancing the looks, what about enhancing  your workstation by installing a really cool launch bar? So here is one of the best launch bar available for your Ubuntu system.


If you want to make your launch bar of your Ubuntu system look alluring  then, cairo-dock is undoubtedly the best option. It includes multi-docks, launchers and a lot of useful applets. Infact the most adorable feature is that applets can be detached from the dock to act as desktop widgets.

Now lets install it –

Copy the following commands –

sudo -v

echo “deb $(lsb_release -sc) main ## Cairo-Dock-PPA-Stable” | sudo tee -a /etc/apt/sources.list

sudo apt-key adv –keyserver –recv-keys E80D6BF5


Now, update the repository,

sudo apt-get update

And finally install cairo-dock,

sudo apt-get install cairo-dock cairo-dock-plug-ins

After installation, you can launch it from Applications -> System Tools -> Cairo Dock.






This is another application to make your desktop adorable and the most powerful desktop you had on your Ubuntu system ever before. Screenlets are small owner-drawn applications that can be described as “the virtual representation of things lying/standing around on your desk”. Clock, rulers, calendars, gmail, picframes, weather, feed reader, launcher and much much more. I will get tired in telling you the possibilities but they won’t end. So better install it yourself and check it out!!!

Copy the following command in you terminal-

sudo apt-get install screenlets

Then to launch it go to Applications -> Accessories -> Screenlets and this will open Screenlets Manager. You can choose your favourite widgets from here and add them to let your Ubuntu system shout – ‘I am the most powerful Ubuntu desktop‘.




Ubuntu Tweak

Ubuntu Tweak is another powerful application that makes it very easy to configure your Ubuntu system. You do not need to know all the geek to configure Ubuntu. This application provides many useful desktop and system options that the default desktop environment does not provide you with. Weather you are a geek or a regular user configuring Ubuntu with Ubuntu Tweak is what you are going to love!

You can download it from here –

Or, you can install this application by the following commands –

sudo add-apt-repository ppa:tualatrix/ppa


Then, run the update command-

sudo apt-get update

Finally, install it using –

sudo apt-get install ubuntu-tweak


After installation, go to Applications -> System Tools -> Ubuntu Tweak and as said you no longer need to be a geek to configure your Ubuntu 10.10 system.



Some of the features of this application are –

  • Gnome session control




  • Window Manager Settings – Felt uncomfortable with window’s buttons on left? Then you can change their position with Ubuntu Tweak



  • Desktop-recovery


Not to forget –

  • Login Settings – You can easily cusomize your login screen.



This is not all, they are many more options available, so just download and keep tweaking with just simple clicks.


Compiz is a compositing manager, which means that this great application for your Ubuntu 10.10 enhances the overall user interaction by adding fancy effects to your windows, from drop shadows to awesome desktop effects. Compiz can substitute for the default Metacity in GNOME. Compiz is one of the first compositing window managers for the X Window System that uses 3D graphics hardware to create fast compositing desktop effects for window management.
We will install compiz with SimpleConfig settings manager. 

Follow these simple steps to install Compiz,

sudo apt-get install simple-ccsm compiz-fusion-plugins-extra compiz-fusion-plugins-main compiz-plugins emerald


To launch Simple CompizConfig settings manager, go to System –> Preferences –> SimpleCompizConfig Settings Manager 




You can change animation effects –



To customize desktop-



See the effect of setting appearance to Desktop cube –


VLC Media Player 


If you have been using Ubuntu before then you do not need to know more about VLC. This is the best media player for a linux based system as it plays everything and that means just playing everything on your Ubuntu 10.10 system.  It is a powerful media player which supports and plays almost all of the media codecs and video formats. And whats more, want to play damaged media files? then VLC can do it charmingly for you. Missing or broken pieces wont stop in VLC. All the video and audio information that remains can be played through this powerful media player.


Just one step to go and you can play just everyhting .

Copy the following command in your terminal,

sudo apt-get install vlc            


After installation go to Applications –> Sound & Video –> VLC media player.


vlc     vlc-screenshot


Dont like Ubuntu games? Still have more affinity for window’s games? Games is the only reason which making you to switch completely from the Windows to Linux? Then here is a must have application for all game freeks. PlayOnLinux is a powerfull piece of sofware which allows you to easily install and use numerous games and applications designed to run just with WindowsSo you just need to install this and in a few minutes you will be able to play your favourite Window’s games on Ubuntu .

What are you waiting for, open your terminal and copy the following command –

sudo apt-get install playonlinux


After the installation go to Applications –> Games –> PlayOnLinux .





 Install games


Infact you can install Windows media Player-


And you can also install soul of windows, MS office.



For further installation instructions or documentation visit


XBMC is an award-winning free and open source (GPL) software media player and entertainment hub for digital media. It is a popular alternative to Microsoft‘s Windows Media Center and Apple‘s Front Row. XBMC features several open APIs to enable third-party developers to create capabilities which extend XBMC with a multitude of addons, such as plugins, scripts, skins/themes, visualizations, screensavers, web scrapers, web interfaces, and more. XBMC developers encourages users to make and submit their own addons to add additional content accessible from within XBMC.


Open your terminal and type the following commands to install –

sudo add-apt-repository ppa:team-xbmc
sudo apt-get update
sudo apt-get install xbmc


xbmc    xbmc-screenshot


 filezilla FileZilla is free, open source, cross-platform FTP software, consisting of FileZilla Client and FileZilla Server. Filezilla is the best FTP client for Ubuntu just install it and enter some details and there you find yourself transferring files to your remotehost in the best and the mpst powerful way.

You can simply install this application by –

sudo apt-get install filezilla

After installation , you can open it from Applications –>Internet –>FileZilla.





logo-pidgin Pidgin is the last application that you need to install on your Ubuntu system. Pidgin is easy to use and free chat client that supports a number of protocols. The innumerable users that it has speaks of its power and usabilty. This amazing application lets you connect to your e-pals on AIM, Googles – Gmail, MSN, Yahoo, and many more chat networks all at once. So just download this application and keep and let talk out your social life with just one application!



You can either download it from-

or install it through command terminal –

sudo apt-get install pidgin

After installation you can launch it from Applications –>Internet –>Pidgin Internet Messenger.



Quick hacks for Ubuntu

This is an amazing article published at Techsupportalert . It has some amazing tips and tricks for ubuntu system and it could prove to be very very useful.

Customize the Panel

Ubuntu includes a top panel and a bottom panel by default. If you prefer to keep only one panel at the bottom just like the Windows Taskbar, then these are the steps to follow:

  1. Ubuntu DesktopDelete the bottom panel: right-click over it and click “Delete This Panel”.
  2. Move the top panel to bottom: right-click over it, select “Properties” and change Orientation from “Top” to “Bottom”.
  3. Add running program buttons: right-click the panel, select “Add to Panel”, scroll down and select “Window List”, click “Add”.
  4. Replace the Menu Bar (“Applications-Places-System”) with the “Main Menu” to save space in the panel:
    1. Right-click the “Menu Bar” and select “Remove From Panel”.
    2. Right-click the panel, select “Add to Panel” and choose “Main Menu”, click “Add”.
    3. Right-click the items (Firefox, etc) and untick “Lock to Panel”.
    4. Right-click the added “Main Menu”, select “Move” to relocate it to the far left.

These are basic changes. The panels are much more flexible than the Windows Taskbar in that many items in the panels can be easily added, removed or configured.

   The Main Menu shows the “Lock Screen”, “Log Out” and “Shut Down” items if you remove the “Indicator Applet Session” item (which shows your username and the shutdown button to the right of the panel). These three items are hidden from the Main Menu when the Indicator Applet Session item is on the panel.

   If you need to restore the panels to the original state, enter the following commands into the Terminal and re-start the system:

  1. sudo gconftool-2 –shutdown
  2. sudo rm -rf .gconf/apps/panel
  3. sudo pkill gnome-panel

   At any point if your customized desktop settings caused a problem and you wish to reset all back to their defaults, then enter this command sudo rm -rf .gnome .gnome2 .gconf .gconfd .metacity in the Terminal, log out and log back in to the system.

Pin Programs to the Panel

Frequently used programs can be easily pinned to the panel.

  1. Browse to the program from “Applications” or “Main Menu”.
  2. Drag and drop the program to an empty space in the panel, or right-click the program and select “Add this launcher to panel”.
  3. Right click the program icon, select “Move” and drop it to a new place in the panel.
  4. Right click the program icon and select “Lock to Panel”.

See also “Enable Superbar“.

Set Fully Transparent Panel

When you set the panel to be transparent in the default Ambiance theme in Ubuntu, you will find that some panel items’ backgrounds are not transparent, but you can make them transparent and consistent with others, following these steps:

  1. Ubuntu DesktopGo to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter cp -R /usr/share/themes/Ambiance ~/.themes/
  3. Enter gedit ~/.themes/Ambiance/gtk-2.0/apps/gnome-panel.rc (for Ubuntu 11.04 or 10.10) OR gedit ~/.themes/Ambiance/gtk-2.0/gtkrc (for Ubuntu 10.04), to open the file with gedit.
  4. Search for this line bg_pixmap[NORMAL] = “img/panel.png” (for Ubuntu 11.04 or 10.10) OR bg_pixmap[NORMAL] = “panel_bg.png” (for Ubuntu 10.04)
  5. Ubuntu DesktopComment out the line by placing a # at the beginning of the line, like this: #   bg_pixmap[NORMAL] = …
  6. Save the file.
  7. Go to System > Preferences > Appearance, switch to the other theme and then back to the Ambiance theme.

   If you’d to change to the New Wave theme, then enter cp -R /usr/share/themes/”New Wave” ~/.themes/ in step 2, enter gedit ~/.themes/”New Wave”/gtk-2.0/gtkrc in step 3, search for and comment out this line bg_pixmap[NORMAL] = “Images/Panel/PanelBarLong.png” in steps 4 and 5 respectively.

Enable Superbar

In Windows 7, frequently used programs can be pinned to the taskbar (hence called Superbar). Likewise, DockBarX, a Gnome panel plugin, can be added to Ubuntu to achieve almost the same effect to pin and unpin or launch the applications from the panel.

  1. DockBarX AppletGo to Ubuntu Software Center > Edit > Software Source.
  2. Select “Other Software” and click “Add”
  3. At APT line, enter ppa:dockbar-main/ppa, click “Add Source” and “Close”
  4. At the left panel of Ubuntu Software Center, select “PPA for Dockbar Main Group”, which is added after the above steps
  5. At the right panel, select DockbarX and click “Install”
  6. Wait for the cache to be updated, then right click the panel and click “Add to Panel”.
  7. Select the DockBarX Applet and click “Add”.

   A thumbnail preview of a running program is also available to DockBarX. To enable this feature, right-click the DockBarX item on the panel, select Properties, choose Window List and tick “Show Previews”. Other preferences such as appearance, window item and group button can also be configured by users.

Change Font Type and Color of Panel Clock

The font type and color of the panel clock follow the windows text in a theme by default. In particular, if the font color is black and shown on a dark background through a transparent panel, you can’t read the clock clearly, but you can tweak it by changing the font color. And you can define the font type for your panel clock as well.

The code in Step 1 below sets the font color to white and applies DS-Digital font (See  below), bold and size 16.

  1. Panel ClockOpen up the text editor Gedit and paste the following code:
    style “my-panel-clock”
    fg[NORMAL] = “#FFFFFF”
    font_name = “DS-Digital Bold 16”
    widget “*.clock-applet-button.*” style “my-panel-clock”
  2. Save the file as .gtkrc-2.0 (including the dot in front of the filename) inside your home directory /home/your_user_name.
  3. Log out and log back in (OR enter killall gnome-panel into the Terminal) to see the change.

   The DS-Digital font can be downloaded here. After downloading, unzip the file and install the font into the system for use. See Install Extra Fonts.

   The filename leading by a dot represents it’s a hidden file and visible by toggling the key Ctrl-H in the Nautilus file browser.

Move Window Control Buttons to the Right

If your Ubuntu system sets the Minimize, Maximize and Close buttons to the left in a window and you prefer to change them to the right, then follow these simple steps:

  1. Move buttons to rightPress Alt+F2 to bring up “Run Application” window.
  2. Type gconf-editor into the box, click “Run” to bring up Configuration Editor.
  3. Browse to apps > metacity > general, look for “button_layout” on the right panel.
  4. Change the value in the “button_layout” from close,minimize,maximize: to menu:minimize,maximize,close and press the Enter key.
Open Up a Window in Center

When running an application without maximized, Ubuntu always puts it in the left-top corner of the desktop by default, but you are allowed to set a program window to open up in the center of the desktop area.

  1. CompizConfig Settings ManagerGo to System > Preferences > CompizConfig Settings Manager
  2. Select “Windows Management” from the left panel.
  3. Click “Place Windows”.
  4. Change Placement Mode from “Smart” to “Centered”, click “Back” and “Close”.

Ideally, the window manager in Ubuntu should restore the last known position of an application window, but it does not do that unless an application remembers its own window position. (See reported bugs)

Roll Up and Down a Window

When you double-click the title bar of a window, the default setting is to maximize a window. Since there’s already a maximize button you can use for this, I always like to change the default setting to rolling up (or ‘shading’) a window when I double-click on its title bar.Window Shading

  1. Go to System > Preferences > Windows
  2. In “Titlebar Action”, select “Roll up” (or “Shade” where applicable), from the drop-down list.

Now you can roll up a window when you double-click its title bar, and roll it down by double-clicking the title bar again. Simple as that.

Customize the Theme

Themes in Ubuntu can be customized to match the applications or suit your needs. I once tried the “New Wave” theme and the menu (File, Edit, View, etc) was hardly visible on the dark background in OpenOffice, but customizing the “New Wave” theme with “Ambiance” Controls solved the problem. These are easy steps to customize a theme, for example, allowing the “New Wave” theme to mix with the “Ambiance” Controls.

  1. Customize the ThemeGo To System > Preferences > Appearance.
  2. Under the “Theme” tab, click the “Customize” button while the “New Wave” theme is selected.
  3. Under the “Controls” tab, click any other control item such as “Ambiance” and click the “Close” button.
  4. Now it becomes your Custom theme and you can save it as a new theme, such as “New Wave with Ambiance Controls”.
Set Aero Glass Effect

In Ubuntu you can set nearly the same aero glass effect to window borders with alpha transparency as available in Windows 7.

  1. Aero Glass EffectPress Alt+F2 to bring up “Run Application” window.
  2. Type gconf-editor into the box, click “Run” to bring up Configuration Editor.
  3. Browse to apps > gwd, look for “metacity_theme_active_opacity” on the right panel.
  4. Change the value in “metacity_theme_active_opacity” from 1 to 0.75 (or smaller such as 0.5 for more transparency).
  5. Then go to System > Preferences > CompizConfig Settings Manager
  6. Select “Effects” from the left panel.
  7. Tick “Blur Windows” and click the “Close” button. (Note: default values in Blur Windows can be applied.)

   If the aero glass effect doesn’t work, check if you have updated your display driver. Go to System > Administration > Additional Drivers, activate the recommended graphics driver and restart the system.

Enable Aero Snap (Ubuntu 10.10 & 10.04 only)

In Windows 7, you can click and drag a window to the left or right edge of the desktop and it will fill half of the screen, or snap a window to the top edge of the desktop and it will be maximized.

In Ubuntu 11.04, you can click and drag a window to the left, right or top edge of the desktop to achieve the same result, but in Ubuntu 10.10 or 10.04, you need some tweaking as follows.

  1. In addition to CompizConfig Settings Manager, install WmCtrlif not added.
    1. Go to Applications (or Main Menu) > Accessories > Terminal.
    2. Enter sudo apt-get install wmctrl
    3. Enter password when prompted.
  2. Go To System > Preferences > CompizConfig Settings Manager.
  3. Select “General” from the left panel and click “Commands”.
  4. In Command line 0, 1 and 2, paste the following codes:
    1. Command line 0, paste WIDTH=`xdpyinfo | grep ‘dimensions:’ | cut -f 2 -d ‘:’ | cut -f 1 -d ‘x’` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1
    2. Command line 1, paste WIDTH=`xdpyinfo | grep ‘dimensions:’ | cut -f 2 -d ‘:’ | cut -f 1 -d ‘x’` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1
    3. Command line 2, paste wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
  5. In the same window, click “Edge Bindings” tab.
  6. Change Run Command 0, 1 and 2 from “None” to “Left”, “Right” and “Top” respectively.
  7. Click “Back” button and select “General Options”, change “Edge Trigger Delay” to about 500.
Hide Drive Icons on the Desktop

Ubuntu adds an icon to the desktop for every removable drive that you attach to your system. The icons can be hidden by these steps:

  1. Press Alt+F2 to bring up “Run Application” window.
  2. Type gconf-editor into the box, click “Run” to bring up Configuration Editor.
  3. Browse to apps > nautilus > desktop.
  4. Untick “volumes_visible” and close the window.

The drive icons would then disappear from the desktop. Remember that you can always access the drives from “Places”.

Change Wallpapers Automatically

You can right click your desktop, select “Change Desktop Background” and choose any one of the wallpapers pre-installed, but you need to do it each time you want to change a wallpaper. What about changing a wallpaper automatically within a certain time interval? Try Wally.

  1. Change Wallpapers with WallyGo to Applications (or Main Menu) > Ubuntu Software Center, enter wally into the Search box and click “Install”. (See  below.)
  2. Press Alt-F2, enter wally and click the “Run” button.
  3. Right-click the Wally icon on the panel, select Settings.
  4. Click “Folders” in the left column, then add /usr/share/backgrounds to the Folder box and tick “Include subfolders”.
  5. Click “Settings” in the left column, then tick “Play automatically on application starts”.
  6. Set the application to auto start, using this tip Auto Start Up an Application (as Wally’s option to “Start automatically when system starts” being disabled).

Your wallpaper on the desktop will automatically change following these basic settings when you log back in the system (or right click the Wally icon on the panel and select “Play”).

   If you like to get the latest version of Wally which has an option to disable splash screen and auto quit, go to developer’s site to download. After which, right click the .deb file and select “Open with Ubuntu Software Center” to install, then follow Step 2 above.

Add or Change Keyboard Shortcuts

Keyboard shortcuts are preset in the system, but you can add new ones or change them easily. For instance, change the default shortcut Ctrl+Alt+T (Run a Terminal) to Win+R (press R while holding down the Windows key, also known as Super key) by the following steps:

  1. Keyboard ShortcutsGo To System > Preferences > Keyboard Shortcuts
  2. Browse to Desktop > “Run a terminal”
  3. Click on the Shortcut, and it shows “New shortcut…”
  4. Press Win+R, and it shows Mod4+R
  5. Click the Close button and try the new shortcut.

   To disable a shortcut, press Backspace when it shows “New shortcut…” after the step 3 above.

   Shortcuts begin with XF86 refer to special keys available to some multimedia keyboards.

   Keyboard shortcuts can also be set by changing keybinding values with Configuration Editor. Press Alt+F2 and enter gconf-editor, then navigate to apps > gnome_settings_daemon > keybindings, or apps > metacity > global_keybindings and window_keybindings.

Terminate Unresponsive Programs

Xkill is part of the X11 utilities pre-installed in Ubuntu and a tool for terminating misbehaving X clients or unresponsive programs. You can easily add a shortcut key to launch xkill with the steps below.

  1. xkillGo to System > Preferences > Keyboard Shortcuts.
  2. Click the Add button to create a custom shortcut.
  3. Enter xkill to both the Name and Command boxes and click the Apply button.
  4. Click on Disabled at the xkill row in the Keyboard Shortcuts window (Disabled is then changed to New shortcut…).
  5. Press a new key combination, e.g. Ctrl+Alt+X (New shortcut… is then changed to Ctrl+Alt+X).
  6. Click the Close button.

Xkill is ready for use. Press the above key combination to turn the cursor to an X-sign, move the X-sign and drop it into a program interface to terminate the unresponsive program, or cancel the X-sign with a right-click.

Re-start System without Rebooting

If you press Ctrl+Alt+Delete, Ubuntu brings you a menu to shut down, restart, or suspend your system. But for some reason you might encounter that the system freezes, the mouse cursor can’t move, neither pressing Ctrl+Alt+Delete can work.

Remember that there’s a shortcut key Alt+PrintScreen+K that can bring you back to the log-in screen immediately without the need to reboot the system. That’s a time saver.

As an alternative, you can also use Ctrl+Alt+Backspace to do the same after you’ve enabled the shortcut key by the following steps:

  1. Go to System > Preferences > Keyboard.
  2. Select the “Layouts” tab and click the “Options” button.
  3. Select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.
Set a Default View in File Manager

Windows Explorer allows for users to set a default view to all folders. In almost the same way, Ubuntu’s Nautilus File Browser allows for these settings:

  1. Set File BrowserGo to “Places” and open a folder.
  2. At the top of the File Browser, click “Edit” and “Preference”.
  3. Under Default View, change “Icon View” to “List View”, to see more details in columns.
  4. Tick “Show hidden and backup files” if that’s your choice.

Other various settings, such as single or double click to open items, icon captions, list columns, preview files and media handling can be done in the same window as well.

Create an Advanced File Manager

In the Ubuntu file system, you can use Nautilus file manager to browse most files but can only write files in your home folder /home/your_name and its sub-folders such as Desktop and Documents. If you have to rename a folder or write files outside of your home folder using the file manager, you won’t be able to but you can create an advanced file manager for this purpose.

  1. Advanced File ManagerGo to System > Preferences > Main Menu
  2. Select “Accessories” in the left panel and click “New Item” in the right panel.
  3. Enter a name such as Advanced Nautilus in the “Name” box.
  4. Enter gksu nautilus in the “Command” box.
  5. Click the “OK” button and the “Close” button.

Now you can go to Applications (or Main Menu) > Accessories and see that the Advanced Nautilus is ready for use. But be careful since you can use it to delete or change any files on your system.

Set Sound Output

When I first installed Ubuntu onto a PC with an integrated audio device and tried to play a media file on a player, it had no sound. I tried these simple steps in setting Sound Preferences and then it had sound. It works for me for the audio device I have.

  1. Go to System > Preferences > Sound to bring up the Sound Preferences window.
  2. Under the Hardware tab, change Profile to Analog Stereo Duplex from the drop-down menu.
  3. Under the Output tab, change Connector to Analog Output (LFE)/Amplifier from the drop-down menu.

As the items available from the drop-down menus might differ depending on the hardware devices detected by the system, you might want to try other items in the menus to see if they work for your devices. It might also help to check out the steps in Sound Troubleshooting from the Ubuntu Documentation.

Playing a media file in a proprietary format on a player might also have no sound if the required codecs are not installed. In this case, see Enable Media Playback in this article.

Disable or Change Login Sound

Each time when you login to Ubuntu, it plays a login sound. If you don’t like to listen to it each time you login, you can easily disable it, or you can even change it to your favorite sound.

To disable the login sound:

  1. Go to System > Preferences > Startup Applications.
  2. Under the “Startup Programs” tab, untick “GNOME Login Sound”
  3. Click Close

To change the login sound, tick the above “GNOME Login Sound” if it’s unticked, then follow these steps:

  1. Press Alt+F2 to bring up “Run Application” window.
  2. Paste gksu nautilus /usr/share/sounds/ubuntu/stereo into the box, click “Run” to open Nautilus in the right folder.
  3. Rename the original file desktop-login.ogg to another such as desktop-login-original.ogg for backup
  4. Copy your sound file in ogg format to the above folder and name the file as desktop-login.ogg
  5. Log out and log back in to listen to the new login sound.
Install Extra Fonts

Do you prefer Windows TrueType fonts to the default fonts installed by Ubuntu? The mscorefonts package containing most Microsoft fonts can be installed and configured easily in a few steps below:

  1. Ubuntu Extra FontsGo to Applications (or Main Menu) > Accessories > Terminal.
  2. Paste sudo apt-get install ttf-mscorefonts-installer into the Terminal (by pressing Ctrl-Shift-V in the Terminal after copying the highlighted code).
  3. Go to System > Preferences > Appearance > Fonts.
  4. Click each of them, pick a font and size to configure for window title and so on.

   How about installing more TrueType fonts? With your font files, you can manually add them into the system following the steps below:

  1. Press Alt+F2 to bring up “Run Application” window.
  2. Paste gksu nautilus /usr/share/fonts/truetype into the box, click “Run” to open Nautilus in the right folder.
  3. Create a new sub-folder and copy your files ending with .ttf into the sub-folder.
  4. Enter sudo fc-cache -f -v in the Terminal to rebuild the font information.

   Besides this, you can run an application such as Font-Manager to view, install, remove fonts and so on.

   If you like the Tahoma font which is not included in the mscorefonts package, you might want to copy the two files tahoma.ttf and tahomabd.ttf from /Windows/Fonts and install them.

Enable Media Playback

Ubuntu only includes completely free software by default and does not configure proprietary media formats such as mp3 and mp4 ‘out of the box’. The required codecs however can be easily installed for the default player to playback these files following a few simple steps below.

  1. Double click an mp3 file in a folder.
  2. Click “Search” button when the the default player shows up with a “Search for suitable plugin?” window.
  3. Click the “Install” and “Confirm” buttons to download and install the restricted software.
  4. Restart the player after the package files are installed.

You might need to do the same for other restricted media formats such as mp4 too.

Install Screenlets

Screenlets are small applications to represent things such as sticky notes, clocks, calendars around on your desktop. You can launch a pre-installed screenlet from Screenlet Manager, or install a new one into the Manager for launching it. Here are the steps for installing and launching a screenlet, for example, WaterMark System Information.

  1. WaterMark ScreenletInstall Screenlets Managerif it has not been added.
    1. Go to Applications (or Main Menu) > Ubuntu Software Center.
    2. Enter screenlets in the Search Box.
    3. Select Screenlets, click the “Install” button.
  2. Download the screenlet “WaterMark System Information” to a folder.
  3. Go to Applications (or Main Menu) > Accessories > Screenlets.
  4. Click Install, select Install Screenlet and click OK.
  5. Browse to the folder, select the file downloaded and click “Open” to install the screenlet into the Screenlets Manager.
  6. Select the screenlet “WaterMark” and click “Launch/Add”. (Tips: you can add more than one WaterMark screenlet and set it to display other system information.)

More screenlets are available for installation from

Install Sun Java Packages

Ubuntu may use OpenJDK by default, but I note that some web services such as might need the Sun Java Runtime Environment (JRE) to be installed in the system for running the services properly. If you would like to get the proprietary Sun Java packages for your system, you can download and install them from the Canonical Partner Repository with the steps below:

  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo add-apt-repository “deb lucid partner” to add the partner repository.
  3. Enter sudo apt-get update to update the source list.
  4. Enter sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts to download and install the Sun Java packages. (If asked to accept the Distributor License for Java (DLJ) terms, use the left/right key to navigate and select Yes, then press the Enter key for installation).
  5. Enter sudo java -version to check the version of the Java used in the system.
  6. Enter sudo update-alternatives –config java to choose the default Java for use in the system when necessary.
Add More Useful Software

Ubuntu Software Center lets you search and get free software. If an application you need is not included in the Center, you can go to System > Administration > Synaptic Package Manager, type in an application name to search and install a software package from the repositories.

Alternatively, you can get the latest freeware applications by clicking the Install this now button from the GetDeb Repository after the getdeb package is installed with the instructions given.

See also our Best Free Software for Linux.

Auto Mount Drives at System Startup

Ubuntu is capable of reading and writing files stored on Windows formatted partitions, but partitions must be ‘mounted’ before they can be accessed each time you start up the system. With these steps, you can auto mount the drives or partitions without the need to manually mount them for access.

  1. Storage Device ManagerInstall Storage Device Managerif it has not been added.
    1. Go to Applications (or Main Menu) > Ubuntu Software Center.
    2. Enter pysdm in the Search Box.
    3. Select Storage Device Manager, click the “Install” button.
  2. Go to System > Administration > Storage Device Manager.
  3. Extend the list of sda and select the sda you want to auto mount, click ‘OK’ to configure.
  4. Click the “Assistant” button.
  5. Uncheck “Mount file system in read only mode” and keep “The file system is mounted at boot time” checked.
  6. Click the “Mount”, “Apply” then “Close” button, and restart the system.

In case you wish to remove the auto-mount of a certain drive or partition, you can similarly use Storage Device Manager to do the setting.

   If you need to identify disk partitions by label, paste ls /dev/disk/by-label -g in Terminal, or to view partition sizes and file systems, enter sudo fdisk -l. Disk Utility mentioned in “Name or Label a Partition” also gives you a glance of device numbers, partition types, sizes and labels.

Manually Mount a USB Drive

A USB storage device plugged into the system usually mounts automatically, but if for some reasons it doesn’t automount, it’s possible to manually mount it with these steps.

  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo mkdir /media/usb to create a mount point called usb.
  3. Enter sudo fdisk -l to look for the USB drive already plugged in, let’s say the drive you want to mount is /dev/sdb1.
  4. Enter sudo mount -t vfat /dev/sdb1 /media/usb -o uid=1000,gid=100,utf8,dmask=027,fmask=137 to mount a USB drive formatted with FAT16 or FAT32 system. OR:
    Enter sudo mount -t ntfs-3g /dev/sdb1 /media/usb to mount a USB drive formatted with NTFS system.

To unmount it, just enter sudo umount /media/usb in the Terminal.

Name or Label a Partition

Nautilus file manager shows the root directory as File System for your Ubuntu system partition. If you have other partitions (or volumes), it shows them as xx GB Filesystem if they’re not named or labelled.

Using Disk Utility is one of the effective ways to name a partition easily:

  1. Disk UtilityGo to System > Administration > Disk Utility
  2. Select the item Hard Disk.
  3. In the Volumes section, click a partition you want to label.
  4. Click “Edit Filesystem Label” (See  below)
  5. In the Label box, enter a name, e.g. Data-Disk, and click Apply.

The file manager should now show the partition label, such as Data-Disk, instead of xx GB Filesystem.

   If the option for “Edit Filesystem Label” is not shown, click “Unmount Volume” before hand. In case you can’t unmount a volume, try Storage Device Manager to unmount it. See Auto Mount Drives at System Startup.

   This tip is for naming a partition using Disk Utility, use other advanced features such as format, edit or delete partition with caution as they can delete data on your disk.

Auto Start Up an Application

In Windows, you can place a program shortcut in a startup folder for running a program automatically when the system starts. In Ubuntu, you can do the same in this way:

  1. Auto Start Up ApplicationsGo To System > Preferences > Startup Applications
  2. Click the “Add” button.
  3. Name a program.
  4. Click the “Browse” button and navigate to File System > usr > bin, where programs are usually installed.
  5. Select a program, click the “Open” button followed by the “Add” button.

The above program will then be listed in additional startup programs. Check if the program runs automatically by logging out and back to the system.

Synchronize System Time and Date

Ubuntu allows you to manually set your system time and date, but you can also activate the Network Time Protocol (NTP) support in the system to automatically sync them with the Internet time servers as follows.

  1. Time and Date SettingsGo to System > Preferences > Time & Date.
  2. Click the lock icon to change settings.
  3. Select your time zone from the list.
  4. If the configuration type is “manual”, change it to auto synchronize with the Internet server. (In Ubuntu 11.04, the default is set to auto.)
  5. Click “Install NTP support” when prompted with a dialog box. (Applicable to Ubuntu 10.10 & 10.04)
  6. Tick the time server(s) nearer to you. (Applicable to Ubuntu 10.10 & 10.04)
  7. Click the Close button.

When you next boot up the system with the Internet connection, your system clock will then be synced with the Internet time servers.

Change Default Boot Options

After full installation, Ubuntu is set to be the default operating system to boot up if no key is pressed within a few seconds on a multi-boot system. You might want to set your preferred operating system to boot up by default. This can be done easily with StartUp-Manager.

  1. StartUp-ManagerGo to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo apt-get install startupmanager (OR copy the highlighted code and, in the Terminal, press Ctrl-Shift-V to paste it).
  3. Enter password used upon installation of Ubuntu.
  4. Go to System > Administration > StartUp-Manager
  5. Enter the same password to perform pre-configuration tasks, which include searching bootloaders to operating systems.
  6. Select the default operating system from the pull-down menu, click “Close” to perform post-configuration tasks.

With StartUp-Manager, you can also do others such as manage Usplash themes, adjust bootloader menu resolution or set timeout in seconds. Avoid changing timeout to 0 seconds if you need to select a system to boot up from a multi-boot menu.

Remove Old Linux Kernel, Clean Up Boot Menu

Each time when Ubuntu updates to a new Linux kernel, the old one is left behind and the boot menu gets longer. If your new Linux kernel works well, it’s safe to remove the old one and clean up the boot menu. Do take these steps carefully as incorrect removal of the items can make your system unbootable.

  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter uname -r to print the Linux kernel version you’re running (e.g. 2.6.32-22-generic).
  3. Go to System > Administration > Synaptic Package Manager.
  4. Click Status from the left panel and select Installed.
  5. Enter the main version number (e.g. 2.6.32) in the Search box.
  6. Right-click the items with smaller sub version number (e.g. 2.6.32-21) for older Linux kernel and select Mark for Complete Removal. The files for the older version to remove may include linux-headers-2.6.32-21, linux-headers-2.6.32-21-generic and linux-image-2.6.32-21-generic.
  7. Click Apply from the top panel.
  8. Click Apply again from the pop-up window to confirm removal of the marked packages. The boot menu will be cleaned up automatically after the removal is confirmed.

   Try also Grub Customizer which can be used to hide items from the boot menu. Just install the program by entering the following in the Terminal, then run the program, untick the items you want to hide and click ‘Save’.

  1. sudo add-apt-repository ppa:danielrichter2007/grub-customizer
  2. sudo apt-get update
  3. sudo apt-get install grub-customizer
Auto Shutdown the System

A simple command can be entered in the Terminal to schedule a time for the system to shut down.

  1. Go to Applications (or Main Menu) > Accessories > Terminal.
  2. Enter sudo shutdown -h +m (replace m with the number of minutes, e.g. +60).
    OR: enter sudo shutdown -h hh:mm (replace hh:mm with the time on the 24hr clock, e.g. 23:15).
  3. Enter password and minimize the Terminal window.

The system will then shut down within the minutes or at the time specified. To cancel a scheduled time, enter sudo shutdown -c in the Terminal.

   Alternatively, you might want to download and install GShutdown, which is a GUI program for scheduling a time to shutdown the system.

CompizConfig Settings Manager (ccsm), if not added yet, can be installed this way:

  1. Click “Applications” (or “Main Menu”), select “Ubuntu Software Center”.
  2. Type ccsm into the Search box.
  3. Select “Advanced Desktop Effects Settings (ccsm)” and click the “Install” button.
  4. Enter the password used upon installation of Ubuntu.

How to stop windows making automatic diskcheck on start up

There are some people suggested to edit the registry but the proper way to disable CHKDSK from starting up is using the /x switch on chkntfs command in command prompt. The /x switch will exclude a drive from the default boot-time check. If you have drive C: as your hard drive, then the command to disable chkdsk from scanning C: drive would be:

chkntfs /x c:

If you have 2 drive, C and D, you can disable chkdsk with the command below

chkntfs /x c: d:

then go ahead and reboot.

BootMgr missing error while booting from ubuntu live usb

%d bloggers like this: