Archive for the ‘linux’ Category
Easter Egg: OpenOffice.Org Calc
Iseng2 nyari tips buat OpenOffice eh malah nemu easter egg-nya.
Ketik =starcalcteam() di cell yang mana saja lalu enter, akan muncul image berikut …
Sekarang coba hapus isi cell tersebut, lalu ketik kembali =starcalcteam() dan hasilnya akan muncul angka …
Automatic login for SSH
When I’m out of office, I have to use VPN to connect to company internal network. But I don’t use VPN, instead I’m using SSH tunneling with socks proxy.
Problem is, I have to create a password with token software and input that password to my ssh process. Well I’m too lazy for this, so I create a script to automate the process with bash, awk and expect.
First I have to generate a password from token software (its a CLI one).
token=`echo "myPIN" | /path/to/token/software | awk blablabla`
You have to filter the output with awk so you get the password.
Ok, now I got a variable named $token which contain my token generated password, and looks like expect can’t get this variable. After googling around, I find out that I can use the variable if its exported to environment. So the next step is to export it to environment.
export $token
The last one is to automate ssh login.
expect -c 'spawn ssh -C -D 1080 ssh.server.com; expect assword; send "$env(token)\n";interact'
No, there is no typo in the command. “assword” is use because sometime ssh server return “Password” and sometime “password”. I use “-C” to compress all traffic.
So here is the complete script, named it whatever you want.
#!/bin/bash
token=`echo "myPIN" | /path/to/token/software
export $token
expect -c 'spawn ssh -C -D 1080 ssh.server.com; expect assword; send "$env(token)\n";interact'
Just execute the script and your SSH tunnel is created
Firefox jump to other workspace in XFCE
I haven’t notice when this bug occurs. When I try to click a link in Pidgin (formerly known as Gaim), Firefox window jump to active workspace. Or when I run Firefox which I set to start in workspace 2 with devilspie, it will jump to active workspace too.
After searching the web, I found a solution here. There is a hidden option available in XFCE 4.4.1 called ActivateAction. Following the solution there, I managed to keep Firefox in its workspace. Here is the solution:
Edit ~/.config/xfce4/mcs_settings/wmtweaks.xml
<option name="Xfwm/ActivateAction" type="string" value="none"/>
One more problem solved




