Monthly Archives: January 2012

Eucalyptus manual installation

Well, Eucalyptus does not come with Ubuntu any more from version 11.10. Why? Indeed there is no reason, all we can say, this the benefit of being open, you are free to make your own choice :)

Anyway, but that doesn’t mean Eucalyptus cannot be used with ubuntu anymore, that’s absurd, isn’t it :P

Installation detail: Eucalyptus ver. 2.0.2, Ubuntu 11.10, Two physical machines (one with two NICs)

First we are going to setup Cluster Controller (CC). Storage Controller (SC), Cloud Controller and Walrus also going to live in the same box.

sudo apt-get install eucalyptus-cloud eucalyptus-cc eucalyptus-walrus eucalyptus-sc

now we need to install and configure ntp (Network Time Protocol) for the time sync between two machines.

sudo apt-get install ntp

we need to modify the ntp.conf for this setup, but this may not be a good idea for large scale installation.

add the following lines to ntp.conf

server 127.127.1.0
fudge 127.127.1.0 stratum 10

and restart the ntp service.

finally it’s time to register cluster, storage controller and walrus.

sudo euca_conf --register-cluster cluster1 192.168.1.2
sudo euca_conf --register-walrus 192.168.1.2
sudo euca_conf --register-sc cluster1 192.168.1.2

For Node controller we need few more packages. To be in the safe side, I installed all the recommended and suggested packages.

sudo apt-get install bridge-utils libcrypt-openssl-random-perl libcrypt-openssl-rsa-perl libcrypt-openssl-x509-perl open-iscsi powernap qemu-kvm vlan aoetools eucalyptus-nc

node has to be configured with a bridge as the primary interface

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
address 192.168.1.3

bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

install and configure ntp by adding the following line

server 192.168.1.2

modify the qemu.conf file to make sure libvirt is configured to run as user “eucalyptus”

sudo vim /etc/libvirt/qemu.conf

search and set: user = “eucalyptus”

modify the libvirt.conf file

unix_sock_group = "libvirtd"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"

as the modification is done, so now we have to stop and start libvirt for the changes to take place and also we have to make sure the sockets belong to the correct group

sudo /etc/init.d/libvirt-bin stop
sudo /etc/init.d/libvirt-bin start

chown root:libvirtd /var/run/libvirt/libvirt-sock
chown root:libvirtd /var/run/libvirt/libvirt-sock-ro

edit eucalyptus.conf and set private and public interface as br0

at this point the NC setup is done!

now we have to register this node from the CC like we did before

sudo euca_conf --register-nodes 192.168.1.3

and now you have your own private cloud!

tada!!! :D

Setting up django using virtualenv

Still I remember, once I was crying(!) to people to teach me virtualenv :P It’s actually I didn’t know that what it does, how it does and what are the benefits of using virtualenv.

Anyway, there are few and very important benefits of using virtualenv. This fantastic tool gives theh power of creating isolated Python environment. Keeps the headache of permission, version of the applications, dependencies etc.

The funnies thing about virtualenv is that, it is enormously easy to setup. YES, I mean it :)

sudo easy_install virtualenv

Now go to the directory where you want to create the project and type

virtualenv --no-site-packages vdjango

now install django

./vdjango/bin/easy_install django

Start a django project

./vdjango/bin/django-admin.py startproject myapp

now to the project directory and run the project.

../vdjango/bin/python manage.py runserver 0.0.0.0:8000

tada!!!!

virtualenv – EnvironmentError: mysql_config not found

So I was setting up virtualenv, during the setup process I was having this very common(!) error when I was trying to install MySQL-python. The solution is bit tricky. Though I found solution like, setting PATH on .profile, but actually that might work for normal installation.

I am on Mac OS 10.6.8 and for me the mysql_config file was in /usr/local/mysql/bin/ directory.

Edit the /bin/activate file from the virtualenv directory and add the following lines,

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
PATH="$PATH:/usr/local/mysql/bin/"
export PATH

then run the following command

source virtualenvDirectory/bin/activate

this will change your path to virtualenv’s bin directory.

now try to install MySQL-python again.

and to undo the changes to $PATH

deactivate virtualenvDirectory/bin/activate

and tada!!!

Setting up mysql and phpmyadmin on Mac OSX

well, I have been using MAMP for quite a long time. It’s a nice app. But then again, if I have native support on my own OS why use an third party app. Heh, actually I need this for some other reason.

Anyway, I am using Snow Leopard (little old though, don’t have money to buy the new one :P )

So, first download the latest version of .dmg from here.

Click mysql-5.5.19-osx10.6-x86_64.pkg (you may have different version) and install by following the screen.

Though this is optional, but I recommend to install MySQLStartupItem.pkg and run the MYSQL.prefPane as well. It will give you a MySQL panel on the System Preference. From here you can start/stop MySQL and also set for automated start upon server startup.

