Pages

Wednesday, December 19, 2012

configure exchange global address book on thunderbird 17


steps:


  1.   on thunderbird, go to Tools->address book
  2. a new window pops-up. go to File->New->LDAP Directory
  3. a new small window pops up.
  4. name =
  5. hostname = check in outlook. Else, most probably if your mail server is ..com, your hostname for address book will be .com
  6. BASE DN = dc=y,dc=com
  7. port number = 3268 ( default port 389 did not work for me)
  8. bind DN = domain\username
  9. do not check "use secure...."
  10. click OK
  11. right click on the address book you have created, click properties, go to 'offline' tab
  12. click "Download Now"
  13. you should get a 'replication succeeded" message.
  14. To test, compose a mail. go to view->contacts sidebar
  15. type some half name in search bar that it shows. suggestions should pop up. Now its working for you!.
  16. If you would thunderbird to auto-search names form global address book while you type name in "To" list, go to edit->preferences->composition->addressing, check "Directory server" option and chose the global address book that you just created from the drop down menu. click OK.
  17. now open a new mail window, start typing some name, observe suggestions that thunderbird shows up!!! Works wonderfully! 


Thursday, December 13, 2012

Monday, December 10, 2012

linux: execute particular history command

suppose you want to execute a particular command out of N history commands:

$history

...
...
...

1992  pwd
 1993  clear
 1994  cd foo
 1995  ls
 1996  ./a.out
 1997  ls -als <<== if you want to execute this command, run "!1997 " on terminal
 1998  ssh bar
 1999  ping bar
  2000  history
$!1997


Tuesday, November 20, 2012

sed search lines and comment out or uncomment



comment out..


             sed '/pattern/s/^/#/' 

uncomment out...
             sed '/pattern/s/^/# *//'

Wednesday, November 7, 2012

Friday, November 2, 2012

Saturday, October 6, 2012

Hello world!

Welcome to WordPress.com! This is your very first post. Click the Edit link to modify or delete it, or start a new post. If you like, use this post to tell readers why you started this blog and what you plan to do with it.

Happy blogging!

Monday, September 3, 2012

ubuntu tip: show tty console instead of GUI login

press ctrl+alt+F1 once ubuntu booted showing login prompt to switch to tty console.

Ubuntu tip: show hidden files in folder window ubuntu

Ubuntu tip:
to show hidden files in the folder window graphically, press ctrl+h on the folder window

Wednesday, July 25, 2012

speed up your build process "make"

use "make -j"

where number of jobs are those that can run parellel to make it faster

Thursday, July 12, 2012

shell IF statements


shell script, IF evaluate conditions:



Expression
Description
-d file
True if file is a directory.
-e file
True if file exists.
-f file
True if file exists and is a regular file.
-L file
True if file is a symbolic link.
-r file
True if file is a file readable by you.
-w file
True if file is a file writable by you.
-x file
True if file is a file executable by you.
file1 -nt file2
True if file1 is newer than (according to modification time) file2
file1 -ot file2
True if file1 is older than file2
-z string
True if string is empty.
-n string
True if string is not empty.
string1 = string2
True if string1 equals string2.
string1 != string2
True if string1 does not equal string2.



Thursday, June 14, 2012

terminator; terminal for developers

terminator is an alternative for your putty on widows or gnome terminal on ubuntu/linux.

short tut on using it..


  • Ctrl-Shift-E: will split the view vertically.
  • Ctrl-Shift-O: will split the view horizontally.
  • Ctrl-Shift-P: will focus be active on the previous view.
  • Ctrl-Shift-N: will focus be active on the next view.
  • Ctrl-Shift-W: will close the view where the focus is on.
  • Ctrl-Shift-Q: will exit terminator.
  • F11: will make terminator go fullscreen.

Friday, June 1, 2012

linux utility: screen

