bagus

hidup itu fana, mati itu abadi

Archive for the ‘linux’ Category

Easter Egg: OpenOffice.Org Calc

with one comment

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 …

 

The answer to Life, the Universe, and Everything

Written by bagus

March 20, 2008 at 2:42 pm

Posted in linux

Tagged with ,

Automatic login for SSH

with 2 comments

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 :)

Written by bagus

March 1, 2008 at 3:00 pm

Posted in brainware, linux, scripting

Tagged with , , , ,

Firefox jump to other workspace in XFCE

with 8 comments

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 :)

Written by bagus

January 28, 2008 at 1:26 pm

Posted in linux

Tagged with , , ,