May 15, 2008 at 12:08 pm · Filed under Interest, Playground, Resources
When I work on my local machine on a website, I usually setup the virtual host on a sub-domain setup on the localhost. I feel comfortable using a sub-domain rather than setting up an Alias. I’ve seen many people know about it, but there are many who don’t, and this is for them.
So what do you have to do to setup a sub-domain on the localhost? It is not a rocket science but one must know where to do it, especially on a Windows box.
On Windows OS browse to {Drive on which your Windows OS is installed}:/{WINDOWS/WINNT}/system32/drivers/etc/. Open “hosts” file into a text editor, and you will see something similar to this:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
The last line represents the hop any request to http://localhost/ will go through. The IP 127.0.0.1 is used (usually) for you localhost, and going to http://localhost/ will access the files under the root of directory setup for it. Now if you want to setup a sub-domain called “myself”, i.e. http://myself.localhost/, then you add the following line at the end of the file.
127.0.0.1 myself.localhost
On a Linux box, “hosts” file is located under /etc/. You will require “root” access to edit this file or the user access who has priviledge to edit this file. Similar to Windows system, add the following line into the file:
127.0.0.1 myself.localhost
You don’t have to restart your web server for this change to take effect. But you will have to setup the virtual host to point to this sub-domain, which will require you to restart the web server.
Thank You.
May 15, 2008 at 11:39 am · Filed under Interest, Playground, Resources
Ever wanted to redirect users from one domain to other or one sub-domain to other without compromising the the file path or query string variables? I’ve come across the requirement when I published my WordPress blog.
For testing, I initially installed WordPress on a testing sub-domain, where I imported all the blog entries and added blog-roll links. After doing so, PHPClasses.org picked up my entries for Grab Yahoo, LinkMeIn and MySpace profile updater as track-back links. Later when I switched to my main sub-domain, I’d to find a way to keep the track-back links as is, and redirect users to the proper locations. The trick was done by .htaccess file.
After reading the apache’s documentation on mod_rewrite module, I’ve successfully implemented it. If you want people accessing http://sub1.yourdomain.com/2/12/some-post-of-yours/ to go to http://sub2.yourdomain.com/2/12/some-post-of-yours/ then in the root of sub1 (first sub-domain) create a .htaccess file and add the following lines:
RewriteEngine On
RewriteRule (.*) http://sub2.yourdomain.com/$1
I have not read much and not sure if there’s any other option to do this more efficiently; but this trick has served my purpose.
May 14, 2008 at 9:10 pm · Filed under Interest, Playground
My blog is now powered by WordPress. Since I launched my website, since 2000, I’ve always maintained my own design; even I’ve developed a blog so that I can shape it the way I want. But these days I don’t even have time to write something on my blog and to come up with a new design is something that is kind of IMPOSSIBLE.
So, the thing I’ve decided to do is what you see now. I’ve installed WordPress on my server and just finished importing all my blog entries, setup the pages and, of course, choose the theme. Choosing theme was one of the biggest and time consuming part of this whole process. I always like simple but eye catching design. I don’t know if this design is eye catching to you (the reader) but I really liked it. First time I saw this theme on Lokesh Dhakar’s website, developer of Lightbox script used to overlay images.
After installing WordPress, I’ve been trying to explore different things it offers; different plug-ins, themes, widgets etc. I’ve never used WordPress but the experience so far is good. It has some nice features, which I’ve always wanted to implement on my custom made blog. Now that I’ve decided to use WordPress, it will make my life easier, I hope. I know to add a new page or post is going to be smooth but not sure about choosing new theme. I don’t like to hang around with a single design for a long time. I hope that will be smooth as well
Thank you!
March 21, 2008 at 4:33 pm · Filed under Personal News
Here I’m, finally, off to Québec City. Tithi and I planned this trip at the very last minute. Today is Friday and we decided to have this trip on Tuesday. Anyway, both of us were looking forward to this day to start our trip. We didn’t have much time to prepare as Tithi has her class to attend and I’m dead busy with office work. But we managed to get it all together. Packed up, woke up early (although I was hopping to have a good sleep over the long weekend).
Yes, it is long weekend in Canada. For Easter we’ve Friday as vacation followed by Saturday and Sunday. Anyway, this is our first trip to somewhere after we got married. Well, that’s not quite right. We traveled to Canada. Anyway, I’ve always heard that Québec City is a beautiful place. I hope the weather will be good. I’m connected to internet with the train’s on-board WiFi service. Just enjoying the views outside and writing this article.
I really needed this break. Both Tithi and I actually. It feels great to finally go out for a long trip. We’ve thought about it many times but never had a chance to do it. Here are some photos taken from the train so far….I’ll keep posting as my journey continues.