'screen' is a linux utility that enables you to open multiple sessions without multiple ssh login to same remote server. for example, you have logged into a remote server, and you run a command in forground, and now you want to run another command simultaneously, you will have to open another remote session by logging in again. this can be avoided by using 'screen' that if you run on the remote terminal, it will launch another remote prompt within the same terminal.

install:
apt-get install screen // ubuntu

login to remote server:
ssh xyz@remoteServer

$screen


commands to switch between two prompts:

 Ctrl+a c     Create new window
Ctrl+a k    Kill the current window / session
Ctrl+a w    List all windows
Ctrl+a 0-9    Go to a window numbered 0 9, use Ctrl+a w to see number
Ctrl+a Ctrl+a    Toggle / switch between the current and previous window
Ctrl+a S    Split terminal horizontally into regions and press Ctrl+a c to create new window there
Ctrl+a :resize    Resize region
Ctrl+a :fit    Fit screen size to new terminal size. You can also hit Ctrl+a F for the the same task
Ctrl+a :remove    Remove / delete region. You can also hit Ctrl+a X for the same taks
Ctrl+a tab    Move to next region
Ctrl+a D (Shift-d)    Power detach and logout
Ctrl+a d    Detach but keep shell window open
Ctrl-a Ctrl-\    Quit screen
Ctrl-a ?    Display help screen i.e. display a list of commands

Sunday, May 13, 2012

hibernate ubuntu 12.04

by default hibernate option is disabled on ubuntu 12.04. to hibernate, open terminal, and execute pm-hibernate  command.

Thursday, April 26, 2012

ubuntu 11.10 after install...

configuring desktop environment after installing ubuntu 11.10

1. add facebook(use facebook id as username, for eg www.facebook.com/your_id) and google account to empathy. add empathy to startup applications
2. install skype. add skype to startup applications
3. install remmina remote desktop client - nice app to connect to multiple remote clients
4.install virtualbox, create windows virtual os.. you will have the luxury of windows as well linux.
5. install compizConfig settings manager - to make your desktop 3d
6.install gparted nice app to manipulate your file system
7. install samba, this enables you to share files between your ubuntu and virtual windows.
8. install vnc player.. one player for all purpose
9. install cairo dock.. with compiz 3d, this improves the aesthetic of your desktop to a great extent
10. install Unetbootin - easy app to create bootable disk or usb

Tuesday, April 24, 2012

using thunderbird on ubuntu as alterntive to outlook web access

new ubuntu comes with thunderbird email client by default.

1. to configure your thunderbird to access owa, select pop3 and security as "NONE"
1.if you are accustomed to using outlook and difficult to switch to thunderbird gui, you can install thunderbird add on "office black" that enables your thunderbird to have an outlook like gui.

2. install thunderbrowse to  browse internet from the thunderbird itself.

3. better than "office black", there is theme called silvermel... it most popular also.

4. to let your replies on top of the mail chain by default, go to edit->account settngs->composition and addressing->composition->reply above quote

Saturday, April 14, 2012

virtualbox share folders ubuntu 11.10 host windows 7 guest

I am running windows 7 as virtual machine on my ubuntu laptop using virtualbox software. I wanted to share my ubuntu folders with virtual windows 7.

steps to do it:

1. install samba on your ubuntu.
2. right click on the folder to share from ubuntu.
3. click on "sharing options"
4.check all boxes on new pop up window.
5. open virtual windows 7 in non-full-screen mode.
6. on the left top corner you will find "devices" drop down menu
7. under this menu click "shared folders"
8. on right side of the new window, click add folder option(+ symbol)
9. choose the folder you want to share from ubuntu.
10. restart your virtual windows 7.
11. when restarted, you should be able to see the shared folder in your windows 7 "computer" folder.

NOTE: one must prerequisite for above to work is you should have installed guest additions on your virtual machine.

Thursday, April 12, 2012

linux taskset command error "No such file or directory"

command: taskset -c 3,3 -p
output: taskset: executing -p failed: No such file or directory

solution:
taskset -c -p 3,3  6539

Tuesday, April 10, 2012

