Put your message here! Contact me for more information
 
 







 

Archive for May, 2008


 

This is a quick summary for this process so that I can refer to it later on, and hopefully someone will find it useful as well.

Memcached requires libevent to handle its network IO stuff. The bundled libevent in the standard yum repository is old so it’s pretty useless. The newer versions memcached runs on newer libevent library so I ended up compiling libevent and memcached from the latest stable sources. I’m using libevent-1.4.4-stable and memcached-1.2.5.

First off, uninstall the libevent that yum may have installed on your machine

# sudo yum remove libevent

Download the sources for libevent and memcached , unzip( # gunzip *.gz ), untar (# tar -xvf *.tar), CD to the libevent folder. We will compile the libevent first.

# ./configure –prefix=/usr/local

# make

# make install

Basically we are telling libevent to install itself under /usr/local/lib/. When we compile memcached, we need to point it to the correct location as well. Once libevent is done installing (it’s really quick), we can move on and complie memcached.

CD to the un-tar memcached folder,

# ./configure –with-lib-event=/usr/local/

# make

# make install

After memcached is installed, you can try

# memcached

In my situation, I ran into an error

error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

It turned out that the new libevent get installed, it doesn’t “register” the actual library file (similar to DLL on Windows) with the system. When Memcached runs, it tries to look for the libevent-1.4.so.2 file but since libevent is still playing hide and seek somewhere, memcached cries.

To fix this, we need to manually load the libevent library file into the system via the ld configuration. From the man page of ld:

ld combines a number of object and archive files, relocates their data and ties up symbol references. Usually the last step in compiling a program is to run ld.

I like to think ld as the regsrv32 used to register DLL’s on Windows. Now to fix up the reference to the libevent so file, we need to create a file under /etc/ld.so.conf.d/

# vi /etc/ld.so.conf.d/libevent-i386.conf

then enter

/usr/local/lib/

Write and quit (:wq!)

The path in the libevent-i386.conf is the path where the actual .so files are located at. We set this path when we run the ./configure –prefix=/usr/local/ during the libevent compilation. Reloading the ld configuration with

# ldconfig

now, you can start memcached in verbose mode (-vv) for testing

# memcached -vv

If you see something like ..

slab class 1: chunk size 104 perslab 10082
slab class 2: chunk size 136 perslab 7710
slab class 3: chunk size 176 perslab 5957
slab class 4: chunk size 224 perslab 4681
slab class 5: chunk size 280 perslab 3744

….

slab class 37: chunk size 367192 perslab 2
slab class 38: chunk size 458992 perslab 2
<6 server listening
<7 send buffer was 126976, now 268435456
<7 server listening (udp)

Congratulations! Memcached is up and running!

PS:  I’m renting the VPS from www.slicehost.com and so far my experience with them ( 1.5 months) is excellent.

view comments
 

Recently I’ve come to know about Adrian at 7Million7Years.  He’s a successful entrepreneur with lots of experience in running businesses and investments.  Adrian decided to share his success and his wisdom with the next 7 “apprentices.”  I applied on the first day and today, I’ve got featured as one of the applicants on his 7m7y site.

The first task I have to do is to get more traffic to my so-called “profile” page.  I intend to leverage the traffic to my blog and open a pop-under to the page.  Yes, I know pop-under is annoying, but I only have the pop-up until June 2nd (in a week).

Visit my Featured Profile Page at 7M7Y

In return, if I get selected to be one of the 7 millionaires in training, I will share more of my “million” journey to everyone.

view comments
 

It’s time to say NO to monopoly and for Net Neutrality to be passed as a law.

It’s not Comcastic as you all claim. It’s ComCraptic. My experiences
with Comcast has got from worse to worser, and now I am a very unhappy
customer. Comcast is in fact using dirty and shady tactics, often
disguised as to help “preserve the speed for its users”, to severely
throttle services that are not in its interest to run on the network.
YouTube doesn’t even want to stream sometime, meanwhile Hulu.com (a new
TV-show site) is streaming Hi-Def videos just fine and it is extremely
fast (because Hulu is not that big yet and so it’s not on the black
slow-list). Netflix Watchnow is now extremely slow and almost
unbearable. I watched a 24-min animation episode and it took 20 minutes
to download the video! I always have DUMeter installed so I constantly
monitored my download/upload rate. Before, for Netflix, I was streaming
at 500KBps - it was almost instant to begin watching the instant
videos. This is how the new “internet experience” should be. I was a
very happy Comcast customer.

I started to read on Slashdot about
Comcast trying to slow down BitTorrent and other traffic. NO! All
traffic on the Web should be considered EQUAL. Why are we trying so
hard to erase racial discrimination while Comcast is trying its best to
discriminate and destroy the foundation of “free internet” ? And NOBODY
right now can do a thing to change this evil Comcrap piece of @#$? What
would happen if Comcast begins to extort money from Netflix, YouTube,
Hulu, or even Amazon, to allow users to use these excellent services?
That would be the end of the free internet.

After a “service outage” in my area, the speed of Comcast degraded
worst than anything. YouTube streaming speed is out right ridiculous,
if not pathetic. Netflix streaming speed degraded from 500KBps to
300KBps, and now, as I’m typing this, it’s only downloading at much
less than 100KBps. It took 20 minutes to half an hour for anything to
work. This is pathetic. And Comcast did NOT disclose anything about
their practices, not until people started to discover concrete proofs.

(http://netflixcommunity.ning.com)

I found this diagram while searching on Comcast and its shady and
disrespects of the customer practice. I don’t think any explanation is
needed.

What kills the internet? Not spam, not phishing, not videos
streaming, not the data tsunami. It is the unfair practices from ISP
that slow down the evolution of the internet. Comcast is playing its
monopoly hand to dominate places where users don’t have an alternative.
And yet, they have all the power to fudge, deny, or change the TOS for
their own legal and financial benefits. I would pay double for my
internet connection if I have any choice other than Comcrap. That’s
right, I would pay $118 a month for any ISP that works and treats their
customers honestly.

In the US, everything is built on Trust, and Credit. Hence we have
credit history, credit cards, personal loans, and mortgages. If
corporations like Comcast are abusing and destroying this circle of
trust and credibility, society as a whole, will be mubh better off
without them.

Comcast, I sincerely wish you would go to hell for your practices.
Meanwhile, you will go to sleep better if you treat your customers with
dignity.

view comments
 

If you do “gem install capistrano”, the gem package manager will go fetch the latest gem version of capistrano, currently 2.3.0 and installed in the gem repository. In case you want to have multiple version s of capistrano running, here’s how to do it.

To install older gem version of Capistrano
gem install –version 1.4.2 capistrano
(1.4.2 is the latest one in the 1.x branch before the release of 2.0)

To run specifically the 1.4.2 version, use
cap _1.4.2_ *your_tasks_here*

Shortcut
To reduce the typing, you can make an alias in your .bash_profile on Linux to run the 1.4.2 version as cap1 (cap 2.x.x is still running as cap) using

# add this line to .bash_profile
alias cap1=”cap _1.4.2_”

Afterwards, reload the profile with

$ source .bash_profile


Since I am on Windows, what I did was creating a batch file called “cap1.bat” and saved it within my system’s PATH environment. For simplicity’s sake, I save the cap1.bat file inside my C:\Windows\System32 folder

@echo off
cap _1.4.2_ %*

The special wildcard %* will be replaced with your command-line arguments, saving you the typing.

To read more about the Capistrano 1.4.2 version, check out Jamis’s post here.

view comments
 

I’m in the process of installing Ruby on Rails on a VPS running CentOS 5.1 and run into an issue with gem complaining for the missing zlib library. What happened was that I first used “sudo yum install ruby” to install the ruby runtime. However, the pre-packaged ruby in the Yum repository was older, 1.8.5. I only found out about this when I tried to run the mongrel_cluster to set up the mongrel instances. Mongrel was complaining about the older version of Ruby and the need for the fcgi fix. I decided to uninstall the yum ruby package and compile the newer version of Ruby from the source.

I compiled and installed Ruby 1.8.6 from the tar ball source first (./configure, make, make install), then I removed the pre-installed package using “sudo yum remove ruby” and removed all the dependencies with it. Next I installed gem 1.1.1 from the source (ruby setup.rb). I proceeded to install rails 2.0.2 again (”sudo gem install rails -y”). Bam, gem started to complain:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- zlib (LoadError)

Not good!

I did some research and it turned out that my CentOS 5.1 VPS is a barebone box, it did have the extra development libraries installed. Hence when I compiled Ruby from source, make did not compile the zlib extension because I did not have the zlib-devel package installed.

After installing zlib-devel package through yum (”sudo yum install zlib-devel”), I cd’ed into my Ruby source folder and into the ext/zlib folder (in my case, ruby-1.8.6-p114/ext/zlib/). Then I proceeded to install the zlib library (”ruby extconf.rb”, “make”, “make install”). Afterwards, gem was working fine again! Yay!

view comments