16 September 2008

Long Advertisements

Not many companies can afford super long advertisements nowadays. Its costs alot for airtime. Plus you really need compelling content to keep the audience interested.

This 2 minute advertisement from Nike which I saw prior to a movie which I think is great:



This 4 and a half minute advertisement from Microsoft, which was just launched, and is #2 in a series of ten, which I think is utter crap:



One makes you want to watch more to see how more interesting the ad can become (and it does!) while the other just makes you want to watch more to see how bad it can become (and that it does too.) One inspires and makes you worship the brand, while the other just makes you go "... meh?" One is young and exciting while the other is old, drab, out-of-touch and really patronising ("Traffic jam in my garage" - ouch!) One makes full use of the celebrities featured, while the other abuses the has-beens of celebrities. One is tight, well structured and coherent, while the other is rambling, confusing and irritating.

Surely with all the money in the world, they could have done better?

yk.

15 September 2008

Copy and Pasting between a remote Windows desktop and Linux client

If you need to Copy & Paste between a remote Windows desktop and your Linux workstation, use "Terminal Server Client" to access the host Windows XP/Server with "Remote Desktop" enabled.

In the Terminal Server Client, make sure that the Protocol selected is RDPv5. The default is RDP, which doesn't have the bells & whistles.

Once selected, copy and pasting is fully integrated between machines!

yk.

8 September 2008

Lotus Notes 8 and wrestling with attachments in Linux

A gripe about opening attachments in Lotus Notes 8 is that LN will fail silently, leaving the user guessing whether things are happening or not. If a user double clicks on an attachment, a dialog will pop up requesting if the user wants to "Open", "Edit", "View", "Save" or "Cancel".

Clicking on View for me gives a strange error: "Unable to create view: Device is disposed" and gives a whole load of eclipse errors in the details. I dont have the time to figure that one out.

So the next best thing is to "Open" the attachment. However that doesn't do anything, and LN fails to report that something has failed. The solution for this however is available here: "IBM - Attachments do not open from Lotus Notes for Linux Client when Open, Edit, or View is chosen in the 'Open Attachment' dialog" The trick is to remove IBM's own "openwith" program with whichever desktop manager you happen to install.

# sudo mv /opt/ibm/lotus/notes/openwith /opt/ibm/lotus/notes/openwith.old
# sudo ln -s $(which kde-open) /opt/ibm/lotus/notes/openwith


It works, but its amazing that we have to jump through these hoops just to open attachments!

yk

4 September 2008

Getting Aztech UM-3100 USB Modem to work on CentOS 5

Our old Hylafax external modems decided to kick the bucket over the weekend, and it was an opportunity to refresh the hardware. They lasted a good 9 years (or more!) and I dont think they make them anymore.

Additionally they had to be powered by large adaptors, which took up way too much room. So a good solution would be to use some USB modems; small, cheap, USB powered and easily replaceable.

We chose Aztech UM-3100 USB Modem. Relatively cheap at about RM70, we thought it would be a great solution. So I plugged it into the machine, and this was the dmesg output:

usb 1-2: new full speed USB device using uhci_hcd and address 2
usb 1-2: device descriptor read/64, error -71
usb 1-2: device descriptor read/64, error -71
usb 1-2: new full speed USB device using uhci_hcd and address 3
usb 1-2: device descriptor read/64, error -71
usb 1-2: device descriptor read/64, error -71
usb 1-2: new full speed USB device using uhci_hcd and address 4
usb 1-2: device not accepting address 4, error -71
usb 1-2: new full speed USB device using uhci_hcd and address 5
usb 1-2: configuration #1 chosen from 2 choices
drivers/usb/class/cdc-acm.c: Zero length descriptor references

cdc_acm: probe of 1-2:1.0 failed with error -22
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters


So not very good news to start off the day. This usb-modem isn't supported out of the box, fortunately it isn't too much a problem, but it does require a recompilation of the cdc-acm (USB Communication Device Class definition - Abstract Control Module). Here is a brief lowdown on how to get the Aztech modem recognised in CentOS 5.0.

Prepping the system for module compilation

First, we need to bring down the linux kernel source.

# wget -c ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-8.1.8.el5.src.rpm
Length: 48176889 (46M)
8% [==> ] 4,018,200 124.1K/s eta 7m 27s

It took only about 7 minutes to download. A "rpm -hiv" extracted the sources in /usr/src/redhat. You will then need to extract the source from redhats patches by doing this:

