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.

Thursday, November 25, 2010

OpenBSD NC4200: Ctrl + Alt + Del to lock wmii using xscreensaver.

1 thing I like about XFCE is that if I hit [Ctrl]+[Alt]+[Del], XFCE will lock my session using xlock or xscreensaver. By default, wmii can't do that. I've been searching for samples to do that but most samples that I've encountered are either using Ruby or Python. So I tried to just edit the ~/.wmii-3.5/wmiirc. After a few testing and frustrating hanging of wmii, I managed to get the key binding working by inserting this line:

# Key Bindings
   *default lines skipped*
   Key $MODKEY-Shift-$UP
      wmiir xwrite /tag/sel/ctl send sel up
   Key Mod1-Control-Delete
      /usr/local/bin/xscreensaver-command -activate

!
   for i in 0 1 2 3 4 5 6 7 8 9; do
   *default lines skipped*


The bolded lines are the addition to make the key sequence work. So after reloading the config, pressing Ctrl+Alt+Del locks my session using xscreensaver. Great. I read that new version of wmii changed the wmiirc configuration so FYI, this configuration is using wmii 3.6. Later then.

Wednesday, November 24, 2010

OpenBSD NC4200: Getting Alpine to work with DavMail.

Firstly, yeah I changed the blog's title. As I'm using ONLY OpenBSD nowadays, I think it's appropriate to change the title as I don't use other type of BSD. Now back to the main story.

So far, this is a brief description of what I (initially) wanted to achieve:

Alpine+LDAP <---> DavMail <---> CompanyEmail@OWA/Exchange

So here's what I'm currently doing. Getting Alpine + DavMail to play nicely together. I have posted earlier that I compiled my Alpine with LDAP support so I can check my company's email address book. Here's the current status of the project:

DavMail <---> CompanyEmail@OWA: Working fine
Thunderbird <---> DavMail: Working fine

As DavMail is working, I can just focus on configuring Alpine. The first time I start Alpine (by typing Alpine in xterm), the program will create ~/.pinerc configuration file. I don't need to blow my head to configure Alpine as it has a great built-in configuration tool.

Chapter 1: Receiving emails.
Inside Alpine's Main menu [M], I just key [S] (Setup), [L] (collectionLists). Then inside Alpine's Setup Collection List page, I hit [A] (Add collection). Here's my configurations:

Nickname: MyCompany
Server: localhost:1143/user=ASIA\karl
Path:
View:


After I save & exit the configuration [Ctrl+X], Alpine requested for my email's password. I keyed in my password and Alpine ask for confirmation to exit the page. No error messages, so it's all good. Now to test it.

I go to Main [M], then hit [L] (Folder List). I can see 2 folders:

MAIL
   Local folders in mail/

MyCompany
   Folders on localhost:1143/user=ASIA\karl in home directory


I choose MyCompany and using the Right Arrow [>] key, Alpine opened up my company email. I can see all the folders I have there and I can read my emails. So far so good.

Chapter 2: Sending emails (Working now!).
I'm still configuring this part as it's not working. I'll just put the steps for revising purpose. If you have a working solution, do comment.

Thanks to Christopher for commenting and posting a usefull link. Surely, I managed to tweak Alpine's setting and managed to get the SMTP portion working for sending emails. Do take note that I'm already running a new version of DavMail so it'll be better for you guys to update too.

Inside Alpine's Main menu, I choose [S] (Setup) and [C] (Config). The mandatory line to be update is this:

SMTP Server (for sending) = localhost:1025/user=ASIA\karl

So here, I don't need to use user=ASIA\\karl because the single \ is not escaped.
As I stated, it's currently not working. I kept getting "Error sending" message if I want to send out email. Previously I tried user=ASIA\karl but the "\" got escaped in ~/.pinerc and I still can't send email.

If I can't sort this out, I might have to go with using Sendmail instead of going thru DavMail. I will post any updates on this. I've also added this line in the same Config's screen:

Inbox Path = {localhost:1143/user=ASIA\karl}inbox

Note that this setting depends on whether you need it or not. As I use Alpine only for 1 OWA account, I set this up. Now press [E] to exit and save the setting. Press [Q] to quit Alpine.

Now vim your .pinerc file, normally in your home folder (~/.pinerc) and change this line:

disable-these-authenticators=GSSAPI,PLAIN

Save the .pinerc file and open Alpine back. I composed [C] an email and wallah! Alpine asked for my OWA password and email is sent! Great!. Again, thanks Christopher!

Chapter 3: Using LDAP.
As I've compiled my Alpine with LDAP support, I can use it to search my company's email address book. Inside Alpine's Main menu, I choose [S] (Setup) and [D] (Directory). Inside Alpine's Setup Directory Servers page, I hit [A] (Add dir) and this is my settings:

ldap-server= localhost
search-base= ou=people
port= 1389
bind-dn= ASIA\karl
nickname= MyCompany


Then I hit [E] (Exit Setup) and [Y] to save changes. [E] to exit the Setup Directory Servers page.

To test out, inside Alpine's Main menu, I hit [A] (Address Book) and select MyCompany. I hit the Right Arrow [>] key and type a name to search. Alpine then requested for my password and after a while, list of matches appears. So this part is working too.

Chapter 4: Offline email reading.
Yes, there's no offline reading for Alpine using IMAP. So now I know. That's one of the most important feature I wanted to use. After searching for solutions, I found the most suitable option. This is the latest description of the (possible) solution:

Alpine+LDAP <---> UW-IMAPD <---> OfflineIMAP <---> DavMail <---> CompanyEmail@OWA

So, instead of getting Alpine to directly access DavMail, Now I need to set up UW-IMAPD and OfflineIMAP. UW-IMAPD is built as dependency for Alpine+LDAP. UW-IMAPD is a local IMAP server and OfflineIMAP is like what the name means, reading emails from IMAP server in offline mode. Now OfflineIMAP will retrieve emails from my company's exchange thru DavMail (OfflineIMAP can't directly retrieve exchange emails), then OfflineIMAP will sync the emails to my local IMAP server which is UW-IMAPD so I will have a local offline copy of my emails that I can use with Alpine. Here's the checklist of needed softwares:

- Alpine+ldap
- UW-IMAPD
- DavMail
- OfflineIMAP

Update 13/04/11: Thanks to Christopher's comment, I got my email sending working! Thank you very much! You guys should read his comment and go to the link posted. I've update this post to reflect the changes. Later then.

Monday, November 22, 2010

OpenBSD NC4200: xterm-color + mp3blaster, no go.

I've been having an issue with mp3blaster recently. Every time I open mp3blaster, I can't use F1 to open folder. In fact, I can't use F1 to F5. F6 (repeat) and F7 (shuffle) works ok. I suspected that my ~/.Xdefaults is the culprit and after testing, it is true. This is my ~/.Xdefaults:

