Put your message here! Contact me for more information
 
 







 

Archive for the ‘Server’ Category


 

I’m setting up a Rightscale server on EC2 running CentOS 5 to use RVM, however, I ran into the issue of the ca-bundle.crt that comes with curl is too old. The RVM installer script keeps on complaining about invalid certificates.


error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

Searching the net until now (2012!) still, sadly, doesn’t give that much results. So if you have SSL certificate issue with RVM, here’s your fix:


cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.old
sudo curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-b
undle.crt

Basically the cacert.pem file provided by curl.haxx.se contains all the root certificates necessary for curl to verify Github’s SSL, and thus your RVM installer script will cruise happily.

view comments
 

While installing a new Ubuntu server on Linode for a client using the “Stackscripts for Ruby 1.9.2, Passenger, Nginx, Rails, and MySQL”, I ran into an issue with bundler unable to install a few gems, notably mislav/will_paginate and collectiveidea/delayed_job. The gemspecs files of these particular gems have UTF-8 characters, and rubygems barks with the following errors:

Using will_paginate (3.0.pre3) from https://github.com/mislav/will_paginate.git (at rails3) /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:724:in `gsub': invalid byte sequence in US-ASCII (ArgumentError)

It turned out that for the default LANG environment variable wasn’t set by default. If you run

$ locale

you’d see something similar to this

LANG=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Notice that the $LANG variable is empty. Since ruby relies on the LANG to pick out the correct encoding, it got confused when trying to process the gemspecs containing the UTF-8 characters. To fix this issue, you can set the LANG option system-wise by adding 1 more line to your /etc/environment file. Just run this 1-liner and you’ll be all set.

$ sudo echo LANG=en_US.UTF-8 >> /etc/environment

Now the LANG will be set for your system, and thus will be passed to your ruby and passenger environment properly.

Here’s the updated version of the stackscript: http://www.linode.com/stackscripts/view/?StackScriptID=2166

view comments
 

My good friend Stephen Celis convinced me to give Rails.vim a shot for Rails development. My vi skill is not that great yet (e.g. beginner level), so Stephen recommended vimtutor, which does not come pre-installed on my CentOS server. So here’s a quick recap of getting vimtutor installed:

1. Installing “which”, which the vimtutor script uses to detect the vi version and copy the vimtutor script accordingly.

sudo yum install which

2. Installing “vim-enhanced” package, which contains the vimtutor

sudo yum install vim-enhanced

Now you should be able to do “vimtutor” and start a new vimtutor session. Happy h-j-k-l around and stops using the arrow keys :)

view comments
 

Here’s a quick summary to install ImageMagick from source and to handle all the common graphics files:

1) Install necessary libraries for image processing. ImageMagick will rely on these libraries to handle the images.

sudo yum install libjpeg-devel libpng-devel glib2-devel fontconfig-devel zlib-devel libwmf-devel freetype-devel libtiff-devel jasper jasper-devel ghostscript-fonts

jasper and jasper-devel is needed for Jpeg2000. Also ghostscrip-fonts is needed for some components (such as captcha generator).

2) Download the lastest imagemagick from source and install (untar, run ./configure, sudo make, sudo make install) The output of the ./configure command will show all supported file types

3) To validate the supported files format, run

convert -list configure | grep DELEGATES

the result should be something like

> convert -list configure | grep DELEGATES
DELEGATES bzlib fontconfig freetype jpeg jng jp2 lcms png tiff x11 xml wmf zlib

References:

* http://b.lesseverything.com/2007/6/24/setting-up-imagemagick-rmagick-on-redhat-centos

* http://forums.fedoraforum.org/archive/index.php/t-32148.html

view comments
 

I don’t like to get political on my blog, but a friend of mine sent me a link to a political quiz at ABCNews.

http://abcnews.go.com/Politics/MatchoMatic/fullpage?id=5542139

Here are my answers:


mccain-obama

I don’t disagree with some of the things that Obama is saying, but I strongly agree with McCain’s principles and leadership. And as a foreign immigrant to this country, I’m strongly offended by Obama’s way of dealing with the issue:

Obama: “We should require them to pay a fine, learn English, and go to the back of the line for citizenship behind those who came here legally. But we cannot — and should not — deport 12 million people.” (number #8)

Who the hell is Obama to say “let’s fine these illegal immigrants because they just sneaked in the country?” JERK, JERK, and JERK. How about babies that were brought to the States by their parents, granted “illegally” according to US’s immigration laws. Do these babies do anything wrong to get fined? They speak English, pay taxes, go to school, and contribute to society as much as anyone else — while getting treated as a 2nd-class citizen.

McCain has a much clearer policy and it is towards an legalizing the integration of the immigrants (currently there’s no such thing!)

“The program will … ensure that all undocumented aliens either leave of follow the path to legal residence. American cannot permit a permanent category of individuals that do not have recognized status — a permanent second class”

McCain, I wish you the best of luck!

view comments