MySQL is accessible from /usr/local/mysql/bin/mysql

Set MySQL password for later use.

/usr/local/mysql/bin/mysqladmin -u root password SECRET

Installing phpmyadmin

Start Apache from System Preference (enable the web sharing). http://localhost should work now.

In Mac OSX PHP is not enabled by default. So enable PHP from /etc/apache2/httpd.conf by uncommenting the LoadModule php5_module        libexec/apache2/libphp5.so line.

Download phpmyadmin from here.

Extract the files into /usr/local/ directory and rename it to phpmyadmin

Copy the config.sample.inc.php and rename it to config.inc.php from the phpmyadmin directory.

Create a file into /etc/apache2/other/ and add the following lines

Alias /phpmyadmin /usr/local/phpmyadmin
<Directory /usr/local/phpmyadmin>
    Options Indexes
    Order allow,deny
    Allow from all
</Directory>

Restart Apache from terminal

apachectl restart

Open http://localhost/phpmyadmin/

tada!!!!

হাসন রাজার দেশে

লালন সাঁইয়ের আখড়া দেখার জন্য অনেকদিন থেকেই ঠিক করছিলাম, কখনও আমার পরীক্ষা কখনও তাসবীর ভাইয়ের অফিস। তো এইবার ঠিক করলাম, যে দুইজনেরই একটু ফ্রি সময় আছে, আখড়া দেখার এইটাই ভালো সুযোগ। বৃহষ্পতিবার দুপুরে প্রায় ১ ঘন্টা বসে ঠিক করলাম আমাদের মধ্যে কে টিকেট কাটতে যাবে, শেষপর্যন্ত দুইজনই গেলাম এবং ট্রেনের টিকেট না পেয়ে চলে আসলাম। তারপর দুই তিনটা বাস কাউন্টারে ফোন করেও টিকেট না পাওয়ার পর, একটু বিরক্ত অবস্থায় চিন্তা করতে থাকি, কি করা যায়। দুইজনের বাসায়ই বলা হয়ে গেছে যে আমরা কুষ্টিয়া যাচ্ছি এবং অনেক কষ্ট করে রাজি করানো হইছে। যাইহোক হাল না ছেড়ে চিন্তা করতে লাগলাম। সিলেট, বান্দরবান আরো কত কি মাথায় আসতে থাকল। অবশেষে সিলেটের প্রতি মন ঠিক হল। বাসায় বলার সাথে সাথে দুইজনের বাসায়ই একটু বিরূপ প্রতিক্রিয়া সৃষ্টি হল, কিন্তু ব্যপারটা মোটামুটি আগে থেকেই ধারনা করতে পারছিলাম বলে কি করবো ওইটাও মাথায় ছিল।

রাত সাড়ে ১০টা, ইউনিক বাস কাউন্টার সায়দাবাদ

টিকেট কাটতে যাবো, তখনই পাশ থেকে এক লোক বলে, “ভাই, একটা বান্দরবানের টিকেট দেন” । লাইট বাল্ব!  আমি সাথে সাথেই তাসবীর ভাইকে বললাম, “ভাই চলেন, বান্দরবান যাই”

যাইহোক, রাত সাড়ে ১১ টার দিকে সিলেটের উদ্দেশ্যে আমাদের বাস ছাড়ল।

ভোর সাড়ে ৫টা, মাজার রোড, সিলেট

মাজার দেখার জন্য ঢুকলাম, কিছুক্ষণ ঘোরাঘুরি করলাম। তারপর কি করব ভাবতে ভাবতে হাঁটতে লাগলাম। সিলেটের একটা ব্যপার বার বারই লক্ষ্য করেছি, মানুষজনের ব্যবহার অনেক ভালো, কেউ বিরক্ত নিয়ে কোন কথার জবাব দেয় না। রাস্তার মোড়ে একটা চায়ের দোকানে গিয়ে জিজ্ঞেস করলাম, শ্রীমঙ্গল কিভাবে যাওয়া যায়। লোকটা আমাদেরকে ট্রেন এবং বাস দুইটাই বলল, কিন্তি যেহেতু আমরা ট্রেনে যাওয়ার ব্যপারে বেশি আগ্রহী ছিলাম, উনি আমাদের একটা রিক্সায় যাওয়ার পরামর্শ দিলেন। মাজার রোড থেকে ট্রেন ষ্টেশন ৩০ টাকা রিক্সা ভাড়া। পথে লন্ডনি ব্রিজ পড়ে, ওখানে রিক্সা ঠেলে উঠিয়ে দেওয়ার জন্য  মানুষ আছে, যারা প্রতিবার ব্রিজের মাঝখান পর্যন্ত রিক্সা উঠিয়ে দেওয়ার জন্য ৫ টাকা করে পায়।

