Tuesday, February 26, 2008

windows vista Snipping Tool

start
snip

windows run auto application once and just once

HKEY_LOCAL_MACHINE/ SOFTWARE/ Microsoft/ Windows/CurrentVersion/ RunOnce
new: String Value
name:
data value : application address

google search trick

search music files:
intitle:index. of? format name
e: intitle:index. of? Mp3 jojo

search flight
flight from ... to ...

Thursday, February 14, 2008

java change keyboard layout

Visit the following article http://java.sun.com/products/jfc/tsc/articles/InputMethod/inputmethod.html
and read it carefully.

if you download and copy following jar file to /lib/ext you will have a menu item called "select input method" added to all swing applications.
http://java.sun.com/products/jfc/tsc/articles/InputMethod/InputMethodHotKey.jar

You can find full specification and api document here
http://java.sun.com/javase/6/docs/technotes/guides/imf/index.html

Finally the direct answer is here:
Any swing component which extends from java.awt.Window has a method called getInputContext(). You can change the input method like this, it will automatically change the keyboard layout when you focus the component.
for example"
yourMainJFrame.getInputContext().selectInputMethod(new Locale("fa", "IR"));

Sunday, December 16, 2007

linux common command

tcpdump -i eth1 -XX src host ip
ssh -L :localport:destinationIP:destinationPort username -pSSHPort -NnTv
sudo mount /dev/sdb1 /media/usbdisk/


iptables -t nat -D PREROUTING -s 192.168.0.140 -p tcp -m tcp --dport 3335 -j DNAT --to-destination 10.100.100.111:3068
ptables -t nat -A PREROUTING -s 192.168.0.140 -p tcp -m tcp --dport 3335 -j DNAT --to-destination 10.100.100.111:3068
sudo route add -net 10.100.0.0 mask 255.255.0.0 gw 192.168.0.24

du -h /home/engine/tomcat/ --max-depth=1
vim /etc/cron.daily/backup

sudo vim /etc/rc.local
netstat -a -n

sudo iptables-restore < /etc/iptables

tar -zxvf test.gz
tar -ztvf maskan.gz
tar -zcvf test test.gz

cut -d ' ' -f 6-6


install bin
chmod +x jre-1_5_0_14-linux-i586.rpm.bin
./jre-1_5_0_14-linux-i586.rpm.bin

sudo usermod -g admin peyman


sudo apt-get install -f
dpkg -i ymessenger.deb

install rpm
sudo rpm -Uvh jre-1_5_0_14-linux-i586.rpm

Wednesday, December 12, 2007

kannel url commands(kentBeck)

stopping smsc box: http://127.0.0.1:13000/cgi-bin/stop-smsc?password=&smsc=
starting smsc box: http://127.0.0.1:13000/cgi-bin/start-smsc?password=&smsc=
status: http://127.0.0.1:13000/cgi-bin/status?password=