Planet MYOSS: The Malaysian Open Source Community Speaks


Speakers Wanted!

We need speakers for the meetup! Fill out this form and we will get back to you.


Open Web Standards By Zi Bin Cheah

Web Standards are crucial for everyone. Browser companies implemented standards by W3C into their software. standards allow technology-implementation to be unified and maintain a 'One Web' for everyone.

Web standards include JavaScript, HTML5, SVG, Canvas, SMIL and CSS3.

In this series, the speaker will give a run through of standards-development and demo some funky web standards technology.

About the Speaker

Web Evangelist in Opera Software. Malaysian in Scandinavia. Enjoys evangelizing about Open Web Standards - SVG, Canvas, HTML5, CSS3 and stuff.

When: Thursday April 2nd 7:30pm

For more details, visit http://foss.org.my/meetups ( Facebook )

Where:

MSC Malaysia Cybercentre - Incubation Centre (1B - 3-1), KL Central

We need speakers for the meetup! Fill out this form and we will get back to you.


muhd. zamripostfix can't connect to MySQL

I got this error in syslog when postfix was trying to connect to MySQL:

Apr 13 17:34:53 webmail postfix/smtpd[6726]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Apr 13 17:34:53 webmail postfix/smtpd[6726]: NOQUEUE: reject: RCPT from rv-out-0506.google.com[209.85.198.233]: 451 4.3.0 : Temporary lookup failure; from= to= proto=ESMTP helo=

I got a reference to MySQL database in my main.cf which triggered the error:

local_recipient_maps = mysql:/etc/postfix/sql-recipients.cf

From the error it was obvious postfix couldn't connect to MySQL. Email from outside wouldn't be received properly by dbmail. I checked MySQL service and it was running and I could log into MySQL manually. I found a solution after googling a bit. The cause was in file /etc/postfix/master.cf. I got smtp service of postfix to run chroot'ed (see y below).

#service type private unpriv chroot wakeup maxproc command + args
smtp inet n - y - - smtpd

So I changed the line to:

#service type private unpriv chroot wakeup maxproc command + args
smtp inet n - n - - smtpd


Voila!. It worked. See log below:

Apr 13 18:03:02 webmail postfix/smtpd[7039]: connect from rv-out-0506.google.com[209.85.198.239]
Apr 13 18:03:03 webmail sqlgrey: grey: domain awl match: updating 209.85.198(209.85.198.239), gmail.com
Apr 13 18:03:03 webmail postfix/smtpd[7039]: B3246A3075: client=rv-out-0506.google.com[209.85.198.239]
Apr 13 18:03:04 webmail postfix/cleanup[7042]: B3246A3075: message-id=23c8d5620904130314j7f4c619di57c7d8c0d217ed62@mail.gmail.com>
Apr 13 18:03:04 webmail postfix/qmgr[7033]: B3246A3075: from=, size=2277, nrcpt=1 (queue active)
Apr 13 18:03:05 webmail postfix/smtpd[7046]: connect from webmail.myfakedomain.net[127.0.0.1]
Apr 13 18:03:05 webmail postfix/smtpd[7046]: 26BBFA3076: client=rv-out-0506.google.com[209.85.198.239]
Apr 13 18:03:05 webmail postfix/cleanup[7042]: 26BBFA3076: message-id=23c8d5620904130314j7f4c619di57c7d8c0d217ed62@mail.gmail.com>
Apr 13 18:03:05 webmail postfix/qmgr[7033]: 26BBFA3076: from=, size=2751, nrcpt=1 (queue active)
Apr 13 18:03:05 webmail postfix/smtpd[7046]: disconnect from webmail.myfakedomain.net[127.0.0.1]
Apr 13 18:03:05 webmail dbmail/lmtpd[20480]: Message:[serverchild] serverchild.c,PerformChildTask(+349): incoming connection from [127.0.0.1] by pid [20480]
Apr 13 18:03:05 webmail postfix/lmtp[7043]: B3246A3075: to=, relay=127.0.0.1[127.0.0.1]:10025, delay=2, delays=0.96/0.01/0/1, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=01032-05, from MTA([127.0.0.1]:10026): 250 2.0.0 Ok: queued as 26BBFA3076)
Apr 13 18:03:05 webmail postfix/qmgr[7033]: B3246A3075: removed

April 13, 2009 06:38 PM


Bakhtiarpython, zope2 and twitter/oauth: oh my!