যাইহোক, সকাল ৭টার দিকে শ্রীমঙ্গলের উদ্দেশ্যে আন্তঃনগর পারাবত ট্রেন যায়। আসল ভাড়া কত সঠিক জানি না, আমাদেরকে এক সরকারি কর্মকর্তা তার স্পেশাল ক্ষমতায় ট্রেনের কেবিনে উঠিয়ে দেয়, মাথাপিছু ৬৫ টাকার বিনিময়ে। ছোট ছোট পাহাড়ের মাঝখান দিয়ে চলে গেছে ট্রেন লাইন।
১০টার মধ্যেই আমরা শ্রীমঙ্গল পৌছাই। শ্রীমঙ্গল হিন্দু প্রধান ছোট্ট একটা শহর, যেখানে ছোট হোটেল থেকে শুরু করে কটেজ, সুইট পাওয়া যায় এমন একটা জায়গা। হবিগঞ্জ রোডে বেশকিছু হোটেল আছে, যেটার মধ্যে Tea State Hotel এবং তার পাশেই আরেকটা ভালো দেখতে হোটেল চোখে পড়ে। কিছুটা যাচাই করে কলেজ রোডের Hotel Plaza আমাদের জন্য ভালো মনে হয়। হট ওয়াটার সহ রুম ভাড়া ৮০০ টাকা এবং হট ওয়াটার ছাড়া ৬০০ টাকা।

হোটেলে ৩০ মিনিটের মত থেকে আমরা আবার বের হয়ে পড়ি। উদ্দেশ্য মাধবকুন্ড। লোকাল ট্রেনে করে শ্রীমঙ্গল থেকে কূলাউড়া আড়াই ঘন্টার পথ। তারপর সিএনজি করে ৪২ কিলোমিটারের মত পথ মাধবকুন্ড। ভাড়া আপ-ডাউন ৬০০-৭০০ টাকা। যাওয়ার পথে অতিথি পাখিদের অভয়ারন্য হাকালুকি হাওড়।

মাধবকুন্ড ঝর্ণা

মাধবকুন্ড ঝর্ণা

মাধবকুন্ডের ওইখানে দুপুরের খাওয়া দাওয়া করার পর দেখতে যাই মাধবকুন্ডের বিখ্যাত ঝর্ণা।

পাথরের বিশাল ঝর্ণা বেয়ে অনবরত ঝকঝকে শীতল পানি, না দেখলে আসলে সৌন্দর্যটা অতোটা উপলব্ধি করা যাবে না।

আমি আর তাসবির ভাই

আমি আর তাসবির ভাই

কূলাউড়াও কিন্তু শ্রীমঙ্গলের মতই আরেকটা ছোট্ট উপশহর। ফিরে এসে সিএনজি থেকে নেমে আবার সাড়ে ৬টার লোকাল ট্রেনে করে শ্রীমঙ্গল।  আমরা শ্রীমঙ্গলে থাকার জন্য কিছুটা উল্টা গেছিলাম। শ্রীমঙ্গল ষ্টেশনে নেমেই মাথায় আসে নীলকন্ঠ চায়ের কথা। সাত রংয়ের এই চায়ের কথা অনেকবার শুনেছি। চায়ের উদ্ভাবক মানুষটিও তখন দোকানে উপস্থিত ছিল। সাত রংয়ের এক কাপ চা ৭০ টাকা। ৬ রং, ৫ রং, ৪ রং যথাক্রমে ৬০ টাকা , ৫০ টাকা, ৪০ টাকা। সাত রংয়ের চা, আসলেই সাতটি স্বাদ বহন করে। আমি চায়ের টেস্ট বলে মজা নষ্ট করতে চাই না। দুই কাপ বিখ্যাত চায়ের সাথে আমি আরো একটা স্পেশাল চা টেস্ট করলাম।

সাত রংয়ের চা

সাত রংয়ের চা

হোটেলে ফিরে আসার জন্য রাস্তায় দাড়ায়ে আছি, এক রিক্সা আমাদের দেখে ভূত দেখার মত করে রিক্সা নিয়ে ছুটে পালালো। হা হা হা, সারাজীবন মনে রাখার মত  একটা দৃশ্য। এমনকি আরেকটু হলে সে একটা প্রাইভেট কারের নিচেই পড়ত।

রাতে হবিগঞ্জ রোডের নূর নামের একটা হোটেলে খেয়ে নিই এবং অনেক রাত অবধি ভূতের গল্প করতে থাকি। হেহ, পরে যদিও বাথরুমে যেতে একটু খটকা খটকা লাগতেছিল।