!! Xterm Resources
XTerm*loginShell: true
XTerm*termName: xterm-color
XTerm*faceName: Mono
XTerm*faceSize: 9
XTerm*internalBorder: 10
XTerm*highlightSelection: true
XTerm*cursorBlink: true
XTerm*utf8: 1


The culprit is bolded. So I had to change it to disable it by putting ! in front of it. After saving the file, I closed and open an Xterm, start mp3blaster and it can play my audio files fine now.

As for XTerm*faceName: Mono, you should try it if you haven't. The fonts in xterm is much much prettier and nice with it. Just the way I like it.

Before that, I found that my mp3blaster can't find any mixer device and just put Null0.0 in the mixer's panel. After reading OpenBSD's How do I set up an audio server? section, I edited my /etc/rc.conf.local and put:

aucat_flags=""

Then after next reboot, mp3blaster can happily use a mixer device. Later.

OpenBSD 4.8 @ Compaq NC4200 Laptop: dmesg

OpenBSD 4.8 (GENERIC) #136: Mon Aug 16 09:06:23 MDT 2010
deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) M processor 2.13GHz ("GenuineIntel" 686-class) 2.13 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,SBF,EST,TM2
real mem = 1064726528 (1015MB)
avail mem = 1037348864 (989MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 10/30/07, BIOS32 rev. 0 @ 0xf0000, SMBIOS rev. 2.3 @ 0xf310a (23 entries)
bios0: vendor Hewlett-Packard version "68DTH Ver. F.0F" date 10/30/2007
bios0: Hewlett-Packard HP Compaq nc4200 (EP948EC#UUF)
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG SSDT
acpi0: wakeup devices C067(S5) C0BA(S3) C0C1(S3) C0C2(S3) C0C4(S3) C0CB(S5) C1E1(S5) C0DB(S5) C1E4(S5) C1FD(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfec01000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 133MHz
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpiprt0 at acpi0: bus 2 (C067)
acpiprt1 at acpi0: bus 16 (C0CB)
acpiprt2 at acpi0: bus 32 (C0DB)
acpiprt3 at acpi0: bus 0 (C002)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: C1A5
acpipwrres1 at acpi0: C1AD
acpipwrres2 at acpi0: C1B4
acpipwrres3 at acpi0: C1D9
acpipwrres4 at acpi0: C262
acpipwrres5 at acpi0: C263
acpipwrres6 at acpi0: C264
acpipwrres7 at acpi0: C265
acpitz0 at acpi0: critical temperature 100 degC
acpitz1 at acpi0: critical temperature 101 degC
acpitz2 at acpi0: critical temperature 100 degC
acpitz3 at acpi0: critical temperature 110 degC
acpibat0 at acpi0: C173 model "Primary" serial 00794 2009/01/07 type LIon oem "Hewlett-Packard"
acpibat1 at acpi0: C172 not present
acpiac0 at acpi0: AC unit online
acpibtn0 at acpi0: C1FD
acpibtn1 at acpi0: C1FE
acpivideo0 at acpi0: C054
acpivout0 at acpivideo0: C102
acpivout1 at acpivideo0: C103
acpivout2 at acpivideo0: C104
acpivout3 at acpivideo0: C105
bios0: ROM list: 0xc0000/0x10000!
cpu0: Enhanced SpeedStep 2129 MHz: speeds: 2133, 1867, 1600, 1333, 1067, 800 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82915GM Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82915GM Video" rev 0x03
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xc0000000, size 0x10000000
inteldrm0 at vga1: apic 1 int 16 (irq 11)
drm0 at inteldrm0
"Intel 82915GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
ppb0 at pci0 dev 28 function 0 "Intel 82801FB PCIE" rev 0x03: apic 1 int 16 (irq 11)
pci1 at ppb0 bus 16
bge0 at pci1 dev 0 function 0 "Broadcom BCM5751M" rev 0x11, BCM5750 B1 (0x4101): apic 1 int 16 (irq 11), address 00:0f:b0:f7:3c:40
brgphy0 at bge0 phy 1: BCM5750 10/100/1000baseT PHY, rev. 0
ppb1 at pci0 dev 28 function 1 "Intel 82801FB PCIE" rev 0x03: apic 1 int 17 (irq 10)
pci2 at ppb1 bus 32
uhci0 at pci0 dev 29 function 0 "Intel 82801FB USB" rev 0x03: apic 1 int 19 (irq 10)
uhci1 at pci0 dev 29 function 1 "Intel 82801FB USB" rev 0x03: apic 1 int 17 (irq 10)
uhci2 at pci0 dev 29 function 2 "Intel 82801FB USB" rev 0x03: apic 1 int 18 (irq 10)
ehci0 at pci0 dev 29 function 7 "Intel 82801FB USB" rev 0x03: apic 1 int 19 (irq 10)
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb2 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xd3
pci3 at ppb2 bus 2
iwi0 at pci3 dev 4 function 0 "Intel PRO/Wireless 2200BG" rev 0x05: apic 1 int 21 (irq 11), address 00:16:6f:3d:13:52
cbb0 at pci3 dev 6 function 0 "TI PCI7XX1 CardBus" rev 0x00: apic 1 int 18 (irq 10)
"TI PCI7XX1 Flash" rev 0x00 at pci3 dev 6 function 3 not configured
sdhc0 at pci3 dev 6 function 4 "TI PCI7XX1 Secure Data" rev 0x00: apic 1 int 20 (irq 10)
sdmmc0 at sdhc0
sdmmc1 at sdhc0
sdmmc2 at sdhc0
"TI PCI7XX1 Smart Card" rev 0x00 at pci3 dev 6 function 5 not configured
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 3 device 0 cacheline 0x10, lattimer 0x20
pcmcia0 at cardslot0
auich0 at pci0 dev 30 function 2 "Intel 82801FB AC97" rev 0x03: apic 1 int 17 (irq 10), ICH6 AC97
ac97: codec id 0x41445374 (Analog Devices AD1981B)
ac97: codec features headphone, 20 bit DAC, No 3D Stereo
audio0 at auich0
"Intel 82801FB Modem" rev 0x03 at pci0 dev 30 function 3 not configured
ichpcib0 at pci0 dev 31 function 0 "Intel 82801FBM LPC" rev 0x03: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801FB IDE" rev 0x03: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0:
wd0: 16-sector PIO, LBA48, 76319MB, 156301488 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
pciide0: channel 1 ignored (disabled)
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
"PSCR, SLB REFLEX 20, V1.1, " at pcmcia0 function 0 not configured
uhidev0 at uhub1 port 2 configuration 1 interface 0 "Logitech USB-PS/2 Optical Mouse" rev 2.00/20.00 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse1 at ums0 mux 0
softraid0 at root
root on wd0a swap on wd0b dump on wd0b

Tuesday, November 16, 2010

OpenBSD NC4200: Alpine + DavMail: DavMail configurations.

A bit of personal history. Bear with me as it might get you bored to death as it will be a long one. Ok, my company uses MS Exchange for emails. And, wait, I guess that just sums it up. Company uses MS Exchange, bla bla, I don't want to use Outlook, bla bla, I don't want to use MS Windows, bla bla so here I am. Basically, I just want to use Alpine / Thunderbird to access my company's exchange so I can receive and send emails. Bit of details about my profile and the company's email (this won't be a real one, just to show you how I done it):

Email: karl.bsd@company.com
Username: ASIA\karl
OWA Exchange: https://owa.company.com/exchange/

As you can see, the Username for me to log in to the OWA is different than my email add. To make things a bit more complicated, my internet access is through a http proxy which I will name as http://my.proxy.com at port 8080. Ok enough history class, now on to the good stuff.

For DavMail, it comes zipped with quite some files inside. From DavMail's website, I choose Workstation (personal) mode > Other DavMail release. What contains inside mine is:

lib (folder with lots of *.jar files)
davmail.jar
davmail.sh


I created ~/davmail/ folder and extracted the archive inside it. In basic, I can just use:

$ sh ~/davmail/davmail.sh &

And the familiar DavMail icon will appear in XFCE's taskbar. But that's for XFCE. As wmii's status bar is not a task bar, DavMail will not have the icon. In XFCE, right clicking the DavMail icon and choosing settings, I just put my OWA address in the DavMail url. Then I choose to set the proxy server with the 8080 port. I left all the other setting to default.

XFCE + Thunderbird + DavMail:
This part is quite easy. There's numerous documentations / HOWTOs on this. Even the official DavMail website have tutorial on setting up Thunderbird to work with DavMail. I just follow the documentation and it's working ok. I can send receive emails, do LDAP queries and even sync with the company's calendar using Thunderbird+Lightning+CalDav. Just remember to install lightning using packages as there will be none available in Thunderbird's AddOn website for OpenBSD. As I've stated earlier, sh ~/davmail/davmail.sh & is enough to get you started with DavMail in XFCE.

wmii + Alpine + DavMail:
Now this is THE thing. wmii and normal DavMail don't quite play nicely. By saying "normal" I mean using the command I stated above. There's no taskbar for DavMail to icon-er-ify(?) to. The solution? A quick google and I found something about DavMail configuration file. Shamelessly following the said information, I created davmail.properties file inside ~/davmail/ folder. Here's my davmail.properties file, important bits are bolded for your pleasure:

davmail.url=https://owa.company.com/exchange/
davmail.popPort=1110
davmail.imapPort=1143
davmail.smtpPort=1025
davmail.caldavPort=1080
davmail.ldapPort=1389
davmail.keepDelay=30
davmail.sentKeepDelay=90
davmail.imapIdleDelay=
davmail.useSystemProxies=false
davmail.enableProxy=true
davmail.proxyHost=my.proxy.com
davmail.proxyPort=8080

davmail.proxyUser=
davmail.proxyPassword=
davmail.ssl.keystoreType=JKS
davmail.ssl.keyPass=
davmail.ssl.keystorePass=
davmail.server=true
davmail.server.certificate.hash=
davmail.bindAddress=
davmail.allowRemote=true
davmail.disableUpdateCheck=false
log4j.rootLogger=WARN
log4j.logger.davmail=DEBUG
log4j.logger.org.apache.commons.httpclient=WARN
log4j.logger.httpclient.wire=WARN
davmail.logFilePath=/var/log/davmail.log


For davmail.proxyHost=, previously I was tearing my hairs apart because normal DavMail is working fine but not so when I use the davmail.properties file. When I tried using my.proxy.com instead of http://my.proxy.com, wallah! The earth smiles back at me. davmail.useSystemProxies= is "false" and davmail.enableProxy= is "true" so that instead of using the (currently malfunctioned) System Proxy, DavMail will use the proxy address I specified. Then I need to set the davmail.server= to "true" so that DavMail will not show any icon / GUI and be in daemon mode. I also need to chmod the /var/log/ folder so that DavMail can properly write logs inside there. After all is done, I do testing with:

$ sudo sh ~/davmail/davmail.sh ~/davmail/davmail.properties &

I opened up Thunderbird and all is good. Now to get DavMail started everytime I log in wmii. I mentioned earlier that I use SLiM login manager to replace xdm. SliM can let me choose what window manager / desktop environment I want to log in and that's something xdm currently don't have. I posted my ~/.xinitrc script earlier and this is the changes I need to make to get DavMail started after my login:

# This is for SLiM

case $1 in
wmii)
 xscreensaver &
 nohup sh ~/davmail/davmail.sh ~/davmail/davmail.properties &
 eval `cat ~/.fehbg`
 exec wmii
 ;;


You can follow the rest of the script by searching my previous post. As for the nohup, man nohup will give you great explaination. I log out from wmii and re-login. Open up Thunderbird and it's working alright. Eh, wait.. Thunderbird?! Where's the Alpine's stuff?! Whoa hold yer horses mate. That part will need another post.

Coming up next. Getting Alpine to work with DavMail. Or almost.

OpenBSD NC4200: Alpine + DavMail, ftp_proxy / http_proxy problem again.

Here's the latest update for my Alpine + DavMail project. Installing Alpine via OpenBSD's package doesn't come with LDAP support enabled. I can verify that by using:

$ alpine -supported

So, I read the OpenBSD ports system man pages and Alpine ports man pages and found that I need to specify the ldap flavor when building the Alpine ports. So in /usr/ports/mail/alpine directory, I use this syntax to build Alpine port with ldap built-in.

$ sudo env FLAVOR="ldap" make install
$ sudo env FLAVOR="ldap" make clean


That's when I found out that my ftp_proxy / http_proxy is unusable. Again. Sheesh! I don't know what happened to it and I'm still searching for solution. So, I downloaded the needed dependencies manually and put it inside /usr/ports/distfiles/. After a while the Alpine with ldap support is installed. Oh I need to remove the previous Alpine installation before the new Alpine can be installed. Alpine-ldap is installed and so do DavMail. Now for the good stuff. Making them work (nicely) together. For that, I'll write it in another post.

Coming up next: My DavMail configurations

Monday, November 15, 2010

OpenBSD NC4200: wmiirc, updated status bar script, SLiM login manager & Alpine with Davmail

Using my previous posting as reference, I copied /etc/wmii-3.5/wmiirc to ~/.wmii-3.5/wmiirc then added all the status bar scripts. I also change the following:

# Configuration Variables
MODKEY=Mod4


WMII_TERM="mrxvt"

And then added my status bar script. Surprisingly (or not), I made a few mistakes in my last status bar script I posted previously. You see, I copied the script by typing manually to blogspot, rather than using a text editor's copy/paste function. Furthermore, some of the mistakes are less forgiven in OpenBSD 4.8 than in previous installation. The battery status is not working properly in 4.8. I guess I haven't tested the script thoroughly before although I think previously the script was working ok. Now I've rewritten the battery status script and it seems to be working fine now. So here I'll post the (hopefully) working version of my status bar script. It's still displaying the system cpu usage, free memory, main/extended battery status, a/c adapter status & date time. As for WMII_TERM="mrxvt", that's because I installed mrxvt to replace xterm in wmii.

Here's the updated script for my wmii Status Bar:

# Status Bar info
status() {

 # This is for the main battery, if there's none, just display nothing.
 if [[ $(sysctl -n hw.sensors.acpibat0) != '' ]]; then
  bat0full=$(sysctl -n hw.sensors.acpibat0.amphour0 | sed s/.A.*//)
  bat0warn=$(sysctl -n hw.sensors.acpibat0.amphour1 | sed s/.A.*//)
  bat0low=$(sysctl -n hw.sensors.acpibat0.amphour2 | sed s/.A.*//)
  bat0now=$(sysctl -n hw.sensors.acpibat0.amphour3 | sed s/.A.*//)

  # Get the battery capacity in percentage
  bat0cap=`echo "100 * ${bat0now} / ${bat0full}" | bc`
  bat0p="$bat0cap%"

  # Get the charging status of the battery, replace with symbols
  bat0s=$(sysctl -n hw.sensors.acpibat0.raw0 | sed 's/'0'.*//; s/'1'.*/-/; s/'2'.*/+/; s/'4'.*/!/')
 else
  bat0p=`echo ""`
  bat0s=`echo ""`
 fi

 # This is for extended battery, if it's installed, display the status. Else just display nothing.
 if [[ $(sysctl -n hw.sensors.acpibat1) != '' ]]; then
  bat1full=$(sysctl -n hw.sensors.acpibat1.amphour0 | sed s/.A.*//)
  bat1warn=$(sysctl -n hw.sensors.acpibat1.amphour1 | sed s/.A.*//)
  bat1low=$(sysctl -n hw.sensors.acpibat1.amphour2 | sed s/.A.*//)
  bat1now=$(sysctl -n hw.sensors.acpibat1.amphour3 | sed s/.A.*//)

  # Get the battery capacity in percentage
  bat1cap=`echo "100 * ${bat1now} / ${bat1full}" | bc`
  bat1p="$bat1cap%"

  # Get the charging status of the battery, replace with symbols
  bat1s=$(sysctl -n hw.sensors.acpibat1.raw0 | sed 's/'0'.*//; s/'1'.*/-/; s/'2'.*/+/; s/'4'.*/!/')
 else
  bat1p=`echo ""`
  bat1s=`echo ""`
 fi

 # Get the AC Adapter status
 ac0=$(sysctl -n hw.sensors.acpiac0.indicator0 | sed s/.'('.*//)

 # Get the free memory data using top
 memfree=$(top | grep Memory | sed 's/.*Free:.//; s/.Swap.*//')

 # Get the CPU usage via top
 cpuuse=$(top | grep 'CPU states:' | sed 's/.*nice..//; s/.sys.*//')

 # Display the status bar
 echo CPU: $cpuuse '|' Mem: $memfree '|' Bat: ${bat0p}${bat0s} ${bat1p}${bat1s} '|' AC: $ac0 '|' $(date)

}


Another thing, I changed the X Display Manager to Simple LogIn Manager (SLiM). I would've stick with xdm if not for the fact that xdm (currently) can't let me choose which X session I want to start (wmii or XFCE4). After I installed SLiM, I opened up /etc/rc.local and added:

# Add your local startup actions here.
# This is for SLiM
if [ -x /usr/local/bin/slim ]; then
 echo -n ' slim'; /usr/local/bin/slim -d &
fi

echo '.'


Do make sure that xdm has been disabled in /etc/rc.conf.local or /etc/rc.conf. After that I edited SLiM's config file /etc/slim.conf:

# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
login_cmd exec /bin/ksh -l ~/.xinitrc %session


# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with the slim sources
sessions wmii,xfce4


Unfortunately installing the SLiM from package doesn't provide me with xinitrc.sample stated above. After googling for samples, I managed to edit my ~/.xinitrc for SLiM's use:

# This is for SLiM
DEFAULT_SESSION=wmii

case $1 in
wmii)
 xscreensaver &
 eval `cat ~/.fehbg`
 exec wmii
 ;;
xfce4)
 exec startxfce4
 ;;
*)
 xscreensaver &
 eval `cat ~/.fehbg`
 exec $DEFAULT_SESSION
 ;;
esac


Now at SLiM's login screen, I can choose the window manager I want to use with F1. Currently I'm having problem to reload background wallpaper for wmii using feh and searching for solution. It seems that eval `cat ~/.fehbg` is the correct command for it, not `cat ~/.fehbg` As for SLiM, halt and reboot command doesn't work yet. More on that later.

Oh yeah, I'm back on wmii. Not that I don't like xfce. Well xfce is a great desktop environment. But there's something about wmii that kept getting back at me. Currently I'm still using Thunderbird with DavMail, still trying to set up Alpine with DavMail. Will post something on that later.

Update: I'm back to xterm instead of mrxvt. Using xterm-256color is enough for me.

Update: I was thinking about giving a preview on what will be displayed on the status bar. So here it is. This preview is my machine on extended battery (which is charging), on AC adapter. Sorry no fancy picture or anything:

CPU: 4.5% | Mem: 456M | Bat: 100% 76%+ | AC: On | Fri Dec 10 15:27:10 MYT 2010

Thursday, November 11, 2010

OpenBSD NC4200: Testing video function in VLC.

Starting vlc via vlc -vvv shows that there's main interface error regarding x11-display and option global-key-xxx stuff. But vlc can start just fine. With default setting, I can play *.mp3 files just fine but that's audio. vlc just exited with x11-display when I tried opening video file. So I opened vlc, go to Tools > Preferences > Video > Output and choose Simple DirectMedia Layer video output instead of the default, err, Default. Then I opened an *.avi file and it plays nicely. Great.

Still need to search for the main interface error stuff. Later.

Wednesday, November 10, 2010

OpenBSD NC4200: Printing with CUPS.

As my OpenBSD is now my primary OS for work (not that my office requires it), I really need to be able to print anything. Related CUPS packages that's installed is:

cups-1.4.4p1
gtk+2-cups-2.20.1
xfprint-4.6.1p5

Using tips from http://www.insidesocal.com/click/2009/01/openbsd-tip-speed-up-boot-time.html, I edited /etc/rc.local and put:

# Add your local startup actions here.

if [ -x /usr/local/sbin/cupsd ]; then
echo -n ' cupsd'; /usr/local/sbin/cupsd &
fi

echo '.'


and from XFCE Menu > Settings > Xfce 4 Printing System Setting, I choose CUPS as my Printing System.

Then I go to XFCE Meny > System > Manage Printing which will open up http://localhost:631/, the CUPS Management page. From there, I go to CUPS For Administrators > Adding Printers And Classes. It'll go to another page which then I choose Printer > Add Printer. Then I can see all network printers which has been detected! Great! I choose my printer, click Continue, change the printer's Name/Description/Location and click Continue. Then I choose Generic Make as there's no driver available for my printer. After that I choose Generic PCL Laser Printer (en) for the model. A few more setups and the printer is added. I tried printing the summary page from Firefox and it's successful!. Wow. I never thought that it'll be this easy. Later.

Monday, November 08, 2010

OpenBSD NC4200: Getting vlc-web plugins to be listed in Firefox

I installed vlc-web package but it's not listed in my Firefox's plugin list. After searching fer a while, I found that the plugin's directory is locked to root only. So I chmod the directory:

sudo chmod 774 /usr/local/lib/mozilla

After restarting Firefox, the plugin is now listed. I'll try and find a video to play and see the outcome.

OpenBSD NC4200: DavMail LDAP is working..

Okay. Silly me. I found that instead of putting "localhost" in the Hostname tab, I put "locahost". Yeah. Without a freaking "L". Now it's working fine.

OpenBSD NC4200: Thunderbird + DavMail works ok. Firefox 3.5 + java plugins works ok.

I managed to get DavMail running. Like I've posted earlier, it's a bit tricky as it involves getting Java running. For OpenBSD 4.8, Java 1.7.0 can be installed using package but older versions (1.6.0, 1.5.0) will require ports installation. I installed version 1.6.0 using ports (hurray!) but I can't run the davmail.sh. I found that the correct command to run the script is:

sh davmail.sh

Done that and error displayed telling me that it could not find Java. Sheesh. After playing around, I found a way to make Java work. I've installed jdk 1.7.0 & jre 1.7.0 using packages, jdk 1.5.0 & jdk 1.6.0 using ports. I found that the jdks is installed in /usr/local. So, by using jdk 1.7.0, I create a symlink in /usr/local/bin.

ln -s /usr/local/jdk-1.7.0/bin/java /usr/local/bin/java

Then, inside the DavMail folder, I issued the command:

sudo sh davmail.sh

And then... DavMail's icon appears on my XFCE's taskbar! Yeah! Seems to be working! But as I'm not online right now (yeah I wrote this offline..), I can't test it with Thunderbird yet. If all is well, I'll proceed with daemonising the DavMail so it'll autostart as daemon everytime the machine boots up. Now to think about it, all the hours waiting for jdk 1.6.0 & jdk 1.5.0 to be installed is just a waste of time. I'll uninstall those ports and test DavMail later.

I also have to manually add the Java man page in /etc/man.conf. This might not be the perfectly correct addition but now man java works.

# The whatis/apropos database.
_whatdb /usr/local/jdk-1.7.0/man/whatis.db
_whatdb /usr/local/jre-1.7.0/man/whatis.db
_whatdb /usr/local/kaffe/man/whatis.db


# Other sections that represent complete man subdirectories.
jdk17 /usr/local/jdk-1.7.0/man/
jre17 /usr/local/jre-1.7.0/man/
kaffe /usr/local/kaffe/man/


For the above, I just added those lines to the specific sections. In the # Specific section/directory combination. area, I changed the default line:

1 /usr/{share,X11R6,local}/man/{cat,man}1

to this one:

1 /usr/{share,X11R6,local}/{man,jdk-1.7.0/man,jre-1.7.0/man,kaffe/man}/{cat,man}1

Then doing man java now works.

Update: I need to install jdk-1.6.0 (jdk-1.5.0 will be installed as dependency) as jdk-1.7.0 don't have the Firefox plugins. After installing jdk-1.6.0 from ports, there's a guide on how to create symlink pointing to firefox's plugins directory. Just follow that and Firefox can operate with java sites. Yeah!

For Thunderbird, I just follow the guide in DavMail's Website and I can now access my company's Exchange using IMAP connection. CalDav also works fine (which is not ok previously using XP) but it seems that I still need to make my LDAP address book working. Will be looking out for that later. Autostarting the davmail also is giving me problem. As for now, I can just start davmail using console with this command:

sudo sh davmail.sh &

Daemon mode using /etc/local.conf or ~/.xinitrc won't work. Tu use Lightning (Thunderbird calendar extension), I need to install it from package. There won't be any available installation for that via mozilla's addon site.

As for the ftp_proxy & http_proxy, I've added this lines in my ~/.profile file:

# Set up proxy
export ftp_proxy=http://my.proxy.net:8080/
export http_proxy=http://my.proxy.net:8080/


Update: I've done another ports installation (for opera) and proxy works like a charm now!. Later.

Thursday, November 04, 2010

OpenBSD NC4200: Ports round 2. Java installation. DavMail with Thunderbird.

I've done another installation of OpenBSD. Now I'm using 4.8. I've install XFCE Desktop Environment. Yeah well read good comments about it. Skipped GNome / KDE because it's too bloated.

I managed to get Thunderbird working with DavMail to access my exchange (company) email. But that's in Windows XP. Because DavMail is based on Java, it's stated that the program can run from Linux & *BSD/*NIX. This will be my main project for now.

As DavMail requires JDK, I need to install Java. As stated in the documentation, no package exist for JDK prior to 1.7. So, I was left (again) with the choice to install Java using ports system which if you remember, failed miserably in 4.7 because of my ftp_proxy/http_proxy. As for this round 2, I have a good news. I can now do ports installation behind proxy! Using console, I just type:

export ftp_proxy=http://proxy.address.net:8080/

and I can now do ports installation!. I also do export http_proxy with the same proxy address. To make the proxy setting permanent, I edited ~/.profile and includes:

export ftp_proxy=http://proxy.address.net:8080/
export http_proxy=http://proxy.address.net:8080/


But I haven't rebooted the machine yet so I can test this one. A "'" (single quote) might be needed to enclosed the proxy address. Now on the Java installation (1.6).

First I downloaded the ports.tar.gz file from OpenBSD's mirror and unpacked it following the available howto.

Then I created a /etc/mk/conf file and included:

SUDO=/usr/bin/sudo
ACCEPT_JRL_LICENSE=Yes


As this is my first time installing Java using ports, I use make search name=java inside /usr/ports and run make install inside Java 1.6 folder. Installation exited prematurely as there's a few files In needed to download manually which is:

http://download.java.net/jdk6/6u3/
jdk-6u3-fcs-src-b05-jrl-24_sep_2007.jar
jdk-6u3-fcs-bin-b05-jrl-24_sep_2007.jar
jdk-6u3-fcs-mozilla_headers-b05-unix-24_sep_2007.jar

http://www.eyesbeyond.com/freebsddom/java/JDK16JRLConfirm.html
bsd-jdk16-patches-4.tar.bz2
(Just click the ACCEPT button and the download will begin)

(Java 1.5 seems to be needed too)

http://download.java.net/tiger/tiger_u16/
jdk-1_5_0_16-fcs-src-b02-jrl-28_may_2008.jar
jdk-1_5_0_16-fcs-bin-b02-jrl-20_may_2008.jar
jdk-1_5_0_16-mozilla_headers-b02-unix-28_may_2008.jar (might be optional)

http://www.eyesbeyond.com/freebsddom/java/JDK15JRLConfirm.html
bsd-jdk15-patches-9.tar.bz2
(Just click the ACCEPT button and the download will begin)

http://java.sun.com/products/archive/j2se/5.0_16/index.html
jdk-1_5_0_16-solaris-i586.tar.Z
(Kind of tricky to get this file. Remember to choose Solaris X86)

http://archive.apache.org/dist/xml/xalan-j/
xalan-j_2_7_0-bin.tar.gz

I put all the files inside /usr/ports/distfiles and then I continue the make install process. Wallah! Ports can now download additional files automatically! Hurray! the proxy settings works! Now I let it install. To be continued...

Thursday, January 28, 2010

OpenBSD NC4200: Alpine trough OpenSMTPD went fine.

Ah, done testing Alpine email client with OpenSMTPD and it's working fine. In Alpine, I go to "Setup" to configure Alpine and choose "Config". Then in the "SMTP Server (for sending)" line, I just put localhost as the value and then exit the setting. I composed an email and it went through just fine. Great. Bye bye sendmail.

Saturday, January 23, 2010

OpenBSD NC4200: iwi0 wireless & kismet.

After unsuccessful attempts to get my iwi0 wireless to work with dstumbler, I downloaded and installed kismet.

After installation, I vi /usr/kismet/kismet.conf and add this line to the "source" section:

source=radiotap_bsd_b,iwi0,radiotap_bsd_b

then in term, running "kismet" displays the scan using the iwi0 device. Great! At last!. I'll find something about the dstumbler issue later. I haven't tested the wireless connection as there's no AP that I can test on. Something on that later when I have the opportunity.

OpenBSD NC4200: from SendMail to OpenSMTPD, from GNU/screen to tmux.

Heyya, while seaching for any OpenBSD related goodies, I found a few interesting things. First of all is tmux, a terminal multiplexer a-la GNU/Screen. I used screen a lot if I'm not in wmii and tmux is a BSD-licensed equivalent. Hurrah! In OpenBSD 4.6, tmux is already in default installation so no need to get a package for it. man tmux if you're interested. As fer me, it's time to say goodbye to screen ;).

Then it's the OpenSMTPD. From the official website:

"OpenSMTPD is a FREE implementation of the Simple Mail Transfer Protocol.

The OpenSMTPD project was started as a separate project after a developer suffered from eyes bleeding while trying to slightly alter sendmail configuration. It was imported in the OpenBSD tree in November 2008 to help speed up development."

In OpenBSD 4.6, OpenSMTPD is readily available but not enabled by default. 4.6 still uses Sendmail. I tried finding the way to enabled it using 4.6 man smtpd but there's no installation details. However, using man smtpd (OpenBSD -current, more details than in my default 4.6 manual) is much better. Also, you can read here that OpenSMTPD is still heavily in development. For a personal machine like my laptop, OpenSMTPD will have no issue. I've already enabled the OpenSMTPD using the online manual and so far, it's ok. Haven't tested it yet. Soon OpenSMTPD will replace Sendmail in the base OpenBSD system.

Thursday, January 21, 2010

OpenBSD NC4200: Howto get battery status & put it on wmii's status bar.

Update: My Updated wmiirc Status Bar Script is the recent version, there's a bit of error in the script below so you guys better take a look at the most recent one. I'm keeping this post as an archive.

Hola. After searching for an answer, I finally found out how to get the battery status for my NC4200 laptop. In case you're wondering where to look for more information, this is what I look at:

man acpi
man sysctl


This is the command and output of my primary laptop's battery. If you're using an extended battery pack like me, you'll see hw.sensors.acpibat1 got listed too. Here I just list the primary battery only:

$ sysctl hw.sensors.acpibat0
hw.sensors.acpibat0.volt0=11.10 VDC (voltage)
hw.sensors.acpibat0.volt1=12.40 VDC (current voltage)
hw.sensors.acpibat0.amphour0=4.04 Ah (last full capacity)
hw.sensors.acpibat0.amphour1=0.20 Ah (warning capacity)
hw.sensors.acpibat0.amphour2=0.04 Ah (low capacity)
hw.sensors.acpibat0.amphour3=3.95 Ah (remaining capacity), OK
hw.sensors.acpibat0.raw0=0 (battery idle), OK
hw.sensors.acpibat0.raw1=0 (rate)


Not forgetting that I also need to take a look at the AC Adapter. So I just use:

$ sysctl hw.sensors.acpiac0
hw.sensors.acpiac0.indicator0=On (power supply)


Update: Here's my simple script to display the battery percentage. I shamelessly take bits from here, here (FreeBSD) and a few others. Also, man sed, man bash is also usefull.

Update: I finally got most of the status for the battery that I wanted.

Update: I now includes the cpu usage & free memory using top. Bear in mind this is my first try so I need to clean the script more. Here's the update script:

Update: I tested the script using my extended battery and I saw garbage being display if the extended battery was taken off. So now I have tweak the script and now hopefully it fixed the issue. I done quite some testing and it seems to be ok now.

Here's some information regarding what the status bar will display from left to right:

- Display the CPU usage by system
- Display the Free Physical Memory capacity
- Display the percentage of the primary battery remaining, behind it display "+" if it's charging, "-" if it's discharging, "!" if the battery is critical and nothing if the battery is idle. As I'm using the extended battery, this status bar will also display the extended battery remaining charges the same as the primary one.
- Display the AC Adapter status. "On" if it's on AC or "Off" if not.
- Display the full date.

Ok so I vim ~/.wmii-3.5/wmiirc and insert the script below just before the # Event processing entry.

######### Script starts

# My wmii Status Bar script
status() {
 # This is for the main battery, if there's none, just display nothing.
 bat0=$(sysctl -n hw.sensors.acpibat0)
 if [ "${bat0} != "" ]; then
  bat0full=$(sysctl -n hw.sensors.acpibat0.amphour0 | sed s/.A.*//)
  bat0warn=$(sysctl -n hw.sensors.acpibat0.amphour1 | sed s/.A.*//)
  bat0low=$(sysctl -n hw.sensors.acpibat0.amphour2 | sed s/.A.*//)
  bat0now=$(sysctl -n hw.sensors.acpibat0.amphour3 | sed s/.A.*//)

  # Get the battery capacity in percentage
  bat0cap=`echo "100 * ${bat0now} / ${bat0full}" | bc`
  bat0p="$bat0cap%"

  # Get the charging status of the battery, replace with symbols
  bat0s=$(sysctl -n hw.sensors.acpibat0.raw0 | sed 's/'0'.*//; s/'1'.*/-/; s/'2'.*/+/; s/'4'.*/!/')
 else
  bat0p=`echo ""`
  bat0s=`echo ""`
 fi

 # This is for extended battery, if it's installed, display the status. Else just display nothing.
 bat1=$(sysctl -n hw.sensors.acpibat1)
 if [ "${bat1} != "" ]; then
  bat1full=$(sysctl -n hw.sensors.acpibat1.amphour0 | sed s/.A.*//)
  bat1warn=$(sysctl -n hw.sensors.acpibat1.amphour1 | sed s/.A.*//)
  bat1low=$(sysctl -n hw.sensors.acpibat1.amphour2 | sed s/.A.*//)
  bat1now=$(sysctl -n hw.sensors.acpibat1.amphour3 | sed s/.A.*//)

  # Get the battery capacity in percentage
  bat1cap=`echo "100 * ${bat1now} / ${bat1full}" | bc`
  bat1p="$bat1cap%"

  # Get the charging status of the battery, replace with symbols
  bat1s=$(sysctl -n hw.sensors.acpibat1.raw0 | sed 's/'0'.*//; s/'1'.*/-/; s/'2'.*/+/; s/'4'.*/!/')
 else
  bat1p=`echo ""`
  bat1s=`echo ""`
 fi

 # Get the AC Adapter status
 ac0=$(sysctl -n hw.sensors.acpiac0.indicator0 | sed s/.'('.*//)

 # Get the free memory data using top
 memfree=$(top | grep Memory | sed 's/.*Free:.//; s/.Swap.*//')

 # Get the CPU usage via top
 cpuuse=$(top | grep 'CPU states:' | grep 's/.*nice..//; s/.sys.*//')

 # Display the status bar
 echo CPU: $cpuuse '|' Mem: $memfree '|' Bat: ${bat0p}${bat0s} ${bat1p}${bat1s} '|' AC: $ac0 '|' $(date)
}


######### Scripts ended

So after I refresh the wmiirc ([MOD]+[A], wmiirc), the status bar displays something like:

CPU: 6.5% | Mem: 847M | Bat: 98% 97%+ | AC: On | Fri Jan 22 12:18:28 MYT 2010

The 1st battery doesn't have any "+" or "-" symbol behind it because it's currently idle. The 2nd battery is currently charging as you can see by the "+" symbol behind it. With this script there's no longer junks being displayed if the battery was taken off. Oh yeah I still didn't use the $bat0warn and $bat0low yet. I'll figure out how to manipulate it so low battery will shutdown the machine. Do use the script if you find it interesting. If you has improvement, please share.

- Display the battery percentage with "+" is the battery is charging.
- Display "AC" text if the machine is on AC adapter.
- Auto shutdown the machine if the "low capacity" indicator is reached.
- Display the wireless status (iwi0, still having headache on getting it to work with dstumbler).
- Display the CPU status. (clean this up).
- Display the RAM status (free memory, size).
- Simplifies the script (yeah well I'm no programmer).

Tuesday, January 19, 2010

OpenBSD NC4200: Howto change the web browser for NetBeans 5.5 & other issues.

Hola. NetBeans 5.5 can be installed using OpenBSD's package. I got mine installed and after playing with it, found a few things that might be interesting fer those who're using OpenBSD + NetBeans.

First of all, by default NetBeans have a few web browser listed in Tool > Options > General tab. If you have either Mozilla, Firefox or Netscape installed; there should be no issue but if you're like me, who installed Firefox 3.5 instead, the will be some problem. If you choose Firefox in NetBeans option, you'll get the browser not configured error as Firefox 3.5 will be installed as "firefox35". Well, previously I just create a symbolic link for "firefox" pointing to "firefox35" like this:

# ln -s /usr/local/bin/firefox35 /usr/local/bin/firefox

and wallah! NetBeans can use the web browser feature happily. Then just now I found out another way round. In NetBeans's Tool > Options window, click on the Advanced Options's button. Go to Options > IDE Configuration > Server and External Tool Settings and then expand the Web Browser link. You'll see Mozilla, Firefox, Netscape and Swing HTML Browser listed there. Right-click on the Firefox link and choose "rename". Rename it to Firefox35 (basically this is optional, it's just a name). Then click on the Firefox link, change the "Browser Executable" option in the Properties window to the right from:

firefox -remote "openURL({URL})"

to

firefox35 -remote "openURL({URL})"

so that the "Process" option is changed from "firefox" to "firefox35" and leaving "Arguements" text intact. Then click "Ok" and "Close" the Advanced Options window. Then try selecting the NetBeans "Help" link and it should open the requested page from firefox35. But as the NetBeans version is lagged behind the current NetBeans version, you'll mostly get "Page Not Found" page from NetBeans's website. Oh well.

I also found another issue with NetBeans. I think this is a problem for a wide variety of OpenBSD + NetBeans user regarding of the NetBeans's version. The not-so-famous "garbled output text" issue. In my case, when I build any project, the first few build will display boxes in the Output window instead of readable build results. So I need to hit F11 a few times before the build result will display the correct readable text. But unfortunately the Run (F6) and Debug (F5) function is much worst. The Output's result is ALWAYS displaying boxes instead of readable text. Why is it not so famous? Well I guess there's only a handful of people using NetBeans on OpenBSD. If I managed to get any similar issue from Google, there's no solution whatsoever. There was one person using Ubuntu and NetBeans 5.5 who had the same issue but there seems no follow up on it. Maybe he managed to find a solution? I'm not sure. In OpenBSD's camp, a guy did put the issue in mailing list and then he opted to go for Eclipse instead. So, no luck to find the solution fer now. I downloaded Eclipse and whoa, with so many modules I can choose; I don't think I have the time.

Anyway, in NetBeans's Tools > Options > Miscellaneous > Ant, I noticed that if I change the "Verbosity Level" from "Normal" to "Quiet", building my project will not display any garbled / boxes text. But then any project which will display any result to Output (System.out.println( ) for example), Running / Debugging the project is as useless as Output with unreadable text because "Quiet" level will not display any output result, just a simple "Build Successful (Total time: x seconds)". *Sigh*. If not for this issue, NetBeans will be just perfect. I'm not sure if this is related to Ant or the 5.5 version of NetBeans. But I do know nearly all people who have/had this problem is using OpenBSD.

I read somewhere that a person suggested to another OpenBSD+NetBeans user to install "dejavu" font but there's no follow up after that. So I don't know if that will resolve the issue or not. Maybe I'll find something the more I play with NetBeans. But still, if anyone out there now any info / solution for this problem, please just comment on my blog here so I can test and share it. Any link/workaround/script/module worth trying is, well, worth trying.

That's it fer now. Yeah well I started learning Java programming a few days ago. Still a newbie. Later.

Thursday, January 14, 2010

OpenBSD NC4200: calcurse 2.7 in on -current & freshclam.

Argh! The OpenBSD CVSweb for ports has confirmed it. The version 2.7 is on -current, not -stable. I don't think I'm ready to go for -current yet. So I need to find another calendar software (curse based preferably) and wait for OpenBSD 4.8 then. *sigh*.

In the mean time, I'm updating my ClamAV's virus definition. Well I might need it some day. Later then.

OpenBSD NC4200: Updating ports to -stable. Finally!

I'm currently updating my ports collection to OpenBSD's 4.6-stable. So far it's going ok. Not finished yet. Hopefully I'll get to install the latest version of calcurse so I can finally use the notification feature.

First cd to /usr/ports/. Then I su to gain superuser access. Then after choosing the anoncvs server to use, I issued the command:

# cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_4_6 -Pd

So far it's updating a few folders and I didn't see the calcurse port is being updated. Uhh. I saw the 2.7 version is already in OpenBSD's port from OpenPorts.se but I'm not sure if it's in -stable or -current. Need to check with that later.

Thursday, January 07, 2010

OpenBSD NC4200: PostgreSQL & pgAdmin3, GIMP too.

I've installed Gimp graphic manipulation program. There was quite a lot of dependencies but luckily I'm using the same machine to manually download each one of it. After installation, I opened a new wmii workspace and hit [Mod]+[P] to open the program list. Then just type "gimp" then hit "Return". Wallah!, Gimp is running fine. Although I don't think I'll be using it anytime soon, but heck, might as well just install it.

Few days back, I installed PostgreSQL RDBMS. never got the chance to test it until now. As there's no other PostgreSQL user (except postgres) added since the installation, I got problem trying to access the database. As I'm currently lazy, I installed pgAdmin3 using OpenBSD package. Installed all the dependencies needed and down to testing.

I opened a new wmii workspace, eg: press [Mod]+[1-0]. Then on the blank workspace, I hit [Mod]+[P] to open the program list. After that I just type "pgadmin3" and the program starts. After I connect to the database, I create another role with my user id: "karl". I set the password and then I try to log in using the new PostgreSQL ID. So far so good. Why bother with psql when I already have pgAdmin3? Well, it's better if I play with both.

Now to re-learn PostgreSQL. Yum!

Wednesday, January 06, 2010

OpenBSD NC4200: Current experience status.

I have to make do with the version 2.5 of Alpine email software. My port system also have the same version, but I read somewhere that OpenBSD have stable version of the port system which includes version 2.7 (latest) of Alpine. As I'm still having problem with the darn proxy connection, I can't do anything with that. So that's my goal fer now, solving the proxy connection issue.

A few things I noticed about running OpenBSD with this Compaq NC4200 laptop:

The quicklaunch button:
- Mute button is working fine, I tried it with mp3blaster and it mutes/unmute the sound perfectly. But there's no light indicating it.
- Increase/Decrease volume button is not working.
- mp3blaster uses the "<" & ">" keys to decrease / increase the sound volume respectively. Somehow the ">" key works fine, but to decrease the sound, I have to press the quicklaunch's decrease volume key THEN the "<" key to decrease the sound volume 1 step. If let say, I want to decrease the volume from 100% to 60%, I need to press the quicklaunch key then the "<" key and repeat that until the volume goes down to 60% or something. Will find out about it later.

WiFi On/Off button:
- Works fine. It can turn on/off my iwi0 device just fine albeit without a functional indicator light. I read somewhere that the button will also turn the Bluetooth module on, but didn't check on that yet.

Others:
- I have problem when using shutdown -hp. Most of the time, the shutdown sequence will stuck at "Synchronizing disk ...." and I have to hit the shutdown key sequence or press the power button. If I use shutdown -r or just shutdown -h, it works just fine. The "power down" option for shutdown sometime will work but most of the time will have problem. I'll find an answer later.

ToDo:
- Find a way to solve the proxy connection issue. Many of my current problem can be solved if my machine (not just Firefox) can properly connect to the internet through proxy.

Later then.

Tuesday, January 05, 2010

OpenBSD NC4200: Ports system up, but still having proxy problem.

Installed the OpenBSD's port system but still having problem to connect via proxy. Darn proxy! So the only thing that can connect to the internet is my Firefox. AHHHH!

OpenBSD NC4200: Problem with calcurse.

Ughh. Found that there's a fatal bug in the installed calcurse. My box hanged after I tried to alter the "Notify" function's configuration. As stated in the program's news section, there's a bug in notification in version prior to 2.6. The version I installed from package is 2.5. Ouch. So now I have to install it from ports now. Hopefully OpenBSD's port system is not that different from FreeBSD's port system. Later

OpenBSD NC4200: Searching for ncurse calendar program.

I installed VLC media player just now. Installation went ok though there's quite a lot of dependencies I had to tackle. Luckily I retrieve the file using my OpenBSD machine so no more transferring packages using 2 machines. Oh well still have issue with my proxy connection, so pkg_add can't be run directly. Have to install stuff using a terminal, while using Firefox to download the data.

Currently I'm searching for calendar / reminder program which uses curse, looking at calcurse and wyrd (which uses remind, a calendar / reminder software). Not sure which is the best so I guess I'll try both and see. I love to know what other OpenBSD user out there use to manage their schedule etc.

Update: Oh, I went for calcurse. No dependencies, small, so it's great. Now to play with it. Later!

Monday, January 04, 2010

OpenBSD NC4200: Email with Alpine & can I have Magic Set Editor in my box?

Hi again.

I've installed Alpine and it's nice! Sent few emails and it's working fine. Haven't set my email add inside it yet but it'll be soon. So far my OpenBSD box is great! Really love the wmii and the other stuff I installed so far.

Oh yeah, I tried installing Magic Set Editor software, a program for Magic: The Gathering player/collector (or newbie, like *cough*me*cough*). There's linux port there but currently I'm having problem installing the darn script. I'll try and find an answer later.

Oh, speaking of Magic: The Gathering (MTG), I was sold to it a few days ago and currently building my Zendikar's set. I know the Comic World (or something) in MidValley sell the stuff so yesterday I went there and the friendly staff there welcomes me to (inofficially) join the club. Yeah!. Still haven't play my 1st game though, needs to build up my deck first. The shop also have single cards for sale (at used price, very cheap) and I got meself quite a bunch yesterday. Later!

6.5 amd64: Modify existing certbot certificates.

Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...