Getting python, zope2 and oauth to dance takes efforts. Understanding how OAuth works is essential. However, the oauth draft is too long for eager developers to grok. But fret not, read the quick and dirty guide to oauth and we'd be on our way. Here'weofije...

April 13, 2009 11:56 AM


Swee MengLinks for 2009-04-12 [del.icio.us]

April 13, 2009 07:00 AM


Mohd Irwan JamaluddinEvent: HP ProLiant G6 Servers Launch

My favourite x86 server, ProLiant G6 are already in town! HP has announced its availability last month and Malaysian are lucky because HP Malaysia will be organizing HP ProLiant G6 Servers Launch soon. While I was working as a system integrator, Proliant was our primary choice because it is easy to deploy, cost effective and [...]

April 13, 2009 03:48 AM


Swee MengHow to run a community project(aka what I learned from barcamp)

After slacking over the weekend. Here is a new post
This is what I learn during barcampkl, and have many part copied from barcampkl post mortem.

Barcampkl is in a way doing well. Of course it can be better. But this is not about blaming, nor it is just about barcamp. Here is a do and don't for a project similar to barcamp, probably hackerspace and other events as well?

Do:
  1. Accommodate a variety of audience, it one spice things up, and it opens up ideas. During barcampkl we have a variety of topic, and I have learn a lot, because of all the topic is new to me. We also miss out the tech community. We need to balance the audience.
  2. Provide sufficient infrastructure, during barcampkl we have enough room, which is a good thing, we have more input, and a place to hang out. We also have lousy internet connection, so hackathon didn't goes as plan. Also loud speaker.
  3. Give(take) roles and responsibility, even in a loosely structured hierachy like in barcampkl, we need to have one person to take responsibility. For example on the web contents, etc.
  4. Accountable, the big idea is, we need to know what goes on. Have a accounts that is viewable. It is also fair to people that contribute
  5. Keep a inventory, we have our own stuff, during barcamp, we bring own stuff, and also stuff that is sponsored. As In 4 we need to be accountable
  6. Have backup plan, during barcamp we are lacking in vga cables. It is better to be safe than sorry. 
  7. Give credit to where the credit is due, in the case of barcamp, give credit to sponsor. Of course other contributor
  8. Communicate a lot among members, we need to know what happens.
  9. Have a roaster.
  10. SHARE!!!! We have a slides on slideshare for barcampkl
Don't
  1. Commercialize an events, people is at events like this to learn. So marketing talk is bad.
  2. Make own decision, have a concensus. Don't change anything such as schedules. Most of the time anyway.
  3. Make some people do work, till it misses some session they want to join.

April 12, 2009 01:07 PM


Swee MengLinks for 2009-04-11 [del.icio.us]

April 12, 2009 07:00 AM


Colin CharlesHow I now drive a Hyundai Accent, thanks to a Google ad

About a month ago, I was surfing the Net, reading my mail on GMail, and I spotted a smart ad by Kah Bintang telling me in a short span of words (in the top — sponsored links in GMail - or it might have been a sidebar link) that the new Hyundai Accent 2008 model was a 1.6L car, with a very reasonable price tag.

Normally, I am blind to ads, but the message itself was very captivating, so I bit, and clicked the link. I arrived at the 2008 Accent Home, quickly jumped to its specifications, was impressed by its price tag (compared to the Toyota Vios S that I was driving, this car beats it in many ways), and brought it up in conversation.

Conversation, you ask? Yes, conversation with my parents. I was telling them it might be a nice car to have, it comes with leather seats, etc. Within a month, I hadn’t realised they had ordered it, and the car arrived early last week, and they handed the keys over to me - an early birthday present. Nifty. Thanks!

But that’s not the point. I would have never even heard of this car, had it not been for the Google ad. Someone at Kah Bintang, that’s in charge of marketing/gathering sales/et al, know that your Google ad, definitely works. In fact, I think the ROI is greater - imagine paying a blogger to write a review, versus actually running Google ads?

If you know the person from Kah Bintang responsible for this, don’t hesitate to have them call me, I’d love to interview them about their forward thinking nature. And I wish I took a screenshot of the ad itself — I can’t seem to replicate it now!

The Proton Exora


MIX fm :: lots of proton ads eh?

In other news, today I was listening to mix.fm. I heard them present some fun fact, and then, they tied it in with an advert for the Proton Exora. Smart, I’ve seen them do this with Harvey Norman ads before, but that’s just usually with discounts — the fact that with the Exora, they made some effort to expand my knowledge, then lead me back in, it did seem interesting.