ubuntu 11.10 compiz 3d transparent cube with cairo dock (mac theme)





this is how my laptop desktop looks with Ubuntu 11.10 OS.

what made it look like above:
install compiz
install cairo dock
select mac theme for cairo dock
select cube with 4 workspace on compiz as desktop
i have chosen transparent cube.
choose whichever image(see sky in the background) you want as skydrome under cube option in compiz



Tuesday, April 3, 2012

ubuntu button keys

Button 1: The 'Left-Click' mouse button
Button 2: The 'Middle-Click' mouse button, or pressing down on the scroll wheel
Button 3: The 'Right-Click' mouse button
Button 4: Scrolling up one increment on the mouse wheel
Button 5: Scrolling down one increment on the mouse wheel
Button 6: Usually the 'back' button or scrolling one increment left on your mouse wheel
Button 7: Usually the 'forward' button or scrolling one increment right on your mouse wheel
Buttons 6-9 can differ depending on the type of mouse you have. Some mice may not even have these buttons at all!

Saturday, March 31, 2012

sed: delete all lines before or after string match

delete all lines before string match including matching line


sed -i '1,//d' $FILENAME

delete all lines after string match including matching line

sed  -i  '//,$d' $FILENAME

-i option to put changes back into source file

Friday, March 30, 2012

error while loading shared libraries linux ldd

when you run a binary and get this kind of error, try this command:

ldd

this will show out put as

 bin]# ldd /usr/bin/curl
    linux-gate.so.1 =>  not found
    libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00dd0000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00be6000)
    libssh2.so.1 => /usr/lib/libssh2.so.1 (0x00110000)
    libc.so.6 => /lib/libc.so.6 (0x00a41000)
    librt.so.1 => /lib/librt.so.1 (0x00415000)

try to build again by linking the missing library file.

Thursday, March 29, 2012

increment variable in shell script

var=$((var+1))

shell script redirect

There are 3 file descriptors, stdin, stdout and stderr (std=standard).

Basically you can:
  1. redirect stdout to a file
  2. redirect stderr to a file
  3. redirect stdout to a stderr
  4. redirect stderr to a stdout
  5. redirect stderr and stdout to a file
  6. redirect stderr and stdout to stdout
  7. redirect stderr and stdout to stderr
1 'represents' stdout and 2 stderr. A little note for seeing this things: with the less command you can view both stdout (which will remain on the buffer) and the stderr that will be printed on the screen, but erased as you try to 'browse' the buffer.

 Sample: stdout 2 file

This will cause the ouput of a program to be written to a file.
        ls -l > ls-l.txt

Here, a file called 'ls-l.txt' will be created and it will contain what you would see on the screen if you type the command 'ls -l' and execute it.

Sample: stderr 2 file

This will cause the stderr ouput of a program to be written to a file.
        grep da * 2> grep-errors.txt

Here, a file called 'grep-errors.txt' will be created and it will contain what you would see the stderr portion of the output of the 'grep da *' command.

Sample: stdout 2 stderr

This will cause the stderr ouput of a program to be written to the same filedescriptor than stdout.
        grep da * 1>&2 

Here, the stdout portion of the command is sent to stderr, you may notice that in differen ways.

Sample: stderr 2 stdout

This will cause the stderr ouput of a program to be written to the same filedescriptor than stdout.
        grep * 2>&1

Here, the stderr portion of the command is sent to stdout, if you pipe to less, you'll see that lines that normally 'dissapear' (as they are written to stderr) are being kept now (because they're on stdout).

Sample: stderr and stdout 2 file

This will place every output of a program to a file. This is suitable sometimes for cron entries, if you want a command to pass in absolute silence.
        rm -f $(find / -name core) &> /dev/null 

This (thinking on the cron entry) will delete every file called 'core' in any directory. Notice that you should be pretty sure of what a command is doing if you are going to wipe it's output.

set timeout in shell script

http://xpt.sourceforge.net/techdocs/nix/sch/sch07-Timeout/single/