# rpmbuild -bp --target=$(uname -m) /usr/src/redhat/SPECS/kernel-2.6.spec

which should recreate the kernel source in /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686. Copy your config from the /boot directory to this directory

# cp /boot/config-`uname -r` ./.config

Now you are ready to compile the entire kernel ... if you want to. For me, I just want to compile the usb modem module, and not need to wait for the entire compilation process. But first, the modifications.

Adding support for the modem.

This ubuntu forum post "Shiro/Conexant (Rockwell) RD02-D400/Aztech UM3100 USB 56K Modem" provides the information to add support for the Aztech modem. First of all, we need to make sure that the ID as reported by lsusb is matches our modifications. To do so, type this:

# lsusb
Bus 001 Device 009: ID 0572:1328 Conexant Systems (Rockwell), Inc.


You will see that its 0x0572, 0x1328. This is what we will use in our modification. Modify the cdc-acm.c file:

# nano drivers/usb/class/cdc-acm.c

scroll down about 97%... put this in similar place, next to all the other devices
{ USB_DEVICE(0x0572, 0x1328), /* Aztech UM-3100 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
Save, and that's all with the source code modification. No big deal.

Compiling the specific module.

Instead of having to build the kernel and all the modules, we can tell 'make' to build from specific directories. First, you will have to compile some scripts which are used for MODPOST, which is important to make the .ko module files.

# make SUBDIRS=scripts/mod/
WARNING: Symbol version dump /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/Module.symvers
is missing; modules will have no dependencies and modversions.

CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
Building modules, stage 2.
MODPOST


Then you can actually build the modules which are of particular interest to you, in this case "drivers/usb/class"

# make SUBDIRS=drivers/usb/class modules
WARNING: Symbol version dump /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/Module.symvers
is missing; modules will have no dependencies and modversions.
Building modules, stage 2.
MODPOST
CC drivers/usb/class/cdc-acm.mod.o
LD [M] drivers/usb/class/cdc-acm.ko
CC drivers/usb/class/usblp.mod.o
LD [M] drivers/usb/class/usblp.ko


The file which you need is drivers/usb/class/cdc-acm.ko so just copy this to the real modules directory of your running kernel.

# cp drivers/usb/class/cdc-acm.ko /lib/modules/2.6.18-8.el5/kernel/drivers/usb/class

Loading up the new module

Unload the module if it was loaded before:

# rmmod cdc_acm
ERROR: Module cdc_acm does not exist in /proc/modules


And load up the new one

# insmod cdc_acm

To check that its there:

# lsmod |grep cdc
cdc_acm 15136 0


And now, plug in the Aztech modem, and see what happens:

# dmesg
cdc_acm: no version for "struct_module" found: kernel tainted.
cdc_acm 1-2:1.0: ttyACM0: USB ACM device
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters


Congratulations, it looks like its been recognised as ttyACM0

Testing the modem

Make sure you have the 'cu' utility installed. It usually comes in the 'uucp' package:
# yum install uucp
Once 'cu' is available, use '-l' to speak directly to the line.
# cu -l ttyACM0
Connected.
You can then reset the phone, and try to call out.
atz
OK
atdt9,012xxxxxxx
(9 is to get a dialtone from my PABX, and the comma is to wait).
Also test the modems ability to auto pickup after 1 ring with this command
ats0=1
However Hylafax controls the pickup process, so make sure this is not set. Reset the modem with this:
atz
And quit from 'cu' with this tilda command:
~.
Disconnected
Conclusion

Your Aztech modem should be recognised by the system even after a reboot (test it, its the only reboot you'll need to do). You can now plug in more USB modems to cater for your Fax server's needs.

yk.

Mutt - forwarding attachments automatically

Some little tricks with mutt again. By default mutt doesn't forward MIME attachments in the email, and it previously involved a laborious process of saving each file (in the current directory) and reattaching the file (from the users mail directory, which involves traversing the directory structure). So a quick google solves this issue entitled "How do I forward a message including attachments?"

In your ~/.muttrc file (create it if it isn't there already), add these two settings:
 set mime_forward=yes
set mime_forward_rest=yes
Done. Less hassle.

yk.

2 September 2008

Woah, buddy!

Check out these figures:

That looks like a series of numbers growing exponentially and spiralling out of control. I wonder what the deficits figures are?

yk.

28 August 2008

When you censor, you make people curious.

Silly MCMC. Dont they know that "censoring" a website via DNS blackholes is the lamest way of blocking it? I mean if they wanted to really censor, then deny all traffic into Malaysian backbones. Do it properly.

Instead they just told ISPs to blackhole entries to malaysia-today.net. Circumventing this is really easy, either by direct IP, or changing DNS server to any other foreign one, or having other people "mirror" the IP addresses.

Now we, the Malaysian public, know that someone doesn't want us to read the ramblings of RPK. Instead now RPK gets the credibility. Now there is more of a suspicion that what he is writing is hitting a nerve.

So shame on MCMC, shame on the people who authorised this, and shame on the ISP who bowed to this directive.

Don't they know that whenever you try to ban something, the desire for people to want to read it increases? duh.

yk.

14 August 2008

My Ten Commandments

A good set of commandments to live by:


  1. Thou SHALT NOT believe all thou art told.

  2. Thou SHALT seek knowledge and truth constantly.

  3. Thou SHALT educate thy fellow man in the Laws of Science.

  4. Thou SHALT NOT forget the atrocities committed in the name of god.

  5. Thou SHALT leave valuable contributions for future generations.

  6. Thou SHALT live in peace with thy fellow man.

  7. Thou SHALT live this one life thou hast to its fullest.

  8. Thou SHALT follow a Personal Code of Ethics.

  9. Thou SHALT maintain a strict separation between Church and State.

  10. Thou SHALT support those who follow these commandments.



yk

12 August 2008

IE6 on Linux ... why?!

Revamping a website to make it more CSS compliant, and getting rid of a whole load of <table> gunk. Playing with unordered lists and list items and tailoring the look with simple CSS is very addictive and somewhat rewarding. However this comes with a price, and its the Microsoft tax yet again. This time its a tax on my patience. Things just don't appear as they should on IE6, while Firefox, Netscape, Konqueror, Safari and Opera works perfectly. Considering that it still has about 30% market share (still way more than Firefox), it is a problem which needs to be addressed.

So to help me debug it without having to pull up a Remote Desktop, I had to install IE on my Linux machine. Eugh.

Fortunately the pain of installation was rather ... painless. IE4Linux has a great installation process which allows you to install IE5, 5.5 and 6 using wine and cabextract. The process is described here, and the screenshots looked like this:

It took about 7 minutes to download the CABs and run through the installation. The binaries are kept in a ~/.ie4linux folder. Running a user friendly symbolic link from ~/bin/ie6 displays ie in all its glorious splendour:

"Master, It Lives!"

yk

28 July 2008

Barcamp

BarCamp was held in Kuala Lumpur for the first time over the weekend. I didn't expect much of it, thinking that it would be a lame attempt to for pseudo web2.0 wannabes to 'network'. I was pleasantly surprised, as at the end of the first day it was encouraging to see a good sharing community growing here OTHER than the MyOSS one.

Ditesh volunteered me to speak a month back, and I thought I had ample time to prepare a presentation. I left it really late, and only started work on the presentation 2 days prior. I drew up a rough mind map on things worth talking about regarding the 2 year story of OpenMalaysiaBlog, and was figuring out how to present it. After all, a standard presentation with bullet points would have driven people insane, and a steve-jobs type one takes way too much time in preparation and rehearsals, and would severely limit audience interaction.

So the best thing I figured was to present the big picture; the mind map itself.

I was asked during the presentation on how I created it. I said "Adobe Illustrator, of course!" This brought on boos and jeers, of which I said "... kidding, I used Inkscape; a Free and Open Source vector illustration program. The source file is in svg."

What I realy like about Inkscape is its a real quality software. It has never crashed on me yet. The output to png is impeccable. It has great blur effects which makes for good drop shadows. The gradient tool is useful and usable. I also found a hidden feature, which is to embed bitmap images within the svg. By default, images are linked from external files.

To present, I just used plain ol' Eye-Of-Gnome (EOG). You will need to make sure that you set the background to white or to a solid colour:
Whats good about EOG is that it worked really well with my eeePC's touchpad. The vertical and horizontal scroll edges worked smooth and consistent scrolling, and pressing Control and manipulating the vertical scroll allowed me to zoom in and out effortlessly. It was surprisingly easy to manipulate the touchpad standing up and infront of the few people in the room.

What I liked about the talk was the interactiveness, and there were at least 4 people in the room who were outspoken, which encouraged a robust discussion. We eventually ended up taking a significant amount of time talking about Software Patents, of which I was surprised that non MyOSS members were clued up on. As a bonus it was good to know that they too understood the dangers it mounted on software development both proprietary and open source, in Malaysia.

At the end of it, was a rendition of Bob Dylan's "For the times they are a-changing'" by our resident musician and GSoC personality, Raj Deelan.

Hasan explained that this song was featured in our first blog post at openmalaysiablog.com, and it represented the changing times we are currently experiencing. I apologised for the bad transcript which was projected, as I left out 2 verses of the song, which left the karaoke afficiandos in the lurch (Aizat, it was reported that they could hear you 3 rooms away). However I made sure that this verse was in:
"Come senators, congressmen
Please heed the call
Don't stand in the doorway
Don't block up the hall
For he that gets hurt
Will be he who has stalled
Theres a battle outside
And it is ragin'.
It'll soon shake your Windows (tm)
And rattle your walls
For the times they are a-changin'."
Well done to the BarCamp organisers, the two Daniels, Kamal Fariz and many others for holding a quite spectacular event which brought together a community willing to share.

yk.

Picture credits goes to Azman Saini's Flickr photostream. Thanks!

Small mentions of my talk by Ditesh
There were many questions from the audience, most seemed to be awed by the level of dedication the OpenMalaysia people seemed to have put in to promote openness and transparency in Malaysia’s government ICT policies.
Yuen Chi
I liked how Yoon Kit's presented the stories in a mind-mapping-like diagram.
Yondie.
... how OpenMalaysia Blog got started ,how the reaction from .MY Goverment in Opensource. Yeah how the big company starts lobbying around ... IMHO, this is to ensure the future of country is control by our own wills not other.
Meng Wong
The opensource guys related the story of ODF versus OOXML; not only that, they whipped out a guitar and, in a slightly cheesy but earnest moment we sang "The times, they are a-changing."

14 July 2008

Biatch

Wow. Malaysia's very own Minister of Science Technology and Innovation (MOSTI) called his fellow constituent party within Barisan National a "political bitch".

"The worst kind of enemy is the one that is within," he said in a statement, noting the Sabah Progressive Party's "persistent flirting with the opposition to bring down the Government".

Maximus, who is also Science, Technology and Innovation Minister, said in doing so the party renders itself being viewed as nothing more than a political bitch.

I guess nowadays language like this is of the norm for Malaysian politicians, where 18SX words are exchanged on a daily basis. I wonder what it must be like to be a kid reading mainstream papers today. One would have to be exposed to words like sodomy, anal sex, rape, bugger, bitch, homo, etc, and have its explanations skirted around.

Why do they even bother with censorship then?

[ Malaysiakini also reports on this issue. ]

yk

17 June 2008

Midi to MP3 and abit of editing


My offspring loves watching Pocoyo, and I kinda like it too. Cute, mildly twisted humour and very entertaining. I learnt today that there is an Official Pocoyo Blog. Its very interesting, as it has news and information on the production of the series.

There is a blog entry entitled "Pocoyo Opening MIDI" - sure enough, they posted the midi file for the opening credits where Pocoyo introduces the characters with a few variations of the catchy theme.

I downloaded the midi, and wondered how I could make this a ringtone, for phones which dont support midi. Timidity was the solution.
# sudo apt-get install timidity
[Downloads about 29MB worth of stuff]
# timidity opening_pocoyo.mid -Ow -o poco.wav
It then displays a mapping of midi instruments, and warns if there are no appropriate instruments. For this case, I got 3 missing ones:

No instrument mapped to tone bank 0, program 11 - this instrument will not be heard
No instrument mapped to tone bank 0, program 108 - this instrument will not be heard
No instrument mapped to drum set 0, program 85 - this instrument will not be heard


you can then play the wav, but we are only halfway there. We still need to convert it to mp3.
# lame poco.wav poco.mp3
LAME 3.97 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), SSE, SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding poco.wav to poco.mp3
Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
1555/1555 (100%)| 0:04/ 0:04| 0:09/ 0:09| 9.2741x| 0:00
----------------------------------------------------------------
kbps LR MS % long switch short %
128.0 25.0 75.0 81.9 11.3 6.8
Writing LAME Tag...done


To test, mplayer can be used:
# mplayer poco.mp3
I then sent this file over to my phone, and its my new ringtone!

Instead of having the entire song, I used Audacity and extracted only the final part of the tune. I also used the "Fade In" effect to make it sound better. Audacity has an "Export" to mp3, which makes the lame part redundant.

yk.