পরদিন সকালে সাড়ে ৬ টার ট্রেন ধরে আমাদের সিলেট যাওয়ার কথা থাকলেও জগতের কিছু অবশ্যম্ভাবী ঘটনার মত আমরাও ট্রেন মিস করি। তারপর, সাড়ে ১০ টার দিকে বাস স্ট্যান্ডে গিয়ে সিলেটের উদ্দেশ্যে রওনা দেই। পৌনে ১টার দিকে সিলেট সোবহানঘাটি পৌছে বাস স্ট্যান্ডের অপর পাশের একটা হোটেলে সকাল আর দুপুরের খাওয়া খেয়ে সাথে সাথেই আবার বাস স্ট্যান্ডে গিয়ে জাফলংয়ের বাসে উঠি।

৫৮ কিলোমিটার অতিক্রম করার পর আবিষ্কার করলাম, যে আমাদের দুইজনের কেউই জানি না, যে আমাদের কোথায় নামতে হবে অথবা আমরা জাফলং কেন আসছি। বেপারটা ঠিক এরকম, সবাই আসে, তাই আমরাও আসছি। :P

তাসবির ভাই

তাসবির ভাই

আমার ঘুম আর তাসবীর ভাইয়ের শূণ্য দৃষ্টি দেখে এক মৌলভী সাহেব বললেন, ” আপনারা তো এইখানের না, পিকনিক স্পটে যাবেন না?” আমরা চিনি না বললে, উনি আমাদের ওইখানেই নামার জন্য বললেন। আমরা ‘মামার দোকান’ নামক একটা জায়গায় নামলাম। তারপর একটু খোঁজ খবর নিয়ে পিকনিক স্পটের দিকে হাঁটা শুরু করলাম। পিকনিক স্পট থেকে নৌকা নিয়ে ওপার গেলাম। ওইখানে একটা ভ্যানওয়ালার সাথে কিছু টাকার চুক্তিতে খাসিয়া পল্লী, চা বাগান, খাসিয়া রাজার বাড়ি, এবং সর্বশেষ জিরো পয়েন্টের কাছাকাছি একটা জায়গাতে গেলাম। নদীর উপরে মেশিন, বালু আর পাথর একাকার অবস্থা। আমরা এইসবের উপর দিয়েই হেঁটে চলে গেলাম নৌকার জন্য। নৌকা দিয়ে পার হওয়ার সময় উপলব্ধি করলাম বাংলাদেশের পাশেই অনেক সুন্দর একটা পাহাড়, পাহাড় কাটা রাস্তা আর পাহাড়ি শহর। চোখ দিয়ে দেখা গেলেও এর সবই ভারতের মধ্যে পড়ে। মাথা খারাপ করা স্বচ্ছ নদীর পানি।

আমি

আমি

নো-ম্যানস ল্যান্ডে কিছুক্ষণ হাঁটাচলা করে সূর্য ডুবি ডুবি অবস্থায় ‘মামার দোকান’ নামক স্থান থেকে বাসে উঠলাম সিলেটের উদ্দেশ্যে।

৭টার দিকে সোবাহান ঘাটি এসে পৌছালাম। ওখান থেকে কিছু দূর হেঁটেই শিশু ক্লিনিকের কাছে ঢাকা আসার ৩/৪ তা বাস কাউন্টার। আমরা ইউনিকের কাউন্টার থেকে সাড়ে ১২টার টিকেত নিয়ে লক্ষ্য করলাম, তখন সাড়ে আটটা বাজে, হাতে অনেক সময়। ব্যাটারী গাড়িতে করে বন্দর বাজার এবং ওইখান থেকে ১২টাকা দিয়ে সিএনজি করে শাহজালাল বিজ্ঞান ও প্রযুক্তি বিশ্ব্যবিদ্যালয়। অল্প আলোয় পুরো ক্যাম্পাস প্রচন্ড নির্জন ও নিরব। আমরা ভিতরে অনেক দূর পর্যন্ত হেঁটে যাই। পরে এক গার্ড বলে শহীদ মিনারের ওইখানে যাওয়া যাবে না, কি নাকি সমস্যা আছে। এখন সমস্যাটা নরমাল না প্যারা নরমাল, এইটা ক্লিয়ার করে বলে নাই।

তারপর আবার একইভাবে আবার সোবহানঘাটি এবং অবশেষে ভোর ৫ টায়  শেষ হল অনেক বেশি uncertain একটা ট্যুর।

ডিজিটাল অক্ষর দিয়ে জ্ঞান শেয়ার করা যায়, কিন্তু অভিজ্ঞতা শেয়ার করা একটু কঠিন। তবে পুরোটাই ছিল একটা অন্য রকম অভিজ্ঞতা। এমন একটা ট্যুর যেখানে একটাই আফসোস, যে এইভাবে  সারা জীবন কাটানো সম্ভব না। তবে বছরে কিছু দিন এইভাবে পার করবো, এইটা মোটামুটি আশা করা যায়।