Of course, going to mix.fm’s website, I seem to be a tad disappointed. There has got to be a better way to display ads, no?

April 12, 2009 05:00 AM


Low Kian SeongSum for the range of a column in Excel

Working on my current project, one requirement came out which made me all the more appreciative of django's nice array of built-in filters. I generated an Excel report for my clients which is generated from html. Good and nice. Then one of them said, hey can the Excel report have a row which outputs the sum of the whole column of say the column E? Something usual and easy in Excel but stumped me for a while of how to do it from html to excel. For the most part it was trying to figure out how to include that SUM formula at my html code.

A little visit to M$ support center got me the help I needed and then it was back to nice plethora of filters django has .... Turns out that you can include formula into a cell (or a table column in this case) by simply doing something like this '=SUM(E2:E70)' just after the opening tags for your column. This part actually took the longest for me as I did not really know how to do it correctly. My last row in this case was dynamic because it depended on the number of rows generated by my query. So all I did next was some little magicks like this ...

'=SUM(E2:E{{query.count|add:1}})', which takes the count of the results and adds one to it because Excel rows start from a 1 while the count function returns counts starting from row 0. Just something very simple. Don't really want to tax the brain during the weekends y'know ... anyway just a small thank you to django for really great tool box of useful built-in filters. You really made this post shorter than it ought to have been :).

April 11, 2009 08:21 PM


Yuen-Chi Lian"Autoboxing" Array is Illegal

Wrote some array methods today then I had a question about auto-converting an int[] to Integer[] (auto-boxing) while I was driving back home.

For instance, this works,
public static  V wrapper(V v, Class clazz){
return v;
}

int i = wrapper(1, Integer.class);

But this is not compilable,
public static  V[] wrapperArray(V[] v, Class clazz){
return v;
}

int[] i2 = wrapperArray(i2, int.class);

int.class will be auto-converted to Integer.class but int[] will not. I can't find the exact line in JLS describing this, do leave a comment if you could.

April 11, 2009 01:33 PM


Nuhaa All Bakry (cawanpink)Bitten by the bed bugs

Now I have a few small red dots on my arm, my legs and my neck. Not to mention they’re all so itchy. Isk. I had no idea where all this bugs came from, suddenly decided to attack me in one night and left me feeling so damn angry. They will leave scars, although I know over time it will disappear but still, I don’t like lah… Oh help!

The strange thing is it only happened last Thursday. I still slept on the same bed but it never happened again. Aaaaa bencik bencik! Gatalnyer nak garu jek tapi have to refrain self. Kalau tak nanti lagi teruk the scars… hisy!

Ok don’t want to dwell on it that much anymore. Things happened, have to move on. Now next topic: shopping! I want to look for a skirt and a blouse. I’m going to check out Envee in Alamanda if it’s any good. Adda, come lah set time after work we go to Nichii ok bebeh??

April 11, 2009 04:33 AM


Colin CharlesTwitterJobSearch, MySQL Job Fair

I heard about TwitterJobSearch on net@night, and decided to give it a twirl. I typed “mysql” and found 3,092 results in 30 seconds. You can then filter by job title, salary, skill set, job type, and more, as well as sort it by relevance or date.

Useful? Quite possibly. Would be more useful, if you could filter out Twitter users (like @itcareer, for example). Search that is semantic, instead of just word based. So “mysql in san francisco” will return relevant results for you.

If you’re looking for a job anytime soon, note that there will also be a Job Fair at the MySQL Conference & Expo 2009, happening April 20-23 2009, are you registered yet? Its a great place to network, and you shouldn’t miss it.

April 11, 2009 04:06 AM


Yuen-Chi LianStrange Maven Plugin Metadata Problem

Not too sure when, my Maven Eclipse plugin has been upgraded to 2.6 and probably due to some metadata "corruption", its dependencies were not downloaded, running it caused ClassNotFoundException:

[INFO] ------------------------------------------------------------------------
[INFO] Building Whatever
[INFO] task-segment: [eclipse:eclipse]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing eclipse:eclipse
...
-----------------------------------------------------
this realm = app0.child-container[org.apache.maven.plugins:maven-eclipse-plugin:2.6]
urls[0] = file:/home/yclian/.m2/repository/org/apache/maven/plugins/maven-eclipse-plugin/2.6/maven-eclipse-plugin-2.6.jar
urls[1] = file:/home/yclian/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8


