Thursday, December 01, 2011

5.0 amd64 K43U: Firefox + gecko-mediaplayer + FlashVideoReplacer = watch streaming video inside Firefox!

Hi,

Maybe you guys knew about this far longer than me but this post is just a reminder for me. Anyway, here it is.

- Install Firefox
- Download and install gecko-mediaplayer from OpenBSD package.
- Search for FlashVideoReplacer plugin from Firefox's plugin website. Install that.

After FlashVideoReplacer plugin has been installed. There will be an icon on the top right side of Firefox. Click on it and go to Preferences. On the Replacement tab, I choose:

- Preferred method = embedded
- Plugin/MIME type = WMP (application/x-mplayer2)

Then enjoy streaming videos.

Just a while ago I managed to make a mess by configuring the mplayer plugin to use xv in "Right-click video > Preferences > Adjust Output Settings > Video Output". When I open videos after that, the screen is blank but there's sound. To make it worst, right-click does nothing so I can't go to the Preferences again. The solution? go to ~/.mplayer/ and delete the config. Opening another video will reset the settings. Later.

5.0 amd64 K43U: Current status.

Hey,

So far, this is my experience on running 5.0 amd64 using this K43U laptop. The list is what I consider as interesting and somewhat important.

Hardware:
1) Atheros (athn0) wireless works. Using kismet to scan for AP but I didn't test to connect to any yet.
2) Realtek (re0) LAN works like a charm.
3) Haven't tested suspend/resume yet. Soon I hope.
4) Sound works out of the box. Yum!
5) AMD Radeon HD 6310 is not yet supported. My widescreen LCD panel is on 1024x768 on vesa although it should be 1366x768. Still searching for tips on this.

Software:
1) Davmail 64-bit (using FreeBSD's package). Currently still testing as there's issue with java memory error.
2) Firefox works and now I can watch streaming video (youtube etc) inside Firefox! Using gecko-mediaplayer plugin and FlashVideoReplacer extension.
3) Thunderbird + enigmail works.
4) scrotwm using the source (0.9.34). Works great. No crashing on Thunderbird anymore.
5) conky have problem with ${addr} and multicore processor. Read about patch to fix it but I installed from package, not from port so no hope for me yet. Maybe in -current?

Later then.

5.0 amd64 K43U: Davmail crash with java dumping core, FreeBSD's package might be the saviour.

Hey,

As some of you know, I'm using OpenBSD primarily for work and I use my company's email address which uses MS OWA. So I use davmail so Thunderbird can retrieve my emails properly. You can search my blog for davmail settings.

I downloaded davmail-3.9.6 and I noticed that less than an 1, davmail will crash and there's java.core dumping. I have a hint that this might be due to 64 version of davmail is not available for OpenBSD and there's only linux's version which has 64-bit.

As this issue is critical, I need to make sure I resolve this as soon as possible. Downloading linux's 64-bit version is out of the question because I don't want any more mess. So I thought of doing an experiment.

I noticed that FreeBSD have amd64 version of davmail in their package system. FreeBSD, which used to be i386 system only have broaden their supported architecture by releasing amd64 version of their OS a few years back. Good news indeed.

I found davmail-3.8.4 package (*.tgz) for FreeBSD 8.2 which is ok as long as it will work. I do some comparison and found that this is what's needed for davmail to work. No installation needed.

lib/
davmail.sh
davmail.jar


There's some files inside the lib folder and only 1-2 files has changed since 3.8.4 to 3.9.6. So I extracted the *.tgz and copied that files into ~/davmail/. Using my previous davmail configuration, I'm now using the amd64 version of davmail meant for FreeBSD.

I'm just using it today, starting in just 1 hour and so far it seems to be working fine. It davmail can survive working hours today then it's great. For the package, you can download from FreeBSD or I can provide mine if needed.

Update!: Just as I published this post, the davmail crashed again. Here's the header of the error message:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 4361696 bytes for Chunk::new. Out of swap space?
#
# Internal Error (allocation.cpp:272), pid=11064, tid=8626964480
# Error: Chunk::new
#
# JRE version: 7.0
# Java VM: OpenJDK 64-Bit Server VM (20.0-b03 mixed mode bsd-amd64 compressed oops)
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#


Maybe it's java's issue. Hmm. I'll need to search for answers. Maybe install another version of jre or jdk. Anyone else have this issue?

Update 02/12/11 09:40:
I found that there's already a few 5.0 users which posted question regarding this java.lang.OutOfMemoryError issue and it affected different java based program like eclipse and netbeans.

Rewinding a bit, DavMail is run using davmail.sh script which resides in DavMail folder. Normally by default, the script contains:

# davmail.sh Ahmad Zulkarnain 2011
BASE=`dirname $0`
for i in $BASE/lib/*; do export CLASSPATH=$CLASSPATH:$i; done
java -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1


The last line tells the script to run DavMail. I tried to change the command to:

java -Xms512m -Xmx512m -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1

Note the bold text are the changes I made. But then I have this error:

/home/karl/davmail/davmail.sh /home/karl/davmail/davmail.conf
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


I even tried using only -Xms512m or -Xmx512m with the same error. So then after reading the java man page, I experiment with adding -d64 to force DavMail to run in 64-bit environment. So now the last line of davmail.sh looks like this:

java -d64 -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1

Now I tested that one invoking sh ~/davmail/davmail.sh ~/davmail/davmail.conf without making it a background process so I can see the output in xterm. I tested that since my last post on the java.lang.OutOfMemoryError until the end of my working hour and there's no crash. *Maybe* DavMail is not stressed enough by then because mails are less in the evening. So today I'm testing the altered davmail.sh to see if it can survive until the end of my working hours. I will keep you guys posted on that.

Thanks to Daniel M for your comment, sorry I have to answer your question in here instead of the comment box but I'm still interested to know any java tips from you.

Update 02/12/11 11:49:
Ok it crashed again. Still have the java.lang.OutOfMemoryError and java.core dump. But at least it's not as fast as yesterday. I managed to get more than an hour of emailing done. So I need to search for more answers. Later.

Wednesday, November 30, 2011

5.0 amd64 K43U: dmesg!

Hi,

Here's the dmesg for K43U. Take note that I've upgraded my machine with 8Gb RAM. Yum!



Later then. Yeah I know I've not yet completed my installation's experience...

Tuesday, November 22, 2011

Garuda is yet again no match for Harimau Muda. Hurray for Malaysian Football Team!

Heyya!

I'm still excited because our Harimau Muda football team has won the SEA Games gold medal for the 2nd time in a row!! Hurray! Although the team has been provoked, our national anthem disrespected by the home crowd, BUT STILL WE"RE THE CHAMPION! The team fought Indonesia in quarter final and in the final, at Gelora Bung Karno's stadium, the so-called "stadium keramat" for the home team BUT WE BEAT THEM TWICE! YEAH!.

The "ganyang Malaysia" provocation ignited during the SEA Games football campaign didn't destroy the team's spirit. Instead of respecting other nation's culture, some of the home crowd choose to be rude and childish. Oh well, you get silver medal for that. Good on you.

For Harimau Muda and Harimau Malaya, keep up the great effort and superb performance. We'll always support you (as long you guys can cope with criticism that is :). You guys deserves the gold medal, and the sweet memory of beating Garuda on their own turf.

As for Garuda, good show. Can't say the same for some of the supporters though. Enjoy your silver medals. With all the courtesies of the referees, you guys earned it. Doping Check while Harimau Muda is still celebrating and haven't even received their medals yet? Wow that's too unprofessional.

Oh while I'm still on football here, remember AFC Cup. Heh. Later.

Monday, November 21, 2011

5.0 amd64 K43U: Dual booting OpenBSD 5.0 AMD64 with Windows 7 x64.

Hi,

Ok. Now's the time some of us has been waiting for. I'll write up the experiences in configuring dual-boot environment of OpenBSD 5.0 AMD64 and Windows 7 x64 on my Asus K43U AMD Vision's laptop. I might write this in parts, or even put it all in this 1 posting.

Previously I wrote a bit about my K43U laptop and a bit about the specification. I have a large hard disk, 500Gb so I made my mind to dual boot this laptop with OpenBSD 5.0 AMD64 and Windows 7 x64. OpenBSD will be my work environment, and Windows 7 will be for gaming stuff. Now on to the experience.

1) Preparations
Ok first of all, install Windows first. On my K34U, I have 3 partition on my 500Gb drive. The first partition is Windows's reserved for something that I don't know of, whatever to make the OS happy. Then the 2nd partition is for Windows 7. The 3rd partition is for OpenBSD 5.0 AMD64. Make sure the important files in Windows 7 is properly backed up, as I've learned on the hardest way possible. More on this in a moment. Here's how I divide the hard disk.

None = System Reserved = 100Mb
C: = Windows 7 = 270Gb
None = OpenBSD 5.0 AMD64 = 195Gb

After hours of installation and updating Windows 7's driver to make it workable, my Windows 7 environment is installed. I used MS's Computer Management > Disk Management to create the free space for the would be OpenBSD into a raw partition without any filesystem format inside.

With the OpenBSD's CD inside, I rebooted the machine and for K43U, I need to press [ESC] key during the ASUS logo to choose the boot device. Then I choose my DVD drive to boot the OpenBSD CD. Then the lovely OpenBSD boot screen appears.

OpenBSD then asked me to choose either to (R)epair, (I)nstall or (U)pgrade, I choose [I] for installation.

After that the setups for root user/pass, configuring re0 for network and adding another user for the system. It's all the easy parts.

Then OpenBSD asked me to either "use the (W)hole disk or (E)dit the partition". It's the fdisk *gasp*. I just remembered and my last dual-boot exercise is on FreeBSD which is a long time ago! Ah. People says that curiosity kills the cat and mine killed my Windows 7 partition as I thought pressing [W] will give me a preview and there will be a confirmation afterwards asking me to confirm to use the whole hard disk. Well remember this well people. IT DOES NOT!. Once you hit the [W] key, OpenBSD will proceed with rewriting the MBR and it will be nearly impossible to recover your Windows installation. Well some said it's nearly impossible, but me, I never managed to get it back! I had to reinstall Windows 7 and start again. So do keep this in mind.

So I carefully hit the [E] key (remember next to the [E] key is... the [W]!!) so I can edit the partition manually. Here's a bit of it. Bold text is my input:

fdisk:1> e 2
fdisk:1> A6
fdisk:*1> q

So basically I told fdisk to use the 3rd slice (partition) of the hard disk (remember in *nix numbers starts with 0, not 1) and it's labeled as 2. OpenBSD needs A6 as the filesystem type so I set it. Then I just press [Q] to save changes and exit fdisk. Some pointer on the net stating that pressing [W] to write the changes in MBR is needed but I didn't do that. I might make you happier but currently this minimum steps are working fine for me.

After that, my partitions look like this:



Take note that the "*" sign on partition 0 means that I didn't make the new OpenBSD partition as active partition and retain Windows 7 partition as bootable. Well, this is because I'll be using Windows 7's own boot manager for dual booting. No need to install other boot manager software.

Now to partition the OpenBSD slice (Partition? Slices?). As usual, I starts with auto to see roughly how OpenBSD will partition my OpenBSD. And then I revert back to zero and do it manually. So I come up with this:

/ = 1Gb
swap = 2Gb
/var = 7Gb
/tmp = 4Gb
/usr = 18Gb
/home = the rest


Yours might be different so adjust it accordingly. I still think my swap is too big but as I have a bigger hard disk now, it doesn't matter much. Then proceed with OpenBSD installation. It took a while but no problem on the installation. Great.


2) Dual-boot preparation.

So the OpenBSD 5.0 amd64 has been installed. Before I reboot the machine, it's best to refer to http://www.openbsd.org/faq/faq4.html#Multibooting.

I proceed with creating the OpenBSD Partition Boot Record using the OpenBSD page for reference.

# dd if=/dev/rsd0a of=openbsd.pbr bs=512 count=1

After that I put my fat32 usb thumbdrive and copy the file "openbsd.pbr" into it.

Before rebooting, I changed the timezone so that the time in OpenBSD don't go off by 8 hours (Malaysian time). Text in bold is mine.

$ sudo config -ef /bsd
OpenBSD 5.0 (GENERIC.MP) #63: Wed Aug 17 10:14:30 MDT 2011
$nbsp;$nbsp;$nbsp;$nbsp;deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Enter 'help' for information
ukc> timezone -480
timezone = -480, dst = 0
ukc> quit
Saving modified kernel.


How did I get the "-480"? Because Malaysian time is +8 to UTC. So why was it -480? 8 x 60 mins = 480 mins. Because we're 8 hours in advance from UTC, we need to deduct the timezone about 480 minutes. Yours might be different so do make sure of it. dst is Daylight Saving Time which we don't use so it's 0. Oh yeah, make sure visudo is done appropriately so that we can sudo.


3) Configuring Windows 7 x64 to dual-boot.

Ok remember when I didn't change the active partition on fdisk back then? It's because we're going to reboot and let Windows 7 as the default boot (not for long though). I'll be using W7's own boot manager to dual boot OpenBSD amd64 and Windows 7 x64. As before, it's best to refer to OpenBSD's page on multibooting because I do.

Inside Windows 7, I moved the openbsd.pbr from my thumbdrive to C:\. Then I opened cmd (MS command prompt) as Administrator. Inside it, I typed the following. Bold text is mine and TAKE NOTE! I copied this from OpenBSD's page because there are details I didn't save.

C:\Windows\system32> bcdedit /create /d "OpenBSD/i386" /application bootsector
The entry {0154a872-3d41-11de-bd67-a7060316bbb1} was successfully created.

C:\Windows\system32> bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} device boot
The operation completed successfully.

C:\Windows\system32> bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} path \openbsd.pbr
The operation completed successfully.

C:\Windows\system32> bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} device partition=c:
The operation completed successfully.

C:\Windows\system32> bcdedit /displayorder {0154a872-3d41-11de-bd67-7060316bbb1} /addlast
The operation completed successfully.

C:\Windows\system32>



See the text in underline? That thing depends on your system. I didn't save what's mine so I copied from OpenBSD's page. Yours will be different so do take note of that. Now the machine has been configured to dual-boot between OpenBSD 5.0 amd64 and Windows 7 x64. The Windows 7 boot manager can be tweak.

That's all. I might be updating this post to reflect any other things I forgot to mention etc. Enjoy and later!

Friday, November 11, 2011

ASUS K43U: Review - Specifications, or sort of.

Hi,

Ok it's been a few weeks I'm using this ASUS K43U laptop. There's a few version of K43U laptop, with either AMD E350 (1.6Ghz x2) or E450 (1.65Ghz x2) processor. Mine is an E450 version. I know that link I gave you just state about E350 version, but ASUS is quite known for confusing website details/navigation. To make things worst, details for the laptop is insufficient and lacking. So I had to search for informations around that net. So far, this is what my K43U is made of:

Prosesor: AMD Brazos Dual Core E450 1.65ghz
Chipset: AMD A50M Chipset
Memory: DDR3 1333MHz SDRAM (8Gb Max), mine is 2Gb (urghh)
Display: 14.0" 16:9 HD (1366x768) LED Backlight
Graphic: AMD Radeon® HD6310
Storage: 500GB 5400rpm
Optical Drive: Super-Multi DVD
Card Reader: 4-in-1 Card Reader ( SD/ MS/ MS Pro/ MMC)
Camera: 0.3 Mega Pixel Fixed web camera
Networking:
Atheros AR9002WB-1NG Wireless Network Adapter
Bluetooth V2.1+EDR
Realtek PCIe GBE Ethernet
Interface:
1 x Microphone-in jack
1 x Headphone-out jack
1 x VGA port/Mini D-sub 15-pin for external monitor
3 x USB 2.0 port(s)
1 x RJ45 LAN Jack for LAN insert
1 x HDMI
Audio:
Realtek High Definition Audio
Built-in Speakers And Microphone
Speaker Altec Lansing®
Battery: 6Cells 5200 mAh 56 Whrs

It's not a high spec notebook, but to me it's impressive. Before I bought this laptop, I was considering a few other brands/models, such as Lenovo G475, Fujitsu LH520 and Toshiba C640. Yes all the models is AMD powered and no I won't consider buying intel.

My highest priority would be Fujitsu LH520 (spill proof keyboard!). But I searched everywhere for easy-payment solution and was left with only 2 options, the ASUS and Lenovo. Toshiba in the other hand, was hard to find. They have intel machines up for sale but the C640 is a rare beast. So, I went to ASUS. The K43U came with 2 years global warranty instead of Lenovo's 1 year so the choices aren't hard to make.

What I like about K43U now that I owned 1? Well, it's quiet. Comparing it with my previous machine, the NC4200; the sound of the CPU Fan on NC4200 is like a rock concert. I can barely hear the CPU Fan on this K43U. I have to really put my ear close to the laptop heatsink area to hear the spinning sound. Nice. The machine doesn't feel hot even when I tested a recent 3D game. The LCD is bright, in fact I think it's too bright and it makes my eyes tired easily. But the picture is nice. Very nice. The 1366x768 widescreen resolution is nice too. Graphic wise, it's amazing for an entry level notebook. Games which was struggling on my AMD 939 dekstop is playable in this notebook. Great. The battery life is also good for a 14" machine.

Now for the things I hate about the K43U. First, plastic. Feels like cheap plastic. Hello! Aluminium case please! Why only the intel/mac machines have it? Then the keyboard. The keys lack individual feels to it. I mean, it's just flat. Touch typing is a pain. I'm growing on it but typos are everywhere. Maybe in a few more weeks I hope. Also the keyboard have no spill-proof thingy (Fujitsu! Where are you?). There's no MS XP device drivers so I'm stuck with Windows 7 for dual booting.

Then the USB port's placement. I always use Optical USB Mouse and on NC4200, there's a USB port on the rear end of the laptop which I can use for the mouse so the cable is out of the way. On K43U, there's 3 USB ports, 2 on the left, 1 on the right and all near the front of the laptop. I ended up using the left USB port for the mouse because the right side is obstrusive. Although the K43U have Altec Lansing speakers, but the sound is lacking in bass. Musics just sounds so thin. It might be the Realtek's driver for Windows 7 x64 but I don't have other OS yet to test out the sound. Even using my trusty headphone won't make a difference. Edit: Ok the sound is good using my trusty headphone now. But the Altec Lansing's speaker on this laptop is just.. shame. Even my NC4200's single speaker sounded better.

Ok enough with the criticism. All in all, most of the things I hate about this machine is because of design issue and software stuff. Overall, I'm satisfied with this laptop. Still, I hope there will be a nice 15" AMD laptop with aluminium body. Yeah!

I've been dying to run OpenBSD AMD64 for a long time so this is a great opportunity. And because this machine have 500Gb of space, I opted to dual boot with Windows 7 x64. Of course, Windows 7 is for gaming and the rest will be in OpenBSD. I've readied OpenBSD 4.9 AMD64 when I noticed that 5.0 was already out early November. Sheesh!.

Currently I'm still preparing the Windows 7 environment. It's taking quite some time with the driver's updates, system updates, additional software download bla bla. I would've gone back to XP x64 if the device driver for it exist! Hello ASUS! No XP drivers? Also I'm preparing the W7 for game programming environment because I want to try out game programming.

OpenBSD 5.0 will follow up as soon as possible. I'm missing scrotwm already. Later then.

Tuesday, November 01, 2011

Farewell NC4200, hi Asus K43U. OpenBSD 4.9 AMD64 here I come!

Hey,

I just bought myself a new laptop. It's as Asus K43U Series laptop with AMD Vision E450 processor. I have to admit I'm an AMD fan so that's why I don't buy intel (my NC4200 was given to me, didn't bought it).

And so, I'm saying goodbye to my NC4200. It was a pleasure working with it. I'll put out a brief review of this Asus machine later.

Another good news, I'll proceed with OpenBSD 4.9 AMD64 version next! Yeah! I've been dreaming to try out AMD64 version of OpenBSD so this is the best time for it. Not forgetting to *finally* proceed to install 4.9. So expect me to write something about that soon enough. I've already prepared the installation media for 4.9 so it won't be long now. Later then.

Monday, October 10, 2011

10,000 page view. At last! Thank you very much.

Hey,

I know it's not that accurate because me viewing my own blog also will be counted, but heck, 10,000 views now!. Wow. I never thought that would be possible. Someone do read what I've posted. Thanks. This is really amazing. I'm very happy indeed. Thanks again to people out there.

Thursday, October 06, 2011

Steve Jobs is no longer with us.

As many would've known by now. Steve Jobs, ex-CEO of Apple Inc died peacefully on 5th October 2011. No one can deny his contribution to Apple especially and to all of us in general. For sure, people will miss him.

Thursday, September 08, 2011

OpenBSD NC4200: Simple script for audio output swapping for scrotwm.

Heyya,

I've written a simple script to alternate audio out between my laptop speakers and phone out. This script is intended for scrotwm, but also can be used on its own.



As usual, feel free to copy this file and improve it. You can see by the Gist that there's 2 files, the first is .scrotwm.conf and the next one is audioout.sh (see the file name on bottom right of the embed).

The .scrotwm.conf is a snippet of configuration needed to make the script work with scrotwm's key binding. As you can see, I've set the key binding to Mod+Shift+a key. So whenever I press the key binding, the audio output will swap between speaker and phone out. Very simple. All I need to do is add the snippet to ~/.scrotwm.conf.

Then I need to save the 2nd file as audioout.sh and save it in /usr/local/share/scrotwm/. There's a few other default scrotwm's script inside there. Make sure the audioout.sh is executable, if not do chmod 755 or similar which is suitable for your environment. Then enjoy.

Previously I would need to manually mute/unmute both master and phone out as I sometime uses headphone. Now I can simply press Mod+Shift+a to swap between it.

Take note that this script can be used even without scrotwm. You just need to copy the 2nd file to your ~/ (home) and run it by typing ./audioout.sh or use another keybinding if available. Later.

Monday, September 05, 2011

OpenBSD: Setting up GIT to store my dotfiles.

Ok. So I'm on Git now. As I'm not on a programming project whatsoever, my Git is basically just to store (or maybe sync) my dotfiles. Also will be used for embedding any of the dotfiles according to my blog post.

As I'm using it on my company's network, which has a very restrictive firewall and I'm online through a proxy, this is what I did to get my Git working. Take note that I'm using GitHub and most of the references are contained there.

1) Install Git.
I installed the Git package.

2) Set up proxy environment for Git.
In xterm, I set the http proxy value. Take note that I have set up my http_proxy env in ~/.profile:

# git config --global http.proxy $http_proxy

3) Set Git to ignore SSL verification.
I have to set this option, you might not need to touch this. In my ~/.profile, I add the following:

export GIT_SSL_NO_VERIFY=true

4) Follow Github's guide for my first git. Enjoy.

The GitHub's website is very easy to follow. At no time I have successfully push my first commit to it. I will post more bout this after I commit my dotfiles. Later.

Thursday, August 25, 2011

OpenBSD NC4200: tmux + vim + xterm 256 color. Solved

Hurrah! I've found the answer. My scrotwm open up xterm with tmux instead of plain xterm. Just now I used:

program[term] = xterm -e tmux

To open new term with tmux. That's what causing the 256 color issue. Seems like opening tmux like that made the xterm not setting the correct $TERM. That's why if I open an xterm, then open tmux, the 256 color will look as it's intended. So I changed that to xterm -tn xterm-256color -e tmux so that the xterm will open with 256 color $TERM correctly. And it works! Here's my ~/.scrotwm.conf for your pleasure. Feel free to use it.



Do note that I don't use spawn_term = xterm anymore. Initially I changed that to open tmux automatically, but defining other than "xterm" value just don't work. Hitting MOD+Return just didn't open any xterm at all. So that's why I had to use program[xterm] instead. As long as it works.

And here's my whole ~/.profile. Do take note on the upper part of the file especially on the xterm & tmux bit.



As usual, use it if you want to. Later.

OpenBSD NC4200: tmux + vim + xterm 256 color.

Sorry I have to delete my previous post. Surely that was a bit hurried. I should've tested more on the 256 color issue with tmux + vim. Ok, first of all, let's rewind back a bit for the history.

This is the scenario.

My vim's 256 color theme just got the wrong color in tmux than in regular xterm. I have set up MOD+Return in scrotwm to open up tmux inside xterm. When I use that, there's color but my wombat256 theme for vim is very different. If I open xterm, then open tmux, the theme will look as it should be. So I know this have something to do with $TERM env, and I'm searching the man for answer. I will post my ~/.profile with relevant files after I can make vim 256 color work correctly. Later then.

Thursday, August 18, 2011

OpenBSD NC4200: scrotwm 0.9.34, no more crash.

Hi,

I wrote previously regarding a bug which core-dumping my scrotwm session (yeah they have a new site for scrotwm). I'm still on 4.8, being lazy to upgrade to 4.9 up till now, so I was left with the only option which is to compile scrotwm's latest version.

So I downloaded 0.9.34 version which is the latest. I put it *.tgz file to a temporary folder. Fingers crossed, this is the steps.

Create /usr/xenocara/ folder.
# mkdir /usr/xenocara
# tar xvzf scrotwm-0.9.34.tgz
# cd scrotwm-0.9.34
# make obj
# make depend
# make
# make install

That's all. If you don't create the xenocara folder, you'll get stuck in "make obj" command. So far there's no crashing when I'm using Thunderbird. Very nice! I didn't test CUPS yet will tell you later. Have fun and oh, Selamat Menyambut Ramadhan!

Wednesday, May 25, 2011

OpenBSD NC4200: Burning DVD using USB DVD-RW.

Ahh, My anime is screaming to be put into a DVD as my disk is nearly full. So I have an idea to write an entry for this blog-o-mine. Writing DVDs.

My laptop doesn't have optical drive built in. So I'm using the USB DVD-RW drive. The dmesg for the usb drive is:

umass0 at uhub0 port 3 configuration 1 interface 0 "Hewlett Packard USB Multibay IDE 2.466" rev 2.00/2.46 addr 3
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
cd0 at scsibus0 targ 1 lun 0: SCSI0 5/cdrom removable


As for the software needed, the minimum is:

cdrtools-2.01p1
dvd+rw-tools-7.0p0


cdrtools contains mkisofs for writing CDs and dvd+rw-tools contains growisofs for writing DVDs. To ease my DVD burning project, I also installed:

tkdvd-4.0.9p0

Basically for DVD writing, growisofs is quite the standard for it. It's command line so customization is great. But I'm using TkDVD which is "a GUI for dvd+rw-tools and cdrecord/cdrkit. It allows burning DVD+R/RW, -R/RW, and CD-R/RW discs easily.". But while using the program, you can still see the command line it's using to burn the DVD.

First, I make sure that my user is in the operator group.

In /etc/fstab, mounting the drive would be using /dev/cd0a, but for writing disk it is /dev/rcd0c. By default, the /dev/rcd0c is set to crw------- which is Read/Write for root only. So I need to allow operator group to read/write the device.

# sudo chmod g+rw /dev/rcd0c

So now the operator group can write to the device. Now to perform the burning. I inserted the DVD disc, no need to mount anything. Then fire up TkDVD.

TkDVD's gui will appear, which is very user friendly. I left all of the options intact except for the DVD size. Choosing all the *.mkv and *.ogm files I wanted to burn, I make sure the Burning device: is set to /dev/rcd0c. Then I write the Volume name: to the name of the disc I want it to be known and hit the Burn button. I can also review the command TkDVD is using to burn my DVD in Command: field. Writing initiated and when it's done your DVD disc will be ejected. Easy! Later then.

Monday, May 23, 2011

OpenBSD NC4200: Upgrading 4.8 to 4.9. Soon.

Heyya,

I'll try upgrading my machine to 4.9 soon (aka when I feels like it..). My method will be via CD and the OpenBSD' Upgrading howto. Later.

Monday, April 04, 2011

OpenBSD NC4200: .profile script for easy Celcom 3G dialing / disconnecting.

Ok. I'm still testing to get auto proxy setting script. But in the mean time, you can copy and use this simple script to dial/disconnect your Celcom 3G. Feel free to alter the script if you use other telco. I put this one under my ~/.profile, but you can also create a file, paste the script and chmod the script executable.

# This is to dial celcom3g
function celcom3g {
 # Some internal functions
 function celcom3gConnect {
  sudo ifconfig ppp0 create
  pppd call celcom3g
 }
 function celcom3gDisconnect {
  pkill -9 pppd
  sudo ifconfig ppp0 destroy
 }
 # Dialing function
 if [[ $1 = "connect" ]];
  then
   echo "Connecting to Celcom3G...";
   celcom3gConnect;
 elif [[ $1 = "disconnect" ]];
  then
   echo "Disconnect from Celcom3G...";
   celcom3gDisconnect;
 elif [[ $1 = "restart" ]];
  then
   echo "Restarting Celcom3G connection...";
   celcom3gDisconnect;
   celcom3gConnect;
 else
  echo "Usage: $0 [connect|disconnect|restart]";
 fi
}


So if I want to dial to Celcom 3G, I just type celcom3g connect in the console, celcom3g disconnect will disconnect the connection and celcom3g restart will disconnect and connect. Currently celcom3g restart doesn't work properly as I need to implement some pausing after disconnect before reconnecting. So, for the time being, to restart the connection, I disconnect, wait a few seconds (until the USB modem light stop blinking) then connect. I'll update this post with other enhancement if I found any. Also, make sure your pppd script is named celcom3g in your /etc/ppp/peers/ folder. Find my previous post regarding this. Enjoy. Later.

Tuesday, March 29, 2011

OpenBSD NC4200: Using Celcom ZTE MF190 USB Modem.

I just registered with Celcom Broadband with no contract. Received a ZTE MF190 USB modem with sim card and working fine in XP. As usual, making it work in OpenBSD is the goal. OpenBSD's umsm listed a few ZTE USB modem as supported USB 3g modem but currently using cu -l cuaU0 will just display "Connected" and hangs there. Tried using cuaU0 to cuaU2 with no avail. I've posted a question in misc@ and a guy have replied and forwarded related emails regarding ZTE USB 3g modem. Thanks for that!. It seems that this type of USB Modem share similar properties as a supported ZTE modem, so no patching is required.


1) Getting info about the USB Modem.
Here's the dmesg after I inserted the usb 3g modem.

umsm0 at uhub0 port 3 configuration 1 interface 0 "ZTE,Incorporated ZTE WCDMA Technologies MSM" rev 2.00/0.00 addr 5
umsm0 detached
umsm0 at uhub0 port 3 configuration 1 interface 0 "ZTE,Incorporated ZTE WCDMA Technologies MSM" rev 2.00/0.00 addr 5
ucom0 at umsm0
umsm1 at uhub0 port 3 configuration 1 interface 1 "ZTE,Incorporated ZTE WCDMA Technologies MSM" rev 2.00/0.00 addr 5
ucom1 at umsm1
umass1 at uhub0 port 3 configuration 1 interface 2 "ZTE,Incorporated ZTE WCDMA Technologies MSM" rev 2.00/0.00 addr 5
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, initiator 0
cd1 at scsibus1 targ 1 lun 0: <ZTE, USB SCSI CD-ROM, 2.31> SCSI2 5/cdrom removable
umsm2 at uhub0 port 3 configuration 1 interface 3 "ZTE,Incorporated ZTE WCDMA Technologies MSM" rev 2.00/0.00 addr 5
ucom2 at umsm2


Here's the usbdevs -v outputs:

Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
port 3 addr 5: high speed, power 500 mA, config 1, ZTE WCDMA Technologies MSM(0x0031), ZTE,Incorporated(0x19d2), rev 0.00, iSerialNumber P671A1CELD010000
port 4 powered
port 5 addr 2: high speed, self powered, config 1, USB2 Hub(0x6560), Cypress Semiconductor(0x04b4), rev 0.0b
port 1 addr 3: high speed, self powered, config 1, USB Multibay IDE 2.466(0x031d), Hewlett Packard(0x03f0), rev 2.46, iSerialNumber HH63MC0BLTC1
port 2 powered
port 3 powered
port 4 addr 4: low speed, power 98 mA, config 1, USB-PS/2 Optical Mouse(0xc03d), Logitech(0x046d), rev 20.00
port 6 powered
port 7 powered
port 8 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x8086), rev 1.00
port 1 powered
port 2 powered



2) Set up the logging environment.
I create /var/log/ppp.log file. Then I vim /etc/syslog.conf and add:

!ppp
*.*         /var/log/ppp.log



3) Testing using userland ppp.
So the logging part is done. Now to test the ppp environment. I found that /dev/cuaU2 is the working device for this. I tried /dev/cuaU0 but didn't work. /dev/cuaU1 on the other hand don't have Carrier Detect. Here's my ppp testing result. Bolded texts are my input:

# ppp
Working in interactive mode
Using interface: tun0
ppp ON karlaphp> set device /dev/cuaU2
ppp ON karlaphp> set speed 384000
ppp ON karlaphp> show physical
Name: deflink
State: closed
Device: N/A
Link Type: interactive
Connect Count: 0
Queued Packets: 0
Phone Number: N/A

Defaults:
Device List: "/dev/cuaU2"
Characteristics: 384000bps, cs8, no parity, CTS/RTS on
CD check delay: device specific

Connect time: 0:00:00
0 octets in, 0 octets out
0 packets in, 0 packets out
Overall 0 bytes/sec
ppp ON karlaphp> term
deflink: Entering terminal mode on /dev/cuaU2
Type `~?' for help
AT
OK
ATZ
OK
AT+CGDCONT=1,"IP","celcom3g"
OK
ATDT*99#
CONNECT 7200000


So basically interactive ppp is working, but I haven't got the chance to test my /etc/ppp/ppp.conf script thoroughly as I'm currently at work (yeah I do this at work...). But, for the pleasure of the eyes, here's my current /etc/ppp/ppp.conf script:

default:
 set log Phase tun connect
 set device /dev/cuaU2
 set speed 384000
 disable ipv6cp

celcom:
 set dial "ABORT BUSY ABORT NO\sCARRIER TIMEOUT 5 \"\" ATZ OK-ATZ-OK AT+CGDCONT=1,\\\"IP\\\",\\\"celcom3g\\\" OK \\dATDT\\T TIMEOUT 40 CONNECT"
# dial number are *99# or *99***1#
 set phone "*99#"
 set login
 set authname ""
 set authkey ""
 set timeout 0
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
 add default HISADDR
 enable dns


If I dialed to celcom, I'll get this warning:

Warning: 0.0.0.0/0: Change route failed: errno: No such process
Warning: ff01:6::/32: Change route failed: errno: Network is unreachable
Warning: ff02:6::/32: Change route failed: errno: Network is unreachable
Warning: ff02:6::/32: Change route failed: errno: Network is unreachable


But I was told (by googling) that it's just a warning and non-fatal. The 2nd to 4th warning is just mentioning about IPV6 so it's nothing.


4) Set up pppd for Celcom 3G.*hip hip, hurray!. hip hip, hurray!*
This is the final part. Instead of using userland ppp, I'll go for pppd. Do man both for informations. Ok for this, I will create 2 files. Here's the steps:

First I'll create and edit /etc/ppp/peers/celcom3g file. On my system, there's no /etc/ppp/peers folder so I mkdir it first. Here's what my /etc/ppp/peers/celcom file looks like:

/dev/ttyU2
debug
384000
noauth
noipdefault
ipcp-restart 10
ipcp-accept-local
ipcp-accept-remote
0.0.0.0:10.64.64.64
defaultroute
novj
connect "chat -v -f /etc/ppp/peers/celcom3g.chat"


Then I created /etc/ppp/peers/celcom3g.chat file. Here's what mine looks like:

ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "ERROR"
ABORT "VOICE"
ABORT "NO DIALTONE"
SAY "Calling Celcom3G...\n"
"" AT
OK ATV1
OK ATE0
OK AT&F&D2&C1S0=0
OK ATS7=60S30=0
OK ATS0=0
OK AT
OK ATV1
OK ATE0
OK AT&F&D2&C1S0=0
OK ATS7=60S30=0
OK ATDT*99#
TIMEOUT 45
CONNECT \d\c


Where the hell did I get the idea for all the AT commands?. Well, I took a peek at the USB Modem's log in XP. If you google for Celcom 3G ppp script, you'll most probably notice that I don't have the familiar AT+CGDCONT=1,"IP","celcom3g" command. Do I need it? For now, I don't think so, because I'm updating this while I'm on Celcom 3G! Using that chat script. Why don't I need it? I don't know, honestly. But it's working. You'll also notice that ATDT*99# means that I'm dialing *99#, if you want to use *99***1#, just replace that test appropriately. Oh, I almost forgot how to dial using pppd. First, I created ppp0 links:

# sudo ifconfig ppp0 create

Then dial using pppd:

# pppd call celcom3g

If your script is named other than celcom3g, replace the celcom3g to your file name. To check the log, use tail -f /var/log/daemon to see if there's anything weird, or if reading log files is one of your fetish. How to disconnect from the connection? I just use ps aux | grep ppp and then kill pid and finally ifconfig ppp0 destroy. Do search for scripts that simplifies it.

After I disabled my http_proxy, I can browse the net with no issue. So I set my Firefox to Use system proxy settings. Speaking of which, I need to find a way to automate turning on/off http_proxy depending on whether I'm in the office (proxy) or at home (no proxy). That'll be my next project. As usual, any tips is much appreciated. Later and enjoy!

Edit: I've replace /dev/cuaU2 to /dev/ttyU2. man 4 tty for more info.

Tuesday, March 08, 2011

OpenBSD NC4200: My .profile for TERM type. xterm-256color / wsvt25.

OpenBSD have 256 color support in xterm, which is xterm-256color. For console, setting the TERM to wsvt25 is better. Color will work but weird stuff will happen is you use xterm term type for console, such as funny scrolling while ls-ing, tmux behaving weirdly and other stuff. But is I use wsvt25 as my term type, mp3blaster won't work correctly, vim color scheme (I use wombat scheme) will display white background instead of the dark background. So, I have to set my .profile to detect the original term type and change it to the color version.

In console, the original term type is vt220, so I'll use wsvt25 for color but mp3blaster won't work correctly. In X, the term is xterm so I'll use xterm-256color instead.

I open up .profile and put the lines below.

# This is to check the TERM and change accordingly.
if [[ $TERM = xterm ]];
 then export TERM="xterm-256color";
else
 export TERM="wsvt25";
fi


Then my console and xterm will have appropriate color enabled. Later then.

Friday, March 04, 2011

OpenBSD NC4200: Apache + PostgreSQL + PHP5 + P4A. Another interesting project.

Ok this is my current project. I'm exploring PHP now and because I only have a little knowledge on programming PHP, I need to use some sort of RAD / Visual tool to start building PHP website fast. I read that P4A - PHP For Applications - PHP RAD Framework is one of the tool that can be use so I'm exploring that now. So I need to build a OAPP (OpenBSD + Apache + PostgreSQL + PHP) environment on my 4.8. I would love a pre-built stack for this but AFAIK, there's none for OpenBSD. It's not a bad thing though because manual installation is better for my brain somehow.

1) Setting up Apache
OpenBSD have a custom Apache 1.3 installed by default. There's also Apache 2 package but I'll just focus with what's already there. To get the Apache running I just edit /etc/rc.conf.local and add:

httpd_flags=""

2) Setting up PostgreSQL
I installed these packages:
postgresql-server-8.4.4
postgresql-client-8.4.4
postgresql-docs-8.4.4

After installation, you can see the brief steps you need to take to enable PostgreSQL. I had problem using su - _postgresql because I kept getting wrong password. After searching for answer, I found a way for that.

2.1) Set password for _postgresql
# su
# passwd _postgresql


Then after the password for user _postgresql has been set, I can finally follow the brief tips for starting up PostgreSQL (which can also be read at /usr/local/share/doc/postgresql/README.OpenBSD).

# su - _postgresql
# mkdir /var/postgresql/data
# initdb -D /var/postgresql/data -U postgres -A md5 -W


You can follow the rest of the steps contained inside /usr/local/share/doc/postgresql/README.OpenBSD. I also read somewhere on the net that I need to edit /etc/rc.conf.local and add this line:

postgres_flags=""

2.2) Set up phpPgAdmin
I installed phpPgAdmin-4.2.3 package which will also install core php5 packages. I had a problem trying to log in to phpPgAdmin using postgres id which has been created earlier. After googling for answer, here's the way to do that. Edit the file /var/www/phpPgAdmin/conf/config.inc.php. Then edit/add the bolded text.

// Hostname or IP address for server. Use '' for UNIX domain socket.
// use 'localhost' for TCP/IP connection on this computer
$conf['servers'][0]['host'] = 'localhost';

// If extra login security is true, then logins via phpPgAdmin with no
// password or certain usernames (pgsql, postgres, root, administrator)
// will be denied. Only set this false once you have read the FAQ and
// understand how to change PostgreSQL's pg_hba.conf to enable
// passworded local connections.
$conf['extra_login_security'] = false;


Then after that I can log in using postgres id and manage the PostgreSQL database. There's also pgadmin3 program which uses wxWidget, a GUI program to manage PostgreSQL database.

3) Install PHP5
As I wanted to try out P4A - PHP For Applications - PHP RAD Framework, the relevant PHP5 packages I installed is:

php5-core-5.2.13p0
php5-pdo_pgsql-5.2.13p0
php5-pgsql-5.2.13p0

Installation is straightforward and there's brief description on how to enable PHP5 support + testing out PHP5.

4) Set up P4A - PHP For Applications - PHP RAD Framework
http://p4a.sourceforge.net/ have the nescessary files for the application. I downloaded p4a-3.8.1.zip from the site, unzip the package and rename the p4a-3.8.1 folder to p4a. After that I move the folder to /var/www/htdocs/. When I open up http://localhost/p4a/ using Firefox, I can see the P4A page. I'm currently having problem viewing the hello_world sample page correctly and I'm trying to find some answer for that. This RAD program is made for linux but I noticed there's OpenBSD user using it too. So I guess there's a way for me to get it to work correctly.

5) Install NetBeans + PHP plugins.
I installed NetBeans 6.9 from OpenBSD's package. I know NetBeans still have weird character issue on compiling Java codes but I'm not using NetBeans to write Java program. Instead, I want to use NetBeans to write PHP codes. So after I installed NetBeans from package, I installed PHP related plugins. After that, I wrote the hello_world sample P4A code which is available in the P4A website and wallah! It's working. I've also linked NetBeans with PostgreSQL and it's working fine.

So far, all is ok. I'm studying PHP bits by bits, slowly as a serious hobby rather than serious work. One thing for sure, this is a start. Later.

Friday, February 11, 2011

OpenBSD NC4200: Editing .mkv file's subtitles. A fun project.

Well, this is basically a fun project. I have collections of anime and I was thinking about making Malay subtitle for some of it. Just for fun. I found that it's totally possible with OpenBSD. Here's the packages that I need:

mkvtoolnix-4.0.0
subtitleeditor-0.33.0p3
gstreamer-ffmpeg-0.10.11
x264-20100511
wordnet-3.0p4

mkvtoolnix have few programs that can manipulate .mkv files. I can extract subtitles from a .mkv file for editing purpose. Then there's program to merge the subtitle inside the .mkv file. There's also GUI for it which is named mmg.

subtitleeditor is a great subtitle editing program for .ass subtitles. It also has video preview panel in it. I had problem with subtitleeditor when it stated that I have missing H.264 decoder and I solved it by installing gstreamer-ffmpeg package. There's also error stating about missing audio decoder but I forgot the package I installed to solve it because I also installed gstreamer-plugins-bad-0.10.19p0 and gstreamer-plugins-ugly-0.10.15p0 also not forgetting x264-20100511. I use Subtitle Workshop in XP but subtitleeditor works great in OpenBSD and better at editing .ass subtitles.

wordnet is a thesaurus program. It's not required but I would like to check meaning of words so I can translate the existing subtitles better. As always, man is the best friend. Later then.

Wednesday, February 09, 2011

OpenBSD NC4200: Using Plantronics USB Headset.

It's been a while since I last post anything. My OpenBSD box is still running great. Yesterday I got a Plantronics USB Headset and I wanted to see if I can get it to work in my 4.8. When I plugged the headset, here's the dmeg:

uaudio0 at uhub1 port 1 configuration 1 interface 0 "Plantronics Plantronics USB Headset" rev 2.00/1.20 addr 3
uaudio0: audio rev 1.00, 10 mixer controls
audio1 at uaudio0
uhidev1 at uhub1 port 1 configuration 1 interface 3 "Plantronics Plantronics USB Headset" rev 2.00/1.20 addr 3
uhidev1: iclass 3/0
uhid0 at uhidev1: input=1, output=0, feature=0


Seems to be ok. Now to test the headset. For I change the symlinks for these files:

/dev/audio = from /dev/audio0 to /dev/audio1
/dev/sound = from /dev/sound0 to /dev/sound1
/dev/audioctl = from /dev/audioctl0 to /dev/audioctl1
/dev/mixer = from /dev/mixer0 to /dev/mixer1

Normally it can be done manually by using:

$ ln -sf /dev/audio1 /dev/audio

and using the same method for the other 3 devices. I read someone's post on the net and he provided with this simple script which I named chaudio.sh file.

====== chaudio.sh script starts ======
#!/bin/sh

p=$1

ln -sf /dev/audio$p /dev/audio
ln -sf /dev/sound$p /dev/sound
ln -sf /dev/audioctl$p /dev/audioctl
ln -sf /dev/mixer$p /dev/mixer

exit 0

====== chaudio.sh script ends ======

After I created the script, chmod it to executable and then just type:

$ sudo ./chaudio.sh 1

and all 4 symlinks got changed. Doing ./chaudio 0 will change the symlinks back to default sound.

I tried testing the USB headset using:

$ cat /dev/urandon > /dev/audio1

and I can hear sounds on the headset. But, here comes the unsolved (yet) part, using mplayer or mp3blaster will output the sound to the laptop's speaker. Drats. I'm currently trying to figure this out. Got something to do with sndio stuff I guess. Will update on this if I find anything interesting. If you know any tips for this, please share.

Update: I found out that my Plantronics USB Headset is faulty. It's wacko even in XP. Damn. Later then.

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.

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 ...