March 10, 2008 at 4:30 am · Filed under Personal News
Oh well, finally, I’m back blogging after a long time. Here I’m with a really great news to share with you all. I’ve finally got my dream machine….my very own Mac Book Pro. Before I show you all the photos, here is the quick look at the specification.
| Processor Type |
Intel Core 2 Duo |
| Screen Size |
15.4 in |
| RAM (Preloaded / Maximum) |
2GB DDR2 SDRAM |
| Hard Drive |
120GB SATA (5400RPM) |
| Optical Drives |
8X SuperDrive |
| Graphics |
128MB NVIDIA GeForce 8600M GT |
| Product Weight |
2.45 kg |
| Audio Type |
Combined Optical Digital Input/Output |
| Battery Type |
Lithium-Polymer |
| Cache |
4MB L2 |
| Network Card |
Built-In 10/100/100BASE-T |
| Pointing Device |
Solid-State Scrolling Trackpad |
| Preloaded Operating System |
MAC OS X V10.4 |
| Processor Speed |
2.2GHz |
| Product Dimensions |
35.7(W) x 2.5(H) x 24.3(D) cm |
| Screen Type |
TFT |
| Speakers |
Built-In Stereo |
| System Bus |
800MHz |
Now let us take a look at the photos…




Backlit keyboard with ambient light sensor for automatic adjustment of keyboard illumination and screen brightness.
So here it is. There are lot more to it that I don’t know, but I will figure out step by step. Loving the unix based OS and finally glad that I am (personally) off the Window$ world.
I would like to thank my wife, Tithi, that she was really supportive in my decision to buy this expensive toy. Well this is the second expensive toy that I’ve bought in last few months; first was my Play Station 3.
I will try to post my experience with the Mac Book Pro as I keep using it. Thanks.
November 22, 2007 at 8:15 pm · Filed under Recent News
As we all know on 15th November Sidr Cyclone has left its mark on Bangladesh with over 3000 deaths and countless damages. Many organisations and people are coming forward to help the cyclone victims. Recently Somewhere In… has taken an initiative. It is a fund raiser program that will allow each and every Bangladeshi people to come forward by simply sending a text message. All you have to do is (if you are in Bangladesh) send an SMS with the text “save” to 5455. You spend 2 taka for the SMS and SWI along with other sponsors will give 15 taka to the Save the Children Cyclone Relief Fund.
For those of you who live abroad cannot participate in this fund raiser program but can donate to Save the Children directly. Go to this URL and you will have option to donate $20 or more. Please come forward and help out.
Thank you.
November 21, 2007 at 6:38 am · Filed under Recent News
কবে তা মনে নাই, কিন্তূ গানটা অনেক ভালো লেগেছিলো প্রথমবার শোনার পর। সানজিব চৌধুরী আর বাপ্পা মাজুমদার এর গাওয়া গানটা মন ছুয়ে যাওয়ার মত। আজ বিকালে অফিস থেকে আসার পর তিথী যখন বল্লো যে “গাড়ী চলে না” গান যে গেয়েছে ও মারা গেছে, মনে করেছি যে হয়তো অন্য কারোর কথা বলছে। পরে অনেক খুঁজে bdnews24.com থেকে জানতে পারলাম যে ঘটোনা সত্যি।
মানুষের জীবনের গাড়ী যে কখন চলা শুরু করে চিরতরে অনেক দূরে চলে যাবে তা কেউ জানে না। সানজিব চৌধুরীর পরিবারের প্রতি রইল আমাদের গভীর সমবেদনা আর ওনার আত্তার প্রতি আমাদের শ্রদ্ধা।
November 8, 2007 at 8:29 am · Filed under Thoughts
কতদিন হলো দেখি না তোকে,
পাই না তোকে হাতের নাগালে
দীর্ঘশ্বাস ফেলে কাটে দিন,
আছিস লুকিয়ে চোখের আঁড়ালে
কতদিন হলো এই মন কাঁদে,
যদি ফিরে পাই সেই দিনটাকে
খোলা বাতাসে আকাশের নীচে,
নিশাচোর হোয়ে সারা রাত জেগে
কতদিন হল পাইনা যে খুঁজে,
সেই চেনা ডাক কানে ভেসে আসে
সেই প্রিয়ো মুখ দুটি চোখে ভেঁসে ওঠে,
রাতের আঁধারে স্বপ্নের ভূবনে
কতদিন হল পারিনি তো বুঝাতে,
এভাবে কি জীবন চেয়েছি সাজাতে
আছে সবি ভালো,
তবুও কি জেনো পিছু ডাকে আমারে
October 25, 2007 at 10:04 pm · Filed under Thoughts
কাঁদা মাখা জীবন
কাঁদা মাখা মন,
কাঁদা মাটি আঁকড়ে ধরে
চেয়ে থাকে মন।
October 5, 2007 at 11:06 pm · Filed under Codes
While developing the web applications with PHP I have made my own small function library. In this library I have few functions that I use very frequently. One of the functions that is used more often is echo_d(). The purpose of this function is to check a variable to see if it is empty or not set; then based on the check result it either prints a default value or the value of the variable.
This is a simple function that saves me a lot of time and keeps my main codes cleaner. So here it is.
function echo_d($var, $def)
{
$var = trim($var);
echo ((isset($var)) && (!empty($var))) ? $var : $def;
}
When to use this function? One of the most common places I use this function is in the reports. When I am generating reports for anything I always have to check whether certain value is in the database; it prints a default value if it cannot find one. The usage of this function in the scenario is something like:
$lastLoginDate = $rowsFromDB['last_login_date'];
echo_d($lastLoginDate, “—”);
This function can be expanded to make it more versatile but I have found this tiny little function very useful.
–
Thank you.
Next entries »