Haiya ala Solah

Friday, January 29, 2010

Random musings..

It seems I haven't written anything for quite a long time. In regards to tech, there wasn't much to write home about lately. I've tried out a bit of android programming (ok, actually only got to the point of running the SDK examples on the emulator.. :P), I've dabbled a bit more with django and learned how to create form generated from the models, and of course learned a ton of things about plone. Currently my focus is more on attempting to port PloneMeeting over to be used on Plone 3. Still learning a lot more about this. I'm very excited about Plone 4. It's fast and it runs on Python 2.6. And that's basically it for tech more the less.

Apart form that, the current state of the country is pretty messed up if you ask me. I can't talk about it without feeling depressed. So I'm not going write anything about it here. It'll make me even more depressed.

On a happier note, my new house is almost ready to move in. Just have to unpack and organize all the stuff which we just brought back from Sepang Putra last week. There was quite a lot of things not to like about the house at first, but after a new coat of paint, some fans, a new sink and some pipeworks, it's turning to be pretty sweet. I'm hoping to finally be able to sleep at my own house by next week.

I really should try to write more often. My ideas are just not flowing anymore now.

Oh and one more thing. If you are in an organization which needs an easy to use intranet where members can share information, upload files, mark events easily, do contact us (ie Inigo Consulting). Manage & share your organizational knowledge. For more information go to http://www.inigo-tech.com. And once I can get PloneMeeting to work, you can even manage your meetings in your intranet too. Contact us now.. :D

Friday, December 18, 2009

Happy new year...

Yesterday was Ma'al Hijrah marking the beginning of the year 1431 in the Islamic calendar. So with a new year comes new hope and a fresh new start. Even for my computer. I bought my acer aspire 4810tg a few month ago before the release of windows 7. Even then they already promised there will be a free upgrade once it is released. When I finally applied for my upgrade, found out that the software itself is free, but you still have to pay for the shipping (USD 18 to ship to Malaysia). I applied for it anyway. It arrived in the mail a couple of weeks ago but I was too busy then to actually do anything about it. But Alhamdullillah there's a bit of change in the pace of our work in Inigo and finally I've decided I've got enough time to risk it. And risk it I did. After making a full backup of my /etc, /var and /home directory of course.. :P

It took a very long time to upgrade to Windows 7. It was searching for incompatible software, gathering settings and things like that I guess. And after a whole night (well, I started after 10.30, and by 2 I felt I needed to sleep already, so it might have completed sooner but I wouldn't know.. :P) I finally have a fresh install of Windows 7 on my trusty Delorian (it's a timeline model ok.. that's the best name I can think of in regards to time.. >.< ). But after a reboot I realised something which I should have known but completely forgot "Windows overwrote the MBR, now no more grub..". Ugh, and I didn't have any arch linux cd handy. Had to download the iso. I did have a copy of Fedora 12 iso already though so I thought I'd try to install that. It stoped booting with an error and mentioned something about the hardware. I didn't write it down, neither did I bother to google it, so not sure whether it's just my machine of for aspire 4810tg in general. Anyhow, I tried to boot with the latest arch linux iso, also said there was a problem. It was starting to not look good. I downloaded an earlier version of arch and that one finally booted. So I was able to access my old linux partitions and all but I didn't know how to just configure grub. After around 3 hours of googling and trying various things (going into the grub console and all) I just gave up and said "What the heck, I've got a backup anyhow". So I did a fresh install of arch linux on my laptop... Completely clean install. :)

As you might have known already from my previous post, I've been on a minimalist streak for quite a while already. Using xmonad as my windows manager and even going so far as installing vimperator to control my browser completely by keyboard. So since I'm already pretty comfortable with that setup, I thought that "hey, why not dump gnome and try to have an installation without the WHOLE gnome thing". I mean I even use wicd (it has a pretty cool curses interface when you really need it) as my network manager of choice so I don't even need the networkmanager. But seriously, I don't intend to use xmonad completely. I only use it for work when I need to really be efficent. When I'm just slowly browsing and enjoying my computer, I like to slow down a little and doesn't really need all the efficency a full fledge keyboard bounded setup could give me. So after some deliberation, I choose xfce. So now I've got a super light desktop for play and a super efficent setup for work. Hohohoho.. and oh yeah, I've got Windows 7 (/me do a little chicken dance to the dismay of my fellow open sourcians.. :P).