this realm = plexus.core
urls[0] = file:/opt/maven-2/lib/maven-2.1.0-uber.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse': Unable to load the mojo 'org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse' in the plugin 'org.apache.maven.plugins:maven-eclipse-plugin'. A required class is missing: org/codehaus/plexus/resource/loader/ResourceNotFoundException
org.codehaus.plexus.resource.loader.ResourceNotFoundException

Tried running Maven with the -cpu argument but it didn't help. maven-metadata-central.xml showed the latest as 2.5.1 and others got 2.6. Fixed by deleting metadata files then re-run Maven.

Bah.

April 11, 2009 03:51 AM


Abdullah Zainul AbidinJoke's on you

I'm a Fedora ambassador, I recommend people to use Ubuntu, but I myself use Arch Linux. I'm not sure what that makes me.. :P But I love using Arch. It is lean, mean and geared towards the more tinkering inclined in the sense that almost everything is default and you have to hand configure yourself... with a text editor :D

So it was really sad for me last week to read that they are going to drop support for the i686. For a whole week I was contemplating which distro would I go to now? I really like Arch's way of a rolling update. Not waiting for a certain dateline but get the newest thing as soon as it's ready. But after reading that news I am concerned because I don't think my laptop support x86_64 (Haven't tried it yet though, but it's a really old laptop). And not only that, if one day I am fortunate enough to get myself a netbook of my own, I doubt those small atomic chips support 64bit either. So where should I go? My choice was 2. Fedora or Ubuntu. I haven't tried the latest (Fedora 10 and Ubuntu 8.10) but heard they have quite a lot of great new stuff. Fedora 10 even boots faster too. I'm still contemplating...

Then today I read this news. I was dumb struck. It's all an april fools joke? Wow.. they even mentioned about it in the forums and everything. I really thought it was real. But I'm glad it's not... :D So now I can be rest assured I can still use my favourite distro for quite a long while to come. I'm such an idiot.. :P Kudos to all the Arch Linux dev for pulling off such a convincing trick. And next time I'll be more careful to wait for a few days to confirm news heard on the 1st of April.. :D

So finally I guess the joke's on me.. :)

April 10, 2009 11:52 PM


Hisham Mohd AderisAdding local directory to apt sources.list

I faced this problem when trying to install the latest version of lyx, frontend for the famous LaTeX/TeX document processor. Lyx is available at the ubuntu main repo, but the version is kind of outdated. After checking at http://www.getdeb.net, a latest version is available. After downloading the lyx and lyx-common package from here, I tried to install both of them using "dpkg -i *.deb" but they have unsatisfied dependencies. One of the way to solve this is to download all the dependencies and put them inside one directory, and run "dpkg -i *.deb" but I think I wanna try another solution which is using apt to install them. This is where "Adding local directory to apt sources.list" comes into the picture. The steps will be explained below:

1. Create the directory to put all the deb files you downloaded, in this case I'll create /home/foo/debs
$ mkdir /home/foo/debs

