LAMP How To – Open Source At Work

Only Passion Matters

Entries for August, 2009

extending vmware harddisk

1. shutdown vmware either from browser or console.
2. checkout the vmware-vdiskmanager command. The example there tells everything.

bash expect: script to handle command line prompts

expect is very useful to automate login process. I thought it is helpful when doing testing as well. A simple login script might work like this:

#!/usr/bin/env expect
eval spawn “/path/program”
expect “^Enter Auth Username:”
send “user\n”
expect “Enter Auth Password:”
send “password\n”

To install expect, “yum install expect”

bash: testing conditions using if-grep

this expr can be really useful to determine if a term has been found or not using grep. short and sweet enough for me.
if [ ! -z $(echo $var | grep "cond") ]; then echo “found”; else echo ” not found”; fi

mounting samba share and finding samba ip in linux

following the samba/nfs post – http://www.azhowto.com/2009/08/07/mounting-file-systems-and-autofs-tips/ earlier, what if we do not know the ip address of the samba server?
if you just have the samba server name say ri-fnp, smbclient can find it easily for you, just do

smbclient //ri-fnp/backup -U user -W MYDOMAIN

If you want to mount it, you will need to know the ip [...]

VNC: no profile for user error

If you want to vnc into the server with gnome and get a vnc error like so

Mon Aug 24 09:54:02 2009
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5901
vncext: Listening for HTTP connections on port [...]