Saturday, January 24, 2009

Quit smoking

It can be more difficult when you want to quit while your friends are still smoking.
You can be rich if you use only 10% of your salary.

Wednesday, January 21, 2009

Determining w3wp process and IIS AppPoolId

When hosting several virtual hosts in IIS, if you go to the Windows Task Manager > Processes, you will notice that the IIS worker process all share the same name as w3wp.exe. To see which w3wp is of which virtual host, one way is:

  • In the task manager, select to show PID column.
  • In cmd, execute C:\WINDOWS\system32\iisapp.vbs

Wednesday, November 5, 2008

Shared object "libperl.so" not found, required by "plperl.so" in FreeBSD

If you get this error when you execute:

$ createlang plperlu some-database

-- [start: full error message] --
createlang: language installation failed: ERROR: could not load library
"/usr/local/lib/postgresql/plperl.so": dlopen
'/usr/local/lib/postgresql/plperl.so' failed. (Shared object "libperl.so"
not found, required by "plperl.so")
-- [end: full error message] --

You can simply execute:
# ln -s /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so /usr/lib/libperl.so

Saturday, October 25, 2008

Bluetooth Headset with Web Browsers and etc in MacOSX

It is weird that MacOSX does not have a good support for Bluetooth. I
have just bougth Sony Wireless Stereo Headset (Bluetooth) DR-BT22 from a
Sony Style store. My operating system version is MacOSX 10.5.5. By
default, this headset works well with Skype, X-Lite (an VoIP phone
software), iTunes (both local mp3 files and online radio), Quicktime, and
other standalone applications. However, I cannot listen to any online
music through any web browser (I tried Safari, Opera and Firefox). What
happened is that all the online music stopped working at all.

The problem is that I can't listen to any online music through any web
browser with my Bluetooth headset.

Luckily, I found this article:

http://macosx.com/forums/hardware-peripherals/296416-problems-using-bluetooth-headset-mac-audio.html

Here is the essential part of the article:
--------------------------------------------------------------------
First, 2 files needed,

a. a2dpcastAudioDevice.tgz:
http://www.coolatoola.com/a2dpcastAudioDevice.tgz

b. the updated a2dpcast: http://www.coolatoola.com/a2dpcast-0.3.zip

Then run terminal from Application/Utilities/terminal and install the
kernel extension for the audio device (replace DOWNLOAD_DIR with the path
to where your browser downloads stuff to) - you need your admin password
to do sudo:

1. cd /
2. sudo tar xfzp DOWNLOAD_DIR/a2dpcastAudioDevice.tgz --same-owner
3. sudo kextload /System/Library/Extensions/AudioReflectorDriver.kext


Copy a2dpcast to /usr/local/bin (replace A2DPEXTRACTDIR with the path to
where your extracted the downloaded a2dpcast-0.3.zip) - you need your
admin password to do sudo:

1. sudo cp A2DPEXTRACTDIR/a2dpcast-0.3/a2dpcast /usr/local/bin

Run a2dpcast with your Bluetooth address

1. /usr/local/bin/a2dpcast aa-bb-cc-dd-ee-ff 27

Keep a2dpcast running, leave the terminal open, then run whatever program
that you want, the sound will be streamed automatically to your headset.
Again, do not close the terminal until you have enough enjoying your
bluetooth headset
--------------------------------------------------------------------

To get your mac address of your Bluetooth Headset, you can go to:

Finder > Applications > Utilities > System Profiler > Bluetooth

There you find your headset model and the mac address of your headset is
there.

Hope that help!

Saturday, October 4, 2008

Windows XP Pro and IIS 6 Limitation as a Web Server

Recently, a server of our client was crashed due to an infection.  It is a Window$ 2003 Server.  We had to put the website back to the Internet as fast as possible.  To save time, we decided to set up the temporary website on a Windows XP Pro machine available at that time.  And this was our wrong decision.

After we had finished set up this temporary server on Windows XP Pro.  We made the website went LIVE.  Just a few minutes after, we then tried to browse the website.  What we saw is the website with a number of missing images.  And if we used 2 (or more) browsers to access the website at the same time (or almost the same time), we will get HTTP 403.9 error (Access Forbidden: Too many users are connected Internet Information Services).

This fucked us up (although everything had already been fucked up by the infected server).
Fortunately, we found this article:

http://weblogs.asp.net/cazzu/archive/2003/10/10/31476.aspx

In summary, IIS on Windows XP Pro, by default, it can accept only 10 connections at the same time.  However, there is a trick by running:

c:\inetpub\AdminScripts\adsutil set w3svc/MaxConnections 40

which will make IIS on XP Pro passes its limitation.  It can now accept 40 connections at the same time (but unfortunately 40 is the limit).

This saved us for a few hours and then we set up a new machine with Windows 2003 to solve the problem for real.

Note that a normal web browser when we use it to browse a webpage, it will create multiple connections to get several parts of the webpage in parallel which means 1 browser may create 2 (or more) connections to the webserver.

Window$ Bastards!

Monday, September 29, 2008

TrueNetTalk and X-Lite on MacOSX

TrueNetTalk is an VoIP software provided by a telephony company in Thailand.  The package comes with a silly support that provides a client software that can be runned only on Windows.
VoIP is a standard protocol that does not depend on the client software.
A famous VoIP client is X-Lite which has a MacOSX version.
The trick is that you have to use "61.90.255.132".

Thursday, September 18, 2008

Sunday, September 14, 2008

CASIO: Module Number 1477 - Data Bank 150










This 150-page databank watch makes it easy to keep important information within reach. World time capability gives you the peace of mind that you'll always know what time it is, even if you've travelled halfway around the world. All of this and the 8-digit calculator make you feel like you've taken an assistant with you on the road.

It's a cool watch!  I feel like I am 10 years old with it!

UNIX Command - FIND

There will be a time when you need to execute a command (or commands) for each file that matches a specific criteria.  UNIX has a good tool to accomplish this task by default.

Assume that you want to grant execute permission for group in every *.cgi file in the current directory (recursively).  You use this command:

$ find . -name *.cgi -exec chmod g+x '{}' \;