Wednesday, November 30, 2011

unlock desktop under openSUSE12

Not sure if this is just an openSUSE default gnome setting or a new gnome setting, but after you installed openSUSE12 with gnome desktop, the desktop is locked! cannot right click, cannot see any files/directories under your desktop, it is just weird.  To unlock it, run gnome-tweak-tool from terminal:


gnome-tweak-tool
Desktop -> Have file manager handle the desktop

Back to normal again :-)

Tuesday, November 29, 2011

Windows Server 2008R2 CTRL-ALT-DEL doesn't work for VNC


So MS decided to disable software emulation of CTRL-ALT-DEL in Windows Server 2008R2, guess it propose some more vulnerability to Windows.. it caused some grief when using VNC viewer..

1. run -> gpedit.msc

2. Computer Configuration > Administrative Templates > Windows components -> Windows Logon Options -> "Disable or enable software Secure Attention Sequence".

3. Change the following:
Enabled
Services and Ease of Access applications

Thursday, November 24, 2011

python web login script


this script assumes the login website first return a page with session ID, second page would present the login and password field associated with the session ID.


on redhat, make sure you have python installed and also install mechanize:
yum install python-mechanize.noarch


#!/usr/bin/python
import mechanize
from urllib2 import urlopen
from ClientForm import ParseResponse


res1 = mechanize.urlopen("http://login.domain.com/")
#print res1.read()
forms = ParseResponse(res1, backwards_compat=False)
form1 = forms[0]


print "sessionID "
print form1["sessionID"]


res2 = mechanize.urlopen(form1.click())
#print res2.read()
forms = ParseResponse(res2, backwards_compat=False)
form2 = forms[0]


print form2


form2["username"] = "myusername"
form2["password"] = "mypassword"
urlopen(form2.click())
print urlopen(form2.click()).read()

Thursday, November 17, 2011

java default sizes

to see the default stack, heap sizes in IBM JRE/JDK, run this command:
java -verbose:sizes -version

Tuesday, November 8, 2011

Ubuntu chkconfig equivalent

what's the command line service config tool in ubuntu for different runlevel?

apt-get install sysv-rc-conf