Thursday, December 30, 2010

Garuda dibaham Harimau Malaya! Tahniah!

Ni tulisan yang istimewa. Gua terlampau gembira sangat dengan kebolehan pemuda-pemuda tempatan (baca: bukan dari Uruguay ok..) Harimau Malaya kerana berjaya menjulang satu lagi anugerah bolasepak iaitu AFF Piala Suzuki malam semalam. Alhamdulillah berkat usaha seluruh pasukan, setelah merampas pingat emas Sea Games 2009, kita dapat pulak AFF Piala Suzuki. Walaupun bermula dengan kekalahan 5-1 pada awal pertandingan, kita tak perlu menggunakan alasan lazer mahupun pemain import untuk menjadi juara. 100% anak Malaysia sudah cukup untuk menjadi juara. Akhir kata, nombor 2 itu masih tetap KALAH! HAHAHAHA!

This is a special posting. I'm very happy with our local youth (read: not imported from Uruguay ok..), the Harimau Malaya team which is now the 2010 AFF Suzuki Cup's champions last night. Alhamdulillah with the team's dedication, we managed to get AFF Suzuki Cup after we won the Sea Games 2009. Although we started AFF Suzuki Cup with losing 5-1, we don't need the lazer's excuses or imported player to be the champion. 100% local Malaysian is enough to be champion. To wrap it up, being second is still LOSERS! HAHAHAHA!

p/s: Say what you want to say, we're the CHAMPION and we deserve it. And I deserve to brag about it!

Wednesday, December 22, 2010

OpenBSD NC4200: scrotwm + xstatbar & I think I found a bug.

xstatbar is a status bar which can be use in scrotwm to display cpu usage graph, memory usage, battery/AC status, Master Volume and date/time. Informations which is displayed is currently fixed and hacking the source code is the only way to customize the display. I downloaded and installed xstatbar. Then I edited ~/.xsession.

*unrelated bits ignored*
xstatbar -y 753 -w 1024 &
exec scrotwm
*unrelated bits ignored*


It's basically telling xstatbar to appear from pixel 753 with the width of 1024 pixel. My laptop's resolution is 1024x764 so it's the best pick. Displaying xstatbar will take the height of 15 pixel so do the math. Then I edited ~/.scrotwm.

*unrelated bits ignored*
# Region setting for xstatbar use.
region = screen[1]:1024x753+0+0

*unrelated bits ignored*


This one basically tells scrotwm to use only 1024x753 for the window manager and 15pixel is reserved for xstatbar's use. Then after I log in, xstatbar happily resides on the bottom area. Both scrotwm and xstatbar is still under development so there's more features will be added in the future.

A few days using scrotwm, I managed to get scrotwm to crash when using Mozille Thunderbird. It's quite random but replication is possible. In scrotwm, I opened Thunderbird in workspace 3 (my fav workspace for Thunderbird). The main Thunderbird program will be there but I always move email composing dialog in workspace 4. In workspace 3, I will click Write button and the compose dialog will be in workspace 4. Switching to workspace 4 and I will write the recipient's email address. Auto complete's dialog will be displayed and that's when scrotwm will crash, dumping core and returning me to xdm. But like I've stated, it's quite random with most of the time I'm being lucky. Maybe there's something else which made this happened but I'm very sure it has something to do with Thunderbird as I didn't see that when using other program. I've registered with FlySpray but I'm not sure whether to file a bug report yet. Later.

Tuesday, December 21, 2010

OpenBSD NC4200: Playing with scrotwm.

Yes I'm looking for another tiling window manager. Then I saw scrotwm. I installed the scrotwm package and edited my ~/.xsession. Take note that I'm using xdm with dialog to choose window manager to load.

managers=scrotwm,wmii,xfce4,fvwm
*ugly bits ignored*
case $manager in
scrotwm)
xscreensaver -no-splash &
nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
eval `cat ~/.fehbg`
exec scrotwm
;;
*ugly bits ignored*


Then scrotwm loads. My opinion, scrotwm is FAST!. Usually I can notice a bit of lag when switching between workspaces (Mod+Num) in wmii but in scrotwm, the speed is excellent. Not to mention that the configuration is very easy. So, I created my personal scrotwm config file ~/.scrotwm.conf:

# My scrotwm config
# Change modkey to Mod4 (Windows key)
modkey = Mod4

# Programs
program[lock] = xscreensaver-command -activate

# Key Bindings
bind[lock] = Control+Mod1+Delete
bind[swap_main] = MOD+Shift+Return
bind[spawn_term] = MOD+Return


Basically this is the essential stuff I'm used to do with wmii. In scrotwm, pressing Mod+Return will not open xterm but it will swap between open apps. So I changed that one. After I done editing the config file, pressing Mod(windows key)+Q will restart scrotwm and changes got applied. Very nice. The only thing I don't like about scrotwm is that the title bar have eye-bleeding-font but that's not something that cannot be changed. Also by default, there's no indicator on how many active workspace I have opened. In wmii, there will be numerical indicator on the active workspace. I've only been using scrotwm for less than 10 minutes so I know there's much more to discover. I have a feeling this will be my fav wm as speed is essential to me. Not forgetting that scrotwm was coded in OpenBSD by OpenBSD developers. Later.

Friday, December 17, 2010

OpenBSD NC4200: Another rough tweak for xdm with multiple window manager.

After reading Gentoo Wiki I found another way to get xdm to let you choose desired window manager. This is rougher than the previous tweak I posted. For this one, I need to edit 3 files.

Step 1: Edit /etc/X11/xdm/Xresources.
I edited the file with these values:

xlogin*login.translations: #override \
   *default bits ignored*
   <Key>F1: set-session-argument(failsafe) finish-field()\n\
   <Key>F2: set-session-argument(fvwm) finish-field()\n\
   <Key>F3: set-session-argument(xfce4) finish-field()\n\

   *default bits ignore*


