International Rafting Expedition – Sungai Pahang



Image Gallery Hosted By image2u.net – Free Image Hosting


26 April – 1 May 2006, I went on International Rafting Expedition, Sungai Pahang, with some other IIUM guys.. Quite an interesting experience, meeting so many people in such a big event. Even though there are some problems, but everything just fine.

Love the time in those villages.. πŸ™‚

Code snippets collection

While searching for information about ruby and configuring mod_security in apache, I found 2 sites that might be useful for us.

http://www.bigbold.com/snippets/

http://textsnippets.com/

There are alot of categories for the code snippets, Java, PHP, javaScript, Ruby, Perl bash, and many more. It would be useful for programmers and system administrators.

Guess what, both the system running the sites were developed by Peter Cooper and powered by Ruby On Rails πŸ˜‰

Rubyonrails enabled!

I have installed Ruby on my FreeBSD 5.4 RELEASE, rubygems, rails, FastCGI and mod_fastcgi.. and walla, i’m riding on rails πŸ˜€

150px-Ruby_on_Rails.svg

Below i jot it down, how to install ruby on rails in FreeBSD. For this case, I will install ruby 1.8.4, rubygems, rails, FastCGI 2.4.0 and mod_fastcgi 2.4.2 on a FreeBSD 5.4 RELEASE machine.

#Get all the files needed.
cd /usr/local/src/
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz
wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
wget fastcgi.com/dist/fcgi-2.4.0.tar.gz
wget fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz

# Install ruby on the system.
tar -zxf ruby-1.8.4.tar.gz
cd ruby-1.8.4
./configure && make && make install && cd ..

# Install rubygems-0.8.11
tar -zxf rubygems-0.8.11.tar.gz
cd rubygems-0.8.11
ruby setup.rb

# Install rails
gem install rails -y

# Install FastCGI
tar -zxf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure && make && make install && cd ..

# Install mod_fastcgi
tar -zxf mod_fastcgi-2.4.2.tar.gz
cd mod_fastcgi-2.4.2
apxs -o mod_fastcgi.so -c *.c
apxs -i -a -n fastcgi mod_fastcgi.so

# Create fcgi temp directorys
mkdir /tmp/fcgi_ipc/
mkdir /tmp/fcgi_ipc/dynamic/
chmod -R 777 /tmp/fcgi_ipc/

# Add an module entry into httpd.conf

FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
FastCgiWrapper /usr/sbin/suexec

#Restart httpd. You might need to apply your own way to do this, depending on your system.
/usr/local/etc/rc.d/httpd restart

The environment of each website hosted for ruby on rails also need to be created. The guide below will be specifically for direct admin. Root document of each server in DirectAdmin is configured at /home/example/domains/example.com/public_html, example and example.com is for this example only

cd /home/example/domains/example.com
rails rails_app
mv public_html old_public_html
ln -s rails_app/public public_htm
cd rails_app
chmod 755 public

And, you can point your browser to example.com, and you will be riding on rails too! πŸ˜€ Create your controllers/models, configure your routes, configure your database file, and you’re off! You can start working on Ruby applications on rails

The above guide are just to prepare the system for ruby on rails environment..For the development part, this link would be good for you.
Howtos in Ruby on Rails

Will come up more in ruby πŸ˜‰

Tunnel traffic over ssh

I had a problem previously on how to access my server control panel, that runs on port 2222, that was blocked by my network administrator. There is an option to access it, through ssh tunnel. This can be done using putty ssh client in windows, and command line ssh in Linux.
For sure for ssh tunneling, you would need a ssh account, anywhere.

You just need to connect to your client as usual, but before that, please take note about tunneling. You need to mention the local and remote port to the destination server.

For Linux user

For linux user, ssh tunneling can be done just with a single command line.

# ssh -L 2222:budihost.com:2222 user@budihost.com

The left port number will represent the local port, and the right side is the remote port you want to access.

After that, just fire up your browser, and point to http://localhost:2222. WALLA!

You need to bare in mind about few things that you need to consider. You cannot do ssh tunneling for a port number below 1024 unless you logged in into ssh account as root. Only root user can bind to a port below 1024.

Cheers

Proper education related to hosting when imparted, results in adequate domain names as well as proper seo, not just pay per click.

Someone steal my bandwidth

I just noticed an immediate increase bandwidth in one of my sponsored hosting website, www.alif.com.my. When I check the referer, I finds out there is one website who put my radio.blog into his website. He is feeding his visitor with my bandwidth.

So, I fire up google and search for “php how to check referer”, I found the hacks to solve it. This script will actually check for referer before it loads. Specify your own server, replace www.mysite.com. If the request was not from www.mysite.com, it will just display, “Nice try

< ?php if ( eregi ( "www.mysite.com", $_SERVER['HTTP_REFERER'] ) ) { // do something } else { echo "Nice try"; } ?>

Now, the website cannot view the radio blog in his website. Instead, there is a message comming out πŸ™‚

No more bandwidth stealing

Scientific explaination in Google Search popularity

eyetracking-google

[Picture from here]

I found an article about how Google positions their search result and the ads in a way that it is so effective. This feature will for sure attract the advertiser to invest in Google AdWords..

The arrangement made a F-shape area, where user will browse from the left page, vertically, searching for pictures or keywords that they are looking for, and then move to the right side for any additional information.

Reference
http://www.enquiro.com/eye-tracking-pr.aspΒ [Dead link now]

Mozilla rules! Mozilla users are safer

firefox
2 researchers and a pair of graduate student at University of Washington have found that Mozilla user is less vulnerable to security issues, compared to IE.

They have reseased web-crawlers to 45,000 website and perform some test of todays browsers vulnerability to conduct the test.

Download the latest Mozilla Firefox now, at Mozilla.com and tweak it for best performance πŸ™‚

http://news.yahoo.com/s/cmp/20060210/tc_cmp/179102616
http://www.farhanfaisal.com/?p=10