Friday, June 25, 2010

grayscale monitor in macosx

I had been looking for a way to have an e-ink-like monitor that I can use with my computer.  The closest technology I had found was iLiad, an e-book reader which is well-known for its openness for hacking.  Of course, it is a linux-based. People have been able to run x window, xclock and etc on it together with using keyboard remotely.  Yes, it looked promising.

However, just today, I happened to find out Pixel Qi's hybrid monitor!  You can search it from Google.  There are many stories about it.  Rumour has it that this special monitor will be shipped around September to December this year (2010).  What is cool about its monitor?  It is the same quality as e-ink!  Its refresh rate is a lot higher than those e-ink out there like Amazon kindle or Sony Digital Reader that I am using.  It even supports colour (still e-ink!).

I will buy it for sure.  But, meanwhile, I have also found a way to turn everything on my screen to be grayscale by going to:
  • System Preferences
  • Universal Access
  • Display
references

Tuesday, June 22, 2010

how to eject an iPod under Linux

Just say it in short:

You need to send an ALLOW_MEDIUM_REMOVAL to the usb device.
The easiest way is with eject.
references:

% ps auxww

"% ps auxww" is what we should use to list all processes (for unlimited width)

Notice we specify "w" twice.

Sunday, June 20, 2010

firefox custom search

Today I wanted to add a custom search to my Firefox.  It is the search box on the top right corner of Firefox.  By default, I saw:
  • Google
  • Yahoo
  • Amazon
  • ...
But what I wanted is urbandictionary.com.  It's so easy to add a custom search in Firefox.  I opened Terminal, login as root, then:

vi /Applications/Firefox.app/Contents/MacOS/searchplugins/urbandictionary.src

I then entered xml code below:

<search
  name="urbandictionary"
  method="GET"
  action="http://www.urbandictionary.com/define.php"
  queryCharset="utf-8">

  <input name="term" user />
</search>

I tested it with MacOSX.  An example here is urbandictionary.com.

Thursday, June 10, 2010

How to hibernate a mac

With new mac (current year is 2010), we can hibernate our macintosh computers by manipulating power management settings via this command:


$ sudo pmset hibernatemode 1

Then, the next time you "sleep" your mac, it will hibernate instead.  Make sure you wait until the white LED turns off which is when you can unplug the power cord.

I can confirm that this method works with MacBook Pro and MacMini (current year is 2010).

Note that this is not a hack as "pmset" is an official tool which you can read its manpage on your system via:

$ man pmset

You only need to set this property just one time and it will be set forever until you set it to something else later.

For those who hates UNIX's way of doing things for some reason (even though you are running MacOSX which is a UNIX system), you can try this:


And get a D from me.

Thursday, June 3, 2010

tircd - url shortening

In tricd, a cool twitter client, if you want to use the url shortening feature, you need to make sure you have Perl module:

  URI::Find

One possible way to install this Perl module is by:

  perl -MCPAN -e 'install URI::Find'

This module is used by tircd to parse URLs from our tweets.

Monday, May 24, 2010

how to get table create script in oracle

SQL> SET LONG 9999999
SQL> SELECT DBMS_METADATA.GET_DDL('TABLE','TEST') FROM DUAL;

Monday, May 3, 2010

chat command with skype

On a conversation window, you should try:

/help

And you will see a help like this:

[11:49:39 PM] System: Available commands:
 /me [text]
 /topic [text]
 /add [skypename]
 /history
 /find [text]
 /fa or /
 /alertson [text]
 /alertsoff
 /call [skypename] ..
 /leave
 /goadmin
 /get creator
 /get role
 /whois [skypename]
 /setrole [skypename] MASTER|HELPER|USER|LISTENER
 /kick [skypename]
 /kickban [skypename]
 /get uri
 /get guidelines
 /get xguidelines
 /set guidelines [text]
 /get options
 /set options [[+|-]flag] ..
 /setpassword [password] [password hint]
 /clearpassword
 /get password_hint
 /get banlist
 /get allowlist
 /set banlist [[+|-]mask] ..
 /set allowlist [[+|-]mask] ..
 /help

Fun?  Hehehhe.  Many commands just like IRC

cannot install audacity with error about pdns (powerdns)

For some reason, the script to install audacity in debian has to be able to stop pdns successfully... (I know this is weird).  So, what you need to do is to start it first by:

# /etc/init.d/pdns_recursor start
# apt-get install audacity

converting .mp4 to mp3

$ mplayer -ao pcm in.mp4 -ao pcm:file="out.wav"
$ lame out.wav