Showing posts with label How to. Show all posts
Showing posts with label How to. Show all posts

Thursday, October 15, 2009

How To Open VirtualBox Guest OS Directly

Opening guest OS in VirtualBox requires an extra click. You have to open VirtualBox OSE from Accessories and click start to run guest OS.

Instead of this you can create a launcher to directly open VirtualBox guest OS.
So just a single click and your guest OS will start running.

The backend for this is powerful VBoxManage CLI command. It can do lot more than the GUI can do. For example check how to hide menubar and statusbar in VirtualBox.

Now to open guest OS directly from panel do the following. I'll assume your guest OS name as "guestos1"

  1. Right click empty area in panel and choose Add to Panel
  2. Select Custom Application Launcher (its on top)
  3. Fill the dialog box it brings as:

    • Type: application
    • Name: guestos1
    • Command: VBoxManage startvm "guestos1"
    • Comment:  Start guest os names "guestos1"

  4. Click the icon and choose icon of your choise
  5. Click OK.


Now your launcher is ready to open guest os directly.

Tuesday, October 6, 2009

Beautiful Karmic Koala Desktop



OS: Ubuntu Karmic Koala Beta
Theme: Nightly Impression with Conky

Beautiful Horizontal Conky



In the desktop above you can see the horizontal conky at the bottom of the desktop. Following is the configuration file .conkyrc from which you can achieve this.


#avoid flicker
double_buffer yes


#own window to run simultanious 2 or more conkys
own_window  yes
own_window_transparent yes
own_window_type override
own_window_hints undecorate,sticky,skip_taskbar,skip_pager


#borders
draw_borders no
border_margin 1


#shades
draw_shades no


#position
gap_x 0
gap_y 1
alignment bottom_left


#behaviour
update_interval 5


#colour
#default_color  8f8f8f
default_color    e0e0e0
#default_shade_color 000000
own_window_colour 262729


#font
use_xft yes
xftfont sans:size=9


# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes


#to prevent window from moving
use_spacer none
minimum_size 1200 0


TEXT
${alignc}${color}Kernel:${color e0e0e0}$kernel${color 000000} | ${color}Uptime:${color e0e0e0}${uptime_short}${color 000000} | ${color}Cpu1:${color e0e0e0}${cpu cpu1}%${color 000000} | ${color}Cpu2:${color e0e0e0}${cpu cpu2}%${color 000000} | ${color}Ram:${color e0e0e0}${memperc}%${color}${color 000000} | ${color}Swap:${color e0e0e0}${swapperc}%${color}${color 000000} | ${color}Root:${color e0e0e0}${fs_used_perc /}%${color 000000} | ${color}Home:${color e0e0e0}${fs_used_perc /home}%${if_existing /proc/net/route wlan0}${color 000000} | ${color}Signal:${color e0e0e0}${wireless_link_qual wlan0}%${color 000000} | ${color}Up:${color e0e0e0}${upspeed wlan0}kb/s${color}/Down:${color e0e0e0}${downspeed wlan0}kb/s${color}${else}${if_existing /proc/net/route eth0}${color 000000} | ${color}eth0:${color e0e0e0}${downspeed eth0}/${upspeed eth0} kb/s${color}${endif}${else}Network Unavailable${endif}${color 000000} | ${color}DiskIO:${diskio}${alignc}


You can optimize this file by decent use of ${color} variable. I messed this up as I am lazy and quite busy.


If you are new to conky, I'll write a short instruction on how to achieve this.
  1. Install conky by clicking here or by opening terminal and typing sudo aptitude install conky or from add/remove program or from synaptic package manager.
  2. Create a file with name .conkyrc and copy the content from top and save it in your homefolder.
  3. Now press Alt+F2 and type conky
  4. You'll see the bar at the bottom of your screen.
  5. You can change the update_interval 5 to smaller number. Actually you can change everything to suit your needs. You can look for more .conkyrc  file or read conky manual by doing man conky.
  6. Put it in Syste/Preferences/Startup Application to make it start on every boot.

Sunday, September 13, 2009