The bolded parts are the values I inserted.


Step 2: Edit /etc/X11/xdm/Xsession.
I edited the file with these values:

case $# in
1)
   case $1 in
   *default bits ignored*
   fvwm)
      xscreensaver -no-splash &
      nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
      eval `cat ~/.fehbg`
      exec fvwm
      ;;
   xfce4)
      exec startxfce4
      ;;

   esac
esac


Like Step 1, bolded parts are the values I inserted. Basically these 2 steps will tell xdm to load fvwm if I press F2 after I type my username and password or load xfce4 if I press F3 after I type my username and password. Eh, what about my fav-o-win-manager wmii?. Ahh. For that one I need to go to Step 3.


Step 3: Edit ~/.xsession.
This one is the long one. Trust me if I know a shorter way I would put it here. For this I edit:

xscreensaver -no-splash &
nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
eval `cat ~/.fehbg`
exec wmii


Gotcha! Ho boy I love to do that. Well it's basically very short. So now if I press Return (Enter) key after I type my username & password, wmii will load. Personally, I prefer the previous tweak I posted earlier because I don't need to edit a few files. For previous tweak, I will know which window manager I will choose but for this tweak, I have to memorize which F* key will load which window manager.

Sure, SLiM looks prettier but xdm comes with X11 by default. Later.

OpenBSD NC4200: Back to xdm, using rough hack to change window manager.

Ah. Now I'm back to using xdm as my login manager. Using Wikibook's Guide to X11 as a guideline, I managed to write a rough hack to let me choose my desired window manager in xdm.

Step 1: Disable SLiM login manager.
I use /etc/rc.local to start SLiM as the login manager so I just comment the SLiM's related entries.


Step 2: Enabling xdm.
I edit /etc/rc.conf.local and put:

xdm_flags=""


Step 3: Tweak xdm for multi window manager.
This one is a rough hack. I opened ~/.xsession and edit it with this:

# Variables for choosing window manager.
managers=wmii,xfce4,fvwm
prompt="Welcome $USER, select window manager:"

# Selecting window manager.
manager="$(xmessage -buttons "$managers" -print -center -timeout 4 "$prompt")"

case $manager in
wmii)
   xscreensaver -no-splash &
   nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
   eval `cat ~/.fehbg`
   exec wmii
   ;;
xfce4)
   startxfce4
   ;;
fvwm)
   xscreensaver -no-splash &
   nohup sh ~/davmail.davmail.sh ~/davmail/davmail.properties &
   eval `cat ~/.fehbg`
   exec fvwm
   ;;
*)
   xscreensaver -no-splash &
   nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
   eval `cat ~/.fehbg`
   exec wmii
   ;;
esac


Take note that the xscreensaver, davmail & .fehbg bits depends on whether you need it or not. So after I type my login name and password, a dialog box appears and request me to choose the desired window manager to load. If I don't click any button in 4 seconds, wmii will load.

As this is a rough hack, there's issue with it. Currently after loading fvwm, I can't see the text on the exit confirmation box when I want to quit fvwm. Hmm it seems that most of the time, it's working fine. If you have any idea, do comment. I will greatly appreciate it. Later

Tuesday, December 14, 2010

OpenBSD NC4200: Another info on OpenSMTPD.

I wrote about OpenSMTPD before and the link I gave previously is no longer active. While searching for more info on OpenSMTPD, I found this page http://calomel.org which has informations and tips on many *BSD related stuff (mainly OpenBSD). There's also section on OpenSMTPD How To which is great.

Thursday, December 09, 2010

OpenBSD NC4200: iwi wireless with kismet.

I still can't use dstumbler properly with my wireless lan. It's been quite some time since I play around with OpenBSD and wireless LAN so I was a bit lost then. By doing man iwi I know that my iwi0 wireless device will not function properly unless I install iwi-firmware-3.1.tgz which can be downloaded from the link contained inside the man page.

Installing the file is the same as any other packages. I just do pkg_add iwi-firmware-3.1.tgz and then the file is installed. I also installed kismet-200805R1p0.tgz. After kismet is installed, I edited /etc/kismet/kismet.conf. Changes I made is:

suiduser=karl
source=radiotap_bsd_b,iwi0,radiotap_bsd_b
gps=false


I left all the other options to default. Don't want to go crazy over configurations I don't know. Then I chown /var/log/kismet so I can run kismet properly. Then, sudo to run kismet.

sudo kismet

kismet then bring iwi0 up and started scanning for any access point. Great. Will try to figure out anything about dstumbler. Again. Later.

OpenBSD NC4200: mcabber, console jabber client connect to Google Talk thru proxy.

mcabber is yet another console jabber client. There's a few more console messaging program but I'll get my hands dirty on this one first. I downloaded and installed the mcabber-0.10.0.tgz package.

I edited ~/.mcabber/mcabberrc. This is what I changed:

set jid = me@gmail.com
set server = talk.google.com
set port = 443
set ssl = 1
set proxy_host = "proxy.com"
set proxy_port = 8080


I left all the other options untouched. Then I run mcabber by issuing, uhm, mcabber in xterm. Then mcabber asked for my gmail password and voila!, I'm connected to GTalk. I can see my Google Talk friends listed but haven't had the chance to try and chat with any of them. Anyway I kept getting "feature not implemented" notification but unless I do some chatting, I don't quite sure what's the missing "feature". Maybe I'll update this part later.

Just a note, using the same setting, I can now login to GTalk using pidgin messenger. As pidgin is too much for wmii, I rather stick with mcabber. If you have other (preferably better) console jabber messenger program which can use proxy, do tell me. I'm interested to try out others.