shell script: to execute a string in variable as shell command

temp="ip=1.1.1.$p"
i wanted to extract ip address into a variable

solution:

eval ${temp}
myVar=$ip

Wednesday, March 28, 2012

ubuntu upgrade: restore applications collections

you can save a list of installed packages on the old machine with the command dpkg --get-selections > ~/packages and then restore it on the new one with sudo dpkg --set-selections < ~/packages && apt-get dselect-upgrade.

cat /proc/stat, cpu usage statistics

$ cat /proc/stat
cpu  24520180 352244 4425876 7951926999 3224192 100881 459528 0
cpu0 119971 3303 115696 498811501 11968 1 727 0
cpu1 156720 3887 74144 498757056 66536 2695 2103 0
cpu2 263824 60442 191283 498342148 157819 40037 7597 0
cpu3 220047 5331 54459 498698411 82321 1038 1524 0


 intr 1353911813 696186424 3 0 4 4 0 0 0 1 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ctxt 1255715782
btime 1327970777
processes 15808890
procs_running 2
procs_blocked 0

==>

first row columns values are sum of corresponding values in rest of the columns for all cpu cores.

in subsequent rows, first column has core id. rest columns hold,
  • user: normal processes executing in user mode
  • nice: niced processes executing in user mode
  • system: processes executing in kernel mode
  • idle: twiddling thumbs
  • iowait: waiting for I/O to complete
  • irq: servicing interrupts
  • softirq: servicing softirqs

The "intr" line gives counts of interrupts serviced since boot time, for each
of the possible system interrupts. The first column is the total of all interrupts serviced; each subsequent column is the total for that particular interrupt.


The "ctxt" line gives the total number of context switches across all CPUs.



The "btime" line gives the time at which the system booted, in seconds since
the Unix epoch.



The "processes" line gives the number of processes and threads created, which includes (but is not limited to) those created by calls to the fork() and clone() system calls.




The "procs_running" line gives the number of processes currently running on CPUs.



The "procs_blocked" line gives the number of processes currently blocked, waiting for I/O to complete.
copied from the kernel documentation of the /proc filesystem


Note:
The 8th column is called steal_time. It counts the ticks spent
executing other virtual hosts (in virtualised environments like Xen)
Note2:
With Linux 2.6.24 there is 9th column for (virtual) guest systems. See man 5 proc.


vimdiff commands

do - Get changes from other window into the current window.

dp – Put the changes from current window into the other window.

]c – Jump to the next change.

[c - Jump to the previous change.

Ctrl W + Ctrl W – Switch to the other split window.

Monday, March 26, 2012

virtualbox on Ubuntu 11.10 - guest windows 7 resolution problem - copying text to clipboard

1. When i installed win 7 as guest in virtualbox on my ubuntu 11.10, i was not able to set proper resolution, either it was too small or it was too large, that was not fitting the whole screen properly.

2. i was not able to copy text from virtual machine to clipboard

solution: install guest additions

how to : launch your virtual windows 7. on top menu, under devices, click "install guest additions"

this will first try to find VbGuestAddtions iso under your linux file systems. if it fails, it tries to fetch from web. if that also fails it will throw error that it is not able to find the iso file.

solution: do "sudo apt-get install virtualbox-guest-additions-iso" this will install manually.
then go to virtual win 7. and click install guest additions.

restart your vm. Now you should be able to toggle between full screen and minimized screen properly.

Also now you should be able to copy text between your VM and host machine properly.

Wednesday, March 21, 2012

cisco AnyConnect "wrong ELF class: ELFCLASS64" error

scenario: install cisco anyConnect to setup vpn connection on your laptop to connect to secured lan

problem: installation error: wrong ELF class: ELFCLASS64 when ./vpn_install.sh is run

cause: 32 bit library dependency

solution:
1. download getlibs-all.deb from net.
2.sudo dpkg -i getlibs-all.deb
3.getlibs libfuse.so.2
4.sudo ./vpn_install.sh

that should fix your problem.