Google Chrome Update Keeps Appearing Even After Removing From Application Sources

I use Google Chrome -unstable as my primary browser and am very happy with it. But one problem I keep facing is it asks me to update the daily build each day. Removing it from /etc/apt/sources.list.d/google-chrome.list doesn't help.
So if you also don't want to install the daily build each and every day follow the following steps:


  1. Remove the google-chrome apt list from /etc/apt/sources.list
  2. Remove the google-chrome.list file from /etc/apt/sources.list.d/google-chrome.list
  3. Remove the file /etc/default/google-chrome
This should prevent Google Chrome daily updates.


P.S. If by change you landed here and don't have Google chrome and want to install it get the daily build from here or the deb package from here(32 bit) or here(64 bit).

Tuesday, September 1, 2009

Use localepurge to remove unnecessary locales

Ubuntu, Debian and and many Linux Distros comes bundled with many locales. Locale beside yours is hardly useful for you. Most people use one or two locale or locales that represent them. For example people from America will most probably use only en_us locale while people from India might use both Indian and American locale.


There isn't any problem having many locale lying in your system. But if you have computer with minimum hard disk space like Dell Mini 9 then it might be good idea for you to remove unnecessary locale and free space. Also you don't have to waste time compiling all the locale when you only need some of them. This saves time while updating and installing some application.


Now to remove the unnecessary locales, open terminal and type


sudo apt-get install localepurge

Sunday, July 26, 2009

scp with resume

scp is very handy tool to securely copy files from remote computer. One disadvantage with it is, it doesn't support resume. With little trick and little help from the command rsync we can securely copy files from remote computer with resume facility.

And the command is
rsync --partial --progress --rsh=ssh username@host:remote_file local_file

Saturday, July 25, 2009

Nudge in Pidgin

If you look at Pidgin, there is no option for Nudge. This is one of the feature that most people miss. But the fact is nudging in Pidgin is right there. To nudge the person you are talking to just type:
/nudge

Friday, July 24, 2009

Pidgin and Google Apps Email Account

If you are on Linux or prefer something light instead of gtalk you can easily use Gmail account with Pidgin.

Here is a nice tutorial with screenshots from Google itself, http://www.google.com/support/a/bin/answer.py?hl=en&answer=49147

However if you are using Google apps email account then you need do few extra things. (Google apps email account means any email account that you host with google)

For example you have a email address, myuser@mydomain.com
Basic Tab:
Username: myuser
Domain: mydomain
Resource: gmail.com/

Advanced Tab:
Connect server: talk.google.com

That's it folks.

Wednesday, July 22, 2009

Pulseaudio Perfect Setup

Pulseaudio came in Ubuntu from the LTS Hardy Heron 8.04. Till date with Ubuntu 9.04 and 9.10 very near in the future, people are still confuse and facing problems with it.

If you are also in some kind of problem or confusion with this, here is a nice wiki on perfect setup of pulse audio.

http://www.pulseaudio.org/wiki/PerfectSetup

Friday, July 10, 2009

Friday, June 26, 2009

Bash Quick-Reference, Great Shortcuts

C-n means control-n
M-x means escape-x (few keyboards have a 'meta' key)

Finding a line in history:
C—p Move to previous line in history
C-n Mcve to next line in history
C-r Reverse search

Moving in the current line:
C-a Move to start of the current line
C-e Move to end of the current line
C-f Move forward (right) one character
C-b Move backward (left) one character
M-f Move forward one word
M-b Move back one word

Editing the current line:
del Delete the character under the cursor
bs Delete the character to the left of the cursor
C—k Kill the characters to the right of the cursor
C-u Kill the characters to the left of the cursor
M—d Delete the word to the right of the cursor
M—bs Delete the word to the left of the cursor
M-u Convert the next word to upper case
M-l Convert the next word to lower case
M—c Capitalize the first character of the next word
C-vx Insert x literally, even if x is special

Kill ring and previous line:
C-y Yank (paste) the last deleted characters
M-y Immediately following Yank, remove yanked text and replace with previous deleted text
M-. Paste the last word of the previous line
C—o Execute the current line, then present the next line in the history

