How to get a Google Wave invite

I previous asked for a Google Wave invite, Ridzuan has kindly invited me. Later on, Google sent me an invite too. And then I got another invite by Google through a developer request. It all happen in a month and I suddenly have lots of invites to give away.

Google Wave logo
Google Wave logo

So who wants a Google Wave invitations? Just comment something like “I need a Google Wave invite” with your Google Accounts email address and I’ll send one to you soon.

How to know which processes uses the most resources

There are times where some processes use too much resources. You can use “ps aux” to get a list of all the processes that are currently running. But what about having them sorted? Here is one way. This works in Ubuntu Linux.

Top 10 % CPU usage

[code lang=”bash”]ps aux|sort -nr -k3|grep -v USER|head -10[/code]

Top 10 % Memory usage

[code lang=”bash”]ps aux|sort -nr -k4|grep -v USER|head -10[/code]

The following is the sample output for Top 10 % memory usage:

[code lang=”bash”]briecheese ~: ps aux|sort -nr -k4|grep -v USER|head -10
www-data 3883 2.9 14.1 107052 37176 ? S 11:44 1:46 /usr/bin/php-cgi
www-data 3882 2.9 13.8 107664 36264 ? S 11:44 1:46 /usr/bin/php-cgi
www-data 3881 1.2 13.2 106768 34688 ? S 11:44 0:44 /usr/bin/php-cgi
www-data 3884 3.1 13.1 107244 34592 ? S 11:44 1:54 /usr/bin/php-cgi
www-data 3879 1.1 11.8 106888 31160 ? S 11:44 0:40 /usr/bin/php-cgi
www-data 3880 0.9 9.5 94232 25092 ? S 11:44 0:34 /usr/bin/php-cgi
mysql 3659 3.5 6.9 277256 18200 ? Sl 09:45 6:25 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –user=mysql –pid-file=/var/run/mysqld/mysqld.pid –skip-external-locking –port=3306 –socket=/var/run/mysqld/mysqld.sock
root 4103 0.2 1.0 53468 2704 ? Ss 12:44 0:00 sshd: me [priv]
me 4106 0.0 0.8 18128 2116 pts/0 Ss 12:44 0:00 -bash
www-data 3875 0.0 0.7 57440 1972 ? S 11:44 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf[/code]

Percentage memory usage is the 4th column. This is useful when you need a quick overview of what’s consuming the most memory. [Thanks U-Zyn]

Relearn how to tie your shoelace

Here is a simple way to tie your shoes so that they will never come un-tied when you don’t want them to. If you have kids, you can save hours of your life. This little little trick will also save you embarrassment and may even save your life.

World’s Best Shoe Knot

Don’t you just hate it when your shoelaces get un-tied by itself?

How to repair MySQL tables

There are generally 2 ways of repairing MySQL tables using the command line. First is to use “mysqlcheck“, the other is to use “myisamchk” (only for MyISAM). This is more for my own information.

This has been tested on Ubuntu 9.10 with MySQL 5

mysqlcheck

This is how you can check if your database tables are fine:

[code lang=”bash”]mysqlcheck -uUsername -pSecret –all-databases[/code]

Change “Username” to your username and “Secret” to your password.

To repair them, use:

[code lang=”bash”]mysqlcheck -uUsername -pSecret –all-databases –auto-repair[/code]

This requires of your MySQL daemon to be running. If it isn’t running use this to start:

[code lang=”bash”]sudo /etc/init.d/mysql start[/code]

myisamchk

If you have trouble running ‘mysqlcheck’, you can consider using ‘myisamchk’ instead if your tables are MyISAM. This command can be performed without MySQL daemon running. This fixes the data in your file system directly and this has saved me once.

[code lang=”bash”]sudo myisamchk –max-record-length=1048576 -o -f /var/lib/mysql/db_name/table_name.MYI[/code]

Change “db_name” to your database name and “table_name” to the name of the table you wish to repair.

My disk got full

I just realized I totally used up my disk space in my slice:

[code lang=”bash”]briecheese ~: sudo /etc/init.d/mysql start
[sudo] password for me:
* /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full![/code]

It has never occurred to me that this would happen. I start to do some clearing up and delete some backups that I no longer need.

[code lang=”bash”]briecheese ~/www: df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 9.4G 6.7G 2.3G 75% /
varrun 129M 40K 129M 1% /var/run
varlock 129M 0 129M 0% /var/lock
udev 129M 16K 129M 1% /dev
devshm 129M 0 129M 0% /dev/shm
overflow 1.0M 0 1.0M 0% /tmp[/code]

I managed to free more than 2 Gb.

SourceForge changes name to Geeknet

Here’s the news:

SourceForge, Inc. Changes its Name to Geeknet, Inc.

MOUNTAIN VIEW, California, Nov. 4, 2009 – SourceForge, Inc. (NASDAQ: LNUX) today announced that it has changed its name to Geeknet, Inc. to more accurately reflect the company’s business and the growing market it serves. The name change also supports the company’s intention to expand the reach of its online advertising services into new categories.

“Renaming the company Geeknet is the latest step in our rapid transformation,” said Scott L. Kauffman, President & CEO of Geeknet. “Our new name is a more accurate articulation of our business. With Geeknet as our calling card on Madison Avenue, we are now able to clearly define the audience we serve and more effectively capture the business opportunity that we are addressing.”

The Geeknet network, which includes SourceForge, Slashdot, ThinkGeek and Ohloh, among others, serves a global community of nearly 40 million geeks each month. These tech-savvy professionals and enthusiasts are affluent, well-educated and command significant spending power. (Source: Geeknet)

SourceForge is a more widely known name as compared to Geeknet. I don’t really see how it would be better to change the company name to Geeknet.

INQ voucher can now be used in all hello! stores

Interested in the INQ mobile phones?

INQ mobile
INQ mobile

SingTel has extended the redemption of the e-voucher below to all hello! stores from today until November 30, 2009:

INQ roadshow coupon

Therefore, if you’re interested in INQ mobile phones, this is an opportunity you mustn’t miss!