2. Put all the downloaded deb files into the directory
$ mv /home/foo/Desktop/*.deb /home/foo/debs

3. Check the current priorities and section for the package, find entry named Section and Priority:
$ dpkg --info lyx_1.6.2-1~getdeb1_i386.deb

Here are some of the info:
Package: lyx

Section: editors

Priority: optional

Homepage: http://www.lyx.org/


4. Create override file. Override file is used to override the default priority and section setting of the package (refer to no. 3 for guide on how to check section and priority). Override file contains 3 columns: package, priority, section. Package is the name of the package, priority is low, medium, high or optional and section is the section to which it belongs.
Example of override file content:

## Override
#Package priority section

lyx low editors


5. Create Packages.gz inside /home/foo/debs
$ cd /home/foo/debs
$ sudo dpkg-scanpackages . override | gzip -c9 > Packages.gz

6. If you are too lazy to do the override file, you do not have to. Just change the "dpkg --scanpackages" command above to this:
$ cd /home/foo/bar
$ sudo dpkg-scanpackages . /dev/null | gzip -c9 > Packages.gz
If you follow this path, ignore step 4 and 5

7. Add this line to /etc/apt/sources.list
deb file:///home/foo/debs /

8. Resynchronize the package index files from their sources
$ sudo apt-get update

9. Install your application (in this case, lyx)
$ sudo apt-get install lyx


Apt will fetch the deb files from your local file directory also. Congratulations, you just created a local file repository in your own computer :)

April 10, 2009 04:18 PM


Khairil YusofWeb Design Tools

Recently had to do CSS work on Plone, and here are some tools I found usesful.

For general design work and comps, Inkscape works great for layout and vector work. Trusty GIMP is perfectly fine for working on bitmap editing.

CSS, though I had to use a combination of tools, mostly I used Firefox with some addons:

  • Firebug You'll needs this to inspect all the various elements. I really like the CSS inspect and summary feature, especially when customizing Plone with it's layers of CSS.

  • Web Developer great for

    editing CSS live. It is rather slow on refresh though.

Once key classes and id's are done, I then go to tried and true VIM.

I also found a handy utility called gcolor2. This allows you to pick colours from anything on your screen, and provides handy rgb hex codes quickly from any app on screen.

For web design with CSS and HTML, I don't see that FOSS tools are lacking in any way. Also I will always code to standards first. CSS 2.1 and XHTML 1.0 Transitional. Then you do workarounds for stupid IE.

April 10, 2009 12:02 PM


Kevin Foo (chfl4gs_)FreeBSD : php-cgi spawn-fcgi rc.d script for nginx

I was busy working on glusterfs ports for FreeBSD. Still some issues to be ironed out before it can be submitted to the upstream. At same the time, I set up web servers running nginx with php5 via fastcgi. FreeBSD doesn’t have rc.d script to trigger spawn-fcgi process. So I wrote a quick one. [...]

April 10, 2009 10:09 AM


Swee MengLinks for 2009-04-09 [del.icio.us]

April 10, 2009 07:00 AM


Colin CharlesGen Kanai from Mozilla speaks about localisation in Firefox and more

At BarCampKL, I conducted a quick interview with Gen Kanai, the Director of Business Development, at Mozilla in Asia. He has vast experience, that ranges from starting the Japan office, to marketing, to helping open the Beijing office, and this year, its all about South East Asia.



Mozilla wants to know if there is a need for Firefox in Bahasa Malaysia? I asked Gen how hard it was to translate Firefox - there are over 60 localisations, and unofficially, there are over 100.

Bahasa Malaysia is about 40% complete, and the website needs localisation as well. While the system itself is not as simple as Ubuntu’s translation system, you don’t need to be a programmer, just know how to use source code management tools. You can use a simple text editor like Notepad, and move all the way to using Pootle.

Do you want Firefox and other Mozilla tools translated into Bahasa Malaysia? How will it help you (or someone else)?

April 10, 2009 04:22 AM


Colin CharlesNetbook Tweaks at BarCampKL

At BarCampKL last weekend (wow, time flies), one of the more interesting talks I attended was Preetam Rai’s session, on Netbooks. Carolyn was suspicious that a Mac head was at a netbook session, but the reality is, I’ve always been interested in netbooks, ever since I picked up the Asus Eee PC 701.

I didn’t “live tweet” the session, but I did take notes:

  • Keep in mind the small screen - 800×480 is crap. 1024×600 seems to be the new preferred resolution, and it might make things like Google Reader easier to use
  • What browser? Chrome seems to work well - I’ve been Chrome free, considering I don’t run Windows… All this may change, but it seems like the interface of Chrome, the lack of a top toolbar, is a pretty good thing
  • Dock, to make it more OSX like, Rocket Dock - read Preetam’s post about Netbook Tweaks 1: Rocketdock
  • Magnification - The Magnifier, EZ Magnifier
  • Anti-virus - use AVG (free)
  • MSN Messenger - hack to remove ads, mess.be. Otherwise use Pidgin, which as an alternative to MSN Messenger
  • Office - MSOffice isn’t so user friendly on small screens because the toolbars take lots of space. OpenOffice.org is also a problem, in terms of toolbars. Mozilla Prism, then use Google Docs, with offline mode
  • Using Linux? Well, you can contact your local LUG
  • Battery life? Turn of wifi, bluetooth when you don’t need it. Low power saving mode.
  • Windows? Disable computer discovery, bluetooth management
  • Linux? Mind the filesystem, also keep in touch with fstab. You don’t want to kill your SSD
  • How do you speed it up? Upgrade the RAM.
  • Keyboard? 701 has a horrible keyboard. HP seems to do pretty well with their keyboards. Ditto with MSI Winds, the Lenovo, and newer Asus EeePC’s - so the keyboards are getting better

So, with regards to Linux, the Ubuntu Netbook Remix seems to get the most traction. I am partial to Fedora… If I pick up an Asus 1000HE, do I just “enjoy” using Windows? So many thoughts…

April 10, 2009 02:21 AM


Nicholas A. Suppiah (tboxmy)Setting up printer for Kubuntu

The KDE system on Kubuntu uses network discovery to find the available printers. This means, users do not need to manually add printers. This is done in 2 steps.

Step 1:
At the KMenu choose Applications ->System ->Printer Configuration.

Step 2:
Choose Server settings and check the "Show printers shared by other systems". Press "Apply".

Users need to wait for about a min for the first time discovery of the printers. Press Ok and test the printings.

April 10, 2009 02:16 AM


Khairil YusofLooking for a job?

Inigo is looking for a designer and a software engineer.

If you need to do an internship or practical or you're graduating in July and looking for a job, Inigo will take you as an apprentice for up to 6 months to train you and then hire you if you fit our team.

http://farm4.static.flickr.com/3440/3348885450_c24b609af1_m.jpg

For the designer, we're looking for folks who love design and all aspects of it such as the topics covered here http://lenovoblogs.com/designmatters.

For software engineers, we're looking for those with equal passion about software development and IT.

We set the bar high, but working at Inigo has a lot of benefits. We follow the The Hacking Business Model. We do work at quality levels for international orgs like the UN, but at the same time we also follow good working practices. For those selected, you will be part of a small close knit Inigo team, with operations and decisions that are made inclusively and fully transparent.

Inigo is also an equal opportunity employer. We encourage diversity here and the best person for the position regardless of your background.

Interested? Go here for details: http://www.inigo-tech.com/jobs

April 10, 2009 02:15 AM


Eric H. A. YeohFormatting a Thumb/Flash Drive in Linux CLI

The ubiquitous flash/thumb drives, once a luxury among the geeks and techies is now staple among any self respecting computer user. Most Linux users are adept to use something like gparted or the Yast partitioner (in SLE/OpenSUSE) to format and/or rename the drive, but how to do it in CLI?

Insert the drive in the computer. It should automatically mount. To check which location and device assignment, from CLI use the mount command and it should display something like below:

/dev/sda3 on / type ext3 (rw,acl,user_xattr)
/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda1 on /windows/c type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
securityfs on /sys/kernel/security type securityfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /home/eyeoh/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=eyeoh)
/dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,shortname=lower,flush,utf8,uid=1000)


So the thumb drive is mounted to /media/disk and the drive assignment is /dev/sdb1. The VFAT filetype is usually a dead give away as practically all thumb drives are formatted with VFAT (or FAT32).

Switch to root and unmount the drive:

#umount /media/disk

To format the drive to FAT32:

#mkfs.vfat /dev/sdb1

Rename the Flash/Thumb drive, ensure that mtools are installed:

#rpm -qa | grep mtools (in Fedora/OpenSUSE/RHEL/Centos/Mandriva)


#dpkg -l | grep mtools (in Debian/Ubuntu/Mepis)


Renaming the drive:

#mlabel -i /dev/sdb1 ::Thumbdrv

Where Thumbdrv is the name.

April 10, 2009 12:10 AM


Swee MengLinks for 2009-04-08 [del.icio.us]

April 09, 2009 07:00 AM


Khairil YusofNo Excuses

My work ethic ain't no habit man, I do it on purpose. I push myself to the limit, so my talent will surface.

—Nelly

First up. No Excuses.

I didn't get training.. I didn't get funding.. I didn't get right education.. I'm not disciplined enough.. I don't have connections.. I live in a small town.. My job sux, but it's stable income.. I'm not bumiputera..

If you find yourself saying these kind of things, then you'll have to do some sort of introspection and not blame the world. There wll be numerous hurdles.

Of course just working hard is just one aspect, but you have to work smart and creatively too. Either way, there is no escape from rolling your sleeves up and getting it done initially.

Some tips from experience.

  • Get yourself organized, working aimlessly/inefficiently is not a good idea.
  • If you're in IT, you don't need expensive stuff. Learning how to do more with less will help you out later when you need to scale. Inigo can do more with an RM2K server that most companies with 20. It translates to a massive competitive advantage as we start scaling up with high performance servers now.
  • Be creative with solving issues. Bad Internet connection? Learn how to solve it. Backup Bluetooth to mobile? VPN to Jaring? Squid? Local DNS? Traffic shaping? Again as before, skills that will help you as you scale up, learnt from when you were struggling.
  • Trust and respect yourself. This self respect will be there with going through experiences of previous points. Most people are out there purely looking after their own self interests and will lie with a straight face, or cry crocodile tears. Don't trust sales people and so called big shots. Listen to them, there may be good advise, but trust your instincts. There is a world of difference between a venture capital who made it, and investing his own money and connected people spending government (your money actually) who have never done anything successful themselves. A warning signal is when they use buzzwords and trends and belittle your ideas if it is not trendy. Experiences shows that they're the ones usually wrong, and move on to the next thing to leach on.

April 09, 2009 02:11 AM


muhd. zamriCUPS: Unable to open device and permission denied

I use CUPS for my printer system and I got this error:

Unable
to open device "
hal:///org/freedesktop/Hal/devices/usb_device_3f0_217_00SGKGB09615_if0_printer_noserial": Permission denied

How to solve this problem? The settings of the printer was correct and was just a permission problem. Googling a bit, I found this site.

These steps what I did to solve it:
1. cd /usr/lib/cups/backend
2. chmod 700 hal (previously 755)
3. chmod 700 usb (previously 755)

For step 2 and 3, I found out that you have to change the mod to 700 although the file hal and usb has 'rwx' on them on the 'user' part. The culprit was the 'group' and the 'other' part of the permission. They should be chmod'ed to 0. On my system, the 'group' and 'other' part of both files was 5 (r-x) previously.

I hope this saves some people's time of head scratching.

April 08, 2009 05:23 PM


MuSMoAutocomplete parent topic in NatEdit

What I really miss in Foswiki 1.0.4 with NatSkin was the ability to view all the existing topics within the web and choose which topic is my parent topic. Currently, NatEdit wants you to know the exact name of the parent topic - not quite interesting.

So, I’ve made a simple tweak that allows me to search all the existing topics in the web as I type. Result? I’m able to search for a parent topic by its name. Not exactly perfect, but it fits well so far.

There are 3 parts to achieve this.

1. Create SEARCH term to list all the topics in the web

%SEARCH{ ".*" type="regex" web="%WEB%" scope="topic" nonoise="on" nototal="on" multiple="off" separator=", " format="'$topic'" }%

2. Integrate the above with JQueryPlugin
We’ll be using jquery.autocomplete for the completion of the input field.

<script>
  $(function(){
    $("#topicparent").autocomplete(
      [ %SEARCH{ ".*" type="regex" web="%WEB%" scope="topic" nonoise="on" nototal="on" multiple="off" separator=", " format="'$topic'" }% ]
    );
  });
</script>

3. Modify edit.natedit.tmpl
We need to modify /<path_to_foswiki>/templates/edit.natedit.tmpl to include all the above. So it should look like this…

  <div class="twikiFormStep foswikiFormStep twikiFormLast">
    <h3>%MAKETEXT{"Parent topic"}%:</h3>
%JQSCRIPT{"jquery.autocomplete"}%
%JQSTYLE{"jquery.autocomplete"}%
<script>
    $(function(){
        $("#topicparent").autocomplete(
            [ %SEARCH{ ".*" type="regex" web="%WEB%" scope="topic" nonoise="on" nototal="on" multiple="off" separator=", " format="'$topic'" }% ]
        );
    });
</script>
    <input class="twikiInputField" id="topicparent" type="text" name="topicparent" size="40" value="%TOPICPARENT%" />
  </div>

April 08, 2009 02:30 PM


Swee MengLinks for 2009-04-07 [del.icio.us]

April 08, 2009 07:00 AM


Mohd Irwan JamaluddinMy Streamyx Took >3 Hours To Download 21.6MB-Files

I was using my beloved Streamyx to get an update on my beloved Ubuntu laptop. To my surprise, the download rate is damn slow and unacceptable, root@unforgiven:~# apt-get dist-upgrade Reading package lists… Done Building dependency tree Reading state information… Done Calculating upgrade… Done The following packages will be upgraded: linux-headers-2.6.27-11 linux-headers-2.6.27-11-generic linux-image-2.6.27-11-generic linux-libc-dev tzdata 5 upgraded, 0 newly installed, 0 to remove and [...]

April 07, 2009 04:38 PM


Andy Goh (hantu)MySQL Error 1005

I have encountered this error, when I tried to dump an SQL file to a database.

ERROR 1005 (HY000) at line 13: Can’t create table ’secretproject_development.canhaz’ (errno: 105)

First thing came to my mind was, to Google for an answer, where I found this. Being a lazy person to read through the whole thread, it suddenly came into my mind why that table can’t be created. There was a reference to another field in another table, and that table is not available at the moment.

Simple fix was to re-order the CREATE TABLE codes, so that tables are created before being referenced.

April 07, 2009 03:34 PM


Farhan Faisalmd5 decode script - PHP

Last few weeks I found a malicious script installed on my hosting server. This is due to unupdated Wordpress, that allow remote attacker to upload some malicious code into the server. The server have been clean up, no more problem. :)

The malicious file found is a PHP script, with alot of hacking tools embedded. One interesting part is, it have a md5 decoder. I’m not really good in data structure, I cannot construct my own bruteforce code. So, I took those bruteforce code to a single file, just to decode a md5 hash string.

This is just a prove of concept that, a strong password should be long, and have some extra character, other than normal alphabets. This give a higher probability of character to choose in bruteforce attack.

MD5 Decode in action

Download the code here, md5decode.txt. Please rename it to *.php.
You have to put in what character options to test against the hash string, and also the hash string you want to decode.

This code might not applicable in real life nowadays, as there are other ways users password been exploited, for example, using default password, and common password. Thats why most bruteforce attacked were dictionary based. So, make sure your password is strong enough. One other method, is Rainbow Table. I’m still reading it :)

Rainbow Table (Wikipedia) - http://en.wikipedia.org/wiki/Rainbow_table
Md5decode.txt - http://www.farhanfaisal.com/?download=md5decode.txt

April 07, 2009 11:54 AM


Farhan FaisalNetwork monitoring with cacti - snmpd.conf

Network monitoring plays an important aspect in a system admin life. You will be managing some servers, and you might have problem taking care of their respective ‘health’, making sure its serving fine and performing best of it. There are some monitoring tool, for example, mrtg, nagios, cacti.

For our setup, we are utilizing cacti, a web-based host monitoring tool, that can monitor hosts through snmp. Its a php tool, and customizable. Its powerful enough to give you what you want, just the matter of configuration. The first thing, you have to make sure every host you want to monitor is snmp enabled.

Cacti login page

SNMP stands for “Simple Network Management Protocol”, can be harmful if not configured properly. It can reveal you private information of the host. I will just put a simple snmpd.conf configuration file, that will have enough privilege control on host and community string.

com2sec local localhost YOUR_COMMUNITY_STRING
com2sec mynetwork 202.190.123.144/28 YOUR_COMMUNITY_STRING

group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork

view all included .1 80

access MyROGroup "" any noauth exact all all none
access MyRWGroup "" any noauth exact all all none

syslocation YOUR_LOCATION
syscontact YOUR_EMAIL
sysname SYSNAME

You can verify that your snmpd daemon is responding to snmp request using snmpwalk. For snmp version 1, you can use,
snmpwalk -v 1 -c YOUR_COMMUNITY_STRING 127.0.0.1
For snmp version 2,
snmpwalk -v 2c -c YOUR_COMMUNITY_STRING 127.0.0.1

This configuration is for the end host you want to monitor. In Cacti, you will need to add the community string, and the IP of the host you want to monitor. Then, cacti will start polling information from these hosts through SNMP with the credential given.

Cacti Graph

Cacti - http://www.cacti.net/
Nagios - http://www.nagios.org
MRTG - http://oss.oetiker.ch/mrtg

April 07, 2009 11:14 AM


Swee MengLinks for 2009-04-06 [del.icio.us]

April 07, 2009 07:00 AM


Eric H. A. YeohBurning ISOs in CLI using OpenSUSE 11.1

Graphical tools are nice, just point and click. Makes life easier for most. But what if the damn button just won't play ball? Windows users will be sweating copious amount right about now.

Well, GNU/Linux users, take heart; there is always more than one way to do stuff.

In this case, what if Brasero or K3B both tell you there is not writable media in the writer in the drive and you know that ain't true? CLI to the rescue!!!

Check for the device your writer is connected to:

#wodim -scanbus

scsibus1:
1,0,0 100) 'HL-DT-ST' 'DVD+-RW GSA-H31L' 'W616' Removable CD-ROM
1,1,0 101) *
1,2,0 102) *
1,3,0 103) *
1,4,0 104) *
1,5,0 105) *
1,6,0 106) *
1,7,0 107) *

Burn the ISO image to DVD-R at 4 speed:

#cdrecord -v -pad speed=4 dev=1,0,0 CentOS-5.3-i386-bin-DVD.iso

If you didn't catch on already you need to have root privileges to do it.

April 07, 2009 02:06 AM


 
 

People

Feeds

rss 1.0
rss 2.0
FOAF blogroll

Resources

irc.freenode.net, #myoss
MYOSS mailing list
OSSIG mailing list

Links



Other Aggregates

Credits