Redhat

Wednesday, June 24, 2009

Run GNU Screen Directly

Whenever I have to start screen, I have to start a terminal and run screen manually. Now to run the screen automatically without first opening a terminal you can use the following command
gnome-terminal -e screen
This opens screen in gnome-terminal directly.

Sunday, June 21, 2009

Simple And Powerful Command To Take Screenshots

I often take screen shots. So I need a simple applications that loads fast, is easy to take screen shots, is powerful and saves file directly to the location I want. And the best thing I found is the command import .

For example to take a screen shot I can simply press ALT+F2 and type
import -frame /tmp/my_screenshot.png

Gateway Brightness problem solved

I encountered a problem with Gateway laptop. The brightness level can't be changed neither from keyboard shortcut nor from gnome-power-manager.

If you encounter the same problem, open terminal and type
xrandr --output LVDS --set BACKLIGHT_CONTROL native
or
xrandr --output LVDS --set BACKLIGHT_CONTROL legacy
To make this fix permanent add the above line in your startup(From Menu, System, Preferences, Startup Applications).

Friday, May 29, 2009

Change Dim Display When Idle Time

Ubuntu automatically makes your display dim when you are idle for 30 seconds. Yes this saves battery life but for me 30 seconds is really annoying. And the good thing is this default value can be easily changed from gconf-editor.

  1. Press ALT+F2
  2. Enter gconf-editor
  3. In gconf-editor browse to apps > gnome-power-manager > backlight > idle_dim_time
  4. Hit enter
  5. Change the integer value in seconds.




That's it.

Sunday, May 10, 2009

Game Of The Day - Sauerbraten

Sauerbraten, its single/multi player, its fps and its free.





Install it by sudo aptitude install sauerbraten

http://www.sauerbraten.org/

Thursday, May 7, 2009

create /dev/null

Are you getting /dev/null: Permission denied error in terminal ?

Chances are you accidentally deleted /dev/null or something happened that you are unaware of.

But no worries you can make /dev/null again by following the mentioned steps and get rid of the problem.

  1. First go to terminal
  2. sudo rm /dev/null
  3. sudo mknod -m 0666 /dev/null c 1 3
And this should solve the problem.

Sunday, May 3, 2009

Linux Guru Tip No 1

Never use relative path while you use rm command. Always use absolute path.

There are many cases while people do sudo rm -rf ./ and accidentally run the command again from history after changing their working directory.

Absolute path ends as you delete the folder while relative path exists on basis of where your working directory is.

Monday, April 6, 2009

vi/vim quick reference

Movement Commands:

h move one character left
j move one line down
k move one line up
l move one character right
H move to Home (start of first line displayed
M move to start of Middle line displayed
L move to start of Last line displayed
O or ^ move to start of current line
$ move to end of current line
tc move forwards to just before character c
Tc move backwards to just after character c
fc move forwards on to character c
Fc move backwards on to character c
; repeat last t, T, f, or F command
w move forwards to the start of the next word
e move forwards to the end of the next word
b move backwards a word
% move to matching bracket: () [] {}

Movement Searching:

/ Search forwards for regular expression
? Search backwards for regular expression
n repeat last search in the same direction
N repeat last search in the reverse direction

Insert Mode

i Insert before the current character
a Insert after the current character
o Open a new line after the current line
O Open a new line before the current line
I Insert before the first non white character on the current line
A Insert after the last non white character on the current line

Deleting text:

x Delete the character under the cursor
dM Delete to where the movement M would take the cursor
dd Delete the current line
D Delete from the current position to the end of line

Changing text:

rc Replace the current character with c
s Substitute the current character: enter insert mode
cM Change to where the movement M would take the cursor and enter insert mode
cc Change the entire current line and enter insert mode
C Change from the current position to the end of last line
R Replace text, end with Escape

Yank buffers store text:

yM Copy text into yank buffer to where the movement M would take the cursor
yy Copy the current line into the yank buffer
Y Copy from the current position to the end of line into the yank buffer
p Paste the text into the yank buffer after the current line
P Paste the text into the yank buffer before the current line

Colon commands are based upon ed(l) commands. In many of these % will be substituted with the name of the current file, and # with the name of the previous file. Some commands may be prefixed with line number ranges. . means the current line, S means the last line in the file: 2,5 s/fred/joe/ changes the first fred to joe on lines 2,3,4,5; l,$ s/fred/joe/g changes every fred to joe in the buffer. % may be used as a number range and is short for l,$. Number ranges may also be: .+N (N lines after current line), $—N(N lines before end of bufer), fred/+n (N lines after next fred). Tf you only want one line, omit the comma and second number: .-4 s/fred/joe.

:q Quit
:q! Quit without the sanity checks (unsaved buffers, etc)
:w [f] Write the buffer to file f
:w !cmd Write the buffer as stdin to shell command cmd
:wq Write and quit
:x Like :wq but only write if changes have been made
:r file Read file into the current buffer after current line
:e f Edit file f
:e # Edit the previous file, often bound to C-
:n Edit next file
:p Edit previous file
:rew Rewind to first file
:! cmd Execute shell command cmd
:s7a/b/ Substitute a with b on the current line.
:s/a/b/g Substitute every a with b on the current line. (g means global)
:s/a/b/gc Substitute every a with b on the current line, ask for confirmation
:d Delete the current line

Display (screen) control:

C—e scroll line with cursor up a line
C—y scroll line with cursor down a line
C—d scroll display down l/2 a screen
C—u scroll display up l/2 a screen
C—f scroll display forward a screen
C—b scroll display backward a screen
C—l redisplay the screen

Misc:

J Join the next line to the current line
u undo the last change. Repeat for previous change.
C—r Redo a change undone by u .
U Undo all the changes made to the current line
. Repeat the last change command
~ Invert case (upper/lower) of the current character
!!cmd Replace the current line with the otput of shell command cmd
C—g Display current line number
G Move to the last line in the buffer
nG Move to line number n in the buffer
ml Mark the current line with the label
'l Go to the line with label l
''Go to the last line that you jumped from

Labels may be used in : commands:

's,'e:s/fred/joe/g changes all fred to joe for all lines between those labeled s and e
nC Repeats the command C n times
qr Start recording into register r. If r is upper case, append
q Stop recording
@r Execute keystrokes in register r
<<
Move text left by an indent
>> Move text right by an indent
C—z Suspend (shell job control)

Visual (block) mode

v Start character visual mode
V Start line visual mode
c·V Start block visual mode

Once a visual area is marked

b delete
c change
y yank
~ swap case (upper/lower>
u make lower case
U make upper case
! filter through external program
:dis Display the contents of all yank buffers

Split windows and multiple buffers:

C—ws Split the window in two
C—wc Close the current window
C-wM Move to window in direction M, e.g. k means up
NC—w+ Increase display size of current window by N lines
NC—w— Decrease display size of current window by N lines
:files Display files currently being edited and buffer numbers
:N b Switch to buffer N in the current window

Useful options (put in ~/.exrc):

set ic Ignore case in searches
set number Line number node
set showmode Display INSERT on bottom line in insert
mode

Handy sequences

xp swaps two adjacent characters
lOdd Deletes lO lines to the buffer
:.,$d Deletes from the current line to the end of the buffer
:. w ! od —c Filter the current line through od to see if it contains any strange characters
:. w ! sh Execute the current line as a shell command
Redhat

Saturday, March 21, 2009

Adobe Stand Alone Flash Player for Linux

Adobe stand alone flash player for Linux is available.

Most of us only need flash plugin for browser to view swf. But sometimes we or most of the times developer wishes for the availability of stand alone flash player for Linux.

Stand alone flash player means that you don't need anything to run swf other than the player itself. Yes, you don't need browser or any media player.


Get it from http://www.adobe.com/support/flashplayer/downloads.html
or download the version 10 directly from http://download.macromedia.com/pub/flashplayer/updaters/10/flash_player_10_linux_dev.tar.gz



Not only that you can create self running binaries from the stand alone player.