Why on earth would I want Windows 7 you may ask when I've already got the best setup a man could ask for? Well... sometimes a man like to play games.. :P Yes, I only use Windows to play games.. :P Since I'm trying my best to be clean and since although I respect RMS very much I still think there is still such a thing as software PIRACY, I only play free games (at least till I can afford original ones.. :P). My favourite game currently, SOLDIER FRONT.. :D It's a pretty cool game, and if you decide to join in, look out for me.. jebat.. :D But sometimes I play extremely badly, when you see that please know that most probably that's my son playing using my account.. >.< (yes I know, I'm a bad father..)

Ok. That's pretty much what's new with me in this new year. So to all my muslim friends "Happy new year.. ". I'm looking forward to a great one insyaAllah, hope you are too.. :)

Wednesday, December 9, 2009

After all that, there is more...

I remember in my younger days when I actually had time to sit for hours and hours in front of a computer to play, just play, and had lots of fun. Some of the games that I still remember fondly is like the classic Digger, Doom (especially Doom 2), Monkey Island (1 and 2 was the most memorable to me), Days of the Tentacle, Full Throttle, Command and Conquer, Warcraft, Starcraft, Baldurs Gate, Outlaw, Fallout. I miss those days. Those easy times. Then it was a busy day if you only get to play for just 1 hour. And "balik kampung" was probably the worst time. You can't play for days on end.. :P

And I remember strolling around Imbi Plaza (there wasn't any Low Yat yet back then) and just looked around. I couldn't afford ANY of the things I adored back then but just being able to window shop made me quite knowledgable. Friends and family come to me for advice on what computer they should buy, or for this price what are the recomended specs. I barely know it now. I have no idea what's the latest and greatest graphics card, or CPU, much less their prices. Those were the days.

Now most of my days I'm pretty much stuck in front of a computer. Doing 'work'. And more of it. And once that is done, there's more where that came from. Living close by the seaside, I watch in awe at the waves and wonder "Maybe I should try to be a fisherman". When I said this to my wife, she just laughed and said I wouldn't last a day. The hard labour would probably kill me. I think she's right.

I love programming. Don't get me wrong. I love doing my work. But when I think about my 'work', I've been doing web based things for almost 4 years already. As long as there is any sort of data mining and manipulation involved I would say 'I could probably build you a web app for that'. I know python, php, html, css, javascript, ajax, mysql, zodb, apache and stuff but when I think about it, I barely know C anymore, nevermind java. I look at all the jobs on jobstreet and find that they want a 'java' programmer. If I had to learn it back, it'd be pretty quick, but who's going to beleive just someone off the street that he's that good? Maybe I'm just tired. Or maybe I'm just a little bored. But anyhow, I'm thinking of ways I could diversify more of what I do and know with a computer. Not just software but also hardware. Not just web apps but also stand alone application optimized for the desktop. Not just another day of 'work', but an expression of an artistic soul. Maybe...

Wednesday, November 18, 2009

xmonad settings

One thing that I did like about using gnome was that for most things, it was very discoverable. You click a few menus, try this and that. But with something like xmonad, it's much more configurable for sure but you certainly have to know your way around. So after seaching the internet, I've finally had a setup which I pretty much like. Here it is for future reference. For ~/.xmnonad/xmonad.hs:


import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

myManageHook = composeAll
[ className =? "Gimp" --> doFloat
]

main = do
xmproc <- spawnPipe "xmobar"
xmonad $ defaultConfig
{ terminal = "urxvt"
, modMask = mod4Mask
, borderWidth = 3
, manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
} `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
]

That will, amongs other things, make sure that gimp does not tile but stay float, it will start up xmobar, set my default terminal to urxvt, use the win key for meta (better than using alt since alt is used by most programs), logHook to create an output to be used by xmobar, make sure xmobar stay visible eventhough the screen is full of other programs, set win+shift+z will lock the screen with xscreensaver.

Okay, next is setting for xmobar. This is my ~/.xmobarrc:

Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, lowerOnStart = True
, commands = [ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Network "wlan0" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | %memory% | %wlan0% | %eth0% * <fc=#ee9a00>%date%</fc> @ %hostname%"
}

Ok. This will create the xmobar on the top 90% of the screen. Another 10% we want to reserve for trayer for our programs that require a system tray (eg Pidgin) if we use any. It display a few useful info, but I think on of the most useful ones is the date, and also the output from xmonad which would show what workspace you are currently on (very very useful) and also the title of the window you're currently viewing (not so useful but still nice to have).
Next is I want my urxvt to look nice. So here is the settings for my ~/.Xresources:

URxvt*background: #242424
URxvt*cutchars: BACKSLASH '"'&()*,;<=>?@[]{|}
URxvt*colorUL: #86a2be
URxvt*foreground: #ffffff
URxvt*geometry: 80x25
URxvt.cursorColor: #86a2be
URxvt*internalBorder: 0
URxvt*jumpScroll: true
URxvt*loginShell: true
URxvt*perl-ext-common: default,matcher,searchable-scrollback
URxvt*pointerBlank: true
URxvt*saveLines: 4000
URxvt*secondaryScroll: true
URxvt*scrollBar: false
URxvt*scrollTtyKeypress: true
URxvt*scrollWithBuffer: true
URxvt*termName: rxvt-unicode
URxvt*underlineColor: #86a2be
URxvt*urlLauncher: /usr/bin/firefox
URxvt*color0: #242424
URxvt*color1: #bf7979
URxvt*color2: #97b26b
URxvt*color3: #cdcda1
URxvt*color4: #86a2be
URxvt*color5: #d9b798
URxvt*color6: #a1b5cd
URxvt*color7: #ffffff
URxvt*color8: #cdb5cd
URxvt*color9: #f4a45f
URxvt*color10: #c5f779
URxvt*color11: #ffffaf
URxvt*color12: #98afd9
URxvt*color13: #d7d998
URxvt*color14: #a1b5cd
URxvt*color15: #dedede
URxvt*font: xft:Terminus:pixelsize=15

I found this in a Ubuntu forum. I changed the font to Terminus with size 15 though. Much nicer on the eyes not to have to squint so much trying to read a small font. Then finally to put it all together, I have this in ~/.xinitrc:

xsetroot -cursor_name left_ptr
if xrandr -q | grep -q "VGA1 connected"; then
xrandr --output VGA1 --mode 1024x768 --left-of LVDS1 --output LVDS1 --mode 1366x768
fi
trayer --edge top --align right --transparent true --width 10 --tint 0x191970 --height 12 --expand true --widthtype request --heighttype request --SetDockType true --SetPartialStrut true &
xscreensaver -no-splash &
xrdb -merge ~/.Xresources
exec ck-launch-session xmonad

Amongst other things it detect whether I have an external monitor connected and automatically make xrandr extend to that if there is one. It sets up trayer (using the 10% we preserved earlier). It starts up xscreensaver. It actually load the .Xresources (normally this would be done by the gdm, but since I'm not using the gdm so this is how you load it and finally it launches xmonad. Phew.. That's basically it. As long as this blog post hold up, I can reformat my machine and recover the settings which I pretty much like for xmobar and gang.

Disclaimer: None of these settings are my original. Some of them I've got from xmonad and xmobar faq's and tutorials, others I've got from other various pages on the net.

Saturday, November 14, 2009

argouml in xmonad

Recently a small window manager war broke out at the #archlinux irc channel. Not much to say about it because it's been done dozens of times already, but it did got me interested in trying out a tiling wm again. I've tried xmonad before and liked it quite a bit back then so I thought I'd give it another go. And sure enough I LOVE it.. :P Not having to touch the mouse (or the touchpad which is even worse) at all is a great feeling. You just want to go faster and faster. Then I fired up firefox and lo and behold, I have to use the mouse again. That's a cannot. So I installed the vimperator plugin. Now I can navigate and use firefox just like using my favourite editor.. :D

But of course that's just the beginning, I had to look for replacement for a lot of other software I normally use too. So now:
1. pidgin -> finch (ym client)
2. xchat-gnome -> weechat-curses (irc client)
3. evolution -> alpine (mail client)
4. exaile -> herrie (mp3 player)
5. nautilus -> mc (file manager)

Then I faced another problem. When I started out argouml all it showed was a grey window. Nothing, nada. No display whatsoever. I really thought I had to go back to gnome already. Then I did a bit of googling and finally found this at the awesome wm wiki (another tiling wm). Basically the problem is with jvm in a non-reparenting window manager. So to fix it, we can emulate another window manager which jvm thinks is a reparenting window manager. Just install 'wmname' (yes.. that is.. pacman -S wmname) and run:

$ wmname LG3D

And walah.. argouml running once again. Even though you close the terminal and start just argouml, it'll work. So far I'm loving this slimming down of my desktop, now if only I could start slimming down my own body.. :P

Saturday, October 10, 2009

foss.my is back

Last year it was awesome and now it's back again. Yes, I'm talking about the free open source software conference by the people for the people, foss.my, on 24th - 25th October at UCTI, TPM. This year with even more reasons for you to attend. Personally for me, just one reason is enough. RMS (Richard M Stallman) himself will be there. Yes sir, the legendary founder of the Free Software Foundation. The man responsible for liberating mankind from the shackles of propietary software to the freedom of free (as in freedom, not free teh tarik) software. He will be giving the opening keynote on the second day, 25 October. So don't miss it.

What other reasons you should come? There's no reason why you shouldn't. It only costs RM 20 for a barebone ticket. You don't get any lunch or t-shirt, but hey, if you just wanted to listen to great talks on free software, I think that's a great deal. Most probably would be too busy to have lunch anyway. And there's no one stopping you from bringing your own. :D

There's a line-up of great talks and activities all about sharing the free software love. And if you register before 15th October, you are even in the running to bring back a free (free as in free teh tarik) netbook. So what are you waiting for? Register now.

And I'll see you there.. ;)

Saturday, August 29, 2009

Virtual machines

I finally tried to give kvm a try on a core 2 duo laptop. And what great fun it is. :D
Following the instruction from the great arch linux wiki, I installed the qemu package. Once I've done that I added myself to the kvm group:


# gpasswd -a abdza kvm

And then I loaded the kvm & kvm-intel module:

# modprobe kvm
# modprobe kvm-intel

To change the new kvm devices to the kvm group I modified the udev rules (had to create the file) at /etc/udev/rules.d/65-kvm.rules:

KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"

I downloaded some cd iso's to boot install into the "virtual machines". First I tried ubuntu. Once the iso has been downloaded I had to create a virtual machine image with:

# qemu-img create -f qcow2 ubuntu 4194304

Not sure yet what all of that option is for but that basically would create an image named ubuntu with hard disk size of around 4GB. So I had to 'boot' that image with a cd (the iso image downloaded earlier):

# qemu-system-x86_64 --enable-kvm -hda ubuntu -m 512 -cdrom ~/Downloads/ubuntu-9.04-desktop-i386.iso -boot d -vga std -net nic,vlan=1 -net user,vlan=1

That would boot the machine with the cd "inside" it. It would run the live cd and allow you to install ubuntu on it and everthing. Then once it's already installed you can boot it without the cd with:

# qemu-system-x86_64 --enable-kvm -hda ubuntu -m 512 -boot c -vga std -net nic,vlan=1 -net user,vlan=1

Notice that the boot flag has changed to c. Now with the current `-net nic,vlan=1 -net user,vlan1` you will already get normal internet access from inside the virtual machine. But that virtual machine would not be able to access any other machines on your network and no other machines on your network can access your virtual machine neither. Reason being is that it is actually on it's own virtual network provided by qemu. I've read that you need to set up bridge and tun/tap to be able to make it appear on your normal network. Haven't tried it out yet. That would be for the next part.

Just a little side note. Whenever you click inside the virtual machine display, the mouse would be 'captured' by that machine. To release it like normal press ctrl+alt. That would release the mouse. Sometimes you might even like to view the machine full screen, to toggle that just use ctrl+alt+f.

Another small note, 4GB isn't enough to install Fedora 11. For that I created an 8GB virtual machine.

Another small note (my.. getting lots of small notes nowadays.. :P). To use sound in the 'virtual machine', add:

-soundhw all

to the options. Can even view and listen to youtube from a 'virtual' ubuntu.. :P