2013 in review


The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 2,300 times in 2013. If it were a cable car, it would take about 38 trips to carry that many people.

Click here to see the complete report.

Fixing grub boot-loader after installing Windows


If you had linux installed and later thought of installing Windows, it will overwrite your grub boot loader by default.

The fix is quick and easy. So, I would like to document the easy steps for reference.

Previously, I wrote for similar fixing but in Bangla উবুন্তু ৯.১০ : কারমিকে আপগ্রেড করায় সৃষ্ট সমস্যা এবং প্রতিকার

For this solution you gotta have a live CD or USB bootable through which you can Run Ubuntu/Lubuntu (or Mint etc debian distros).

1. Boot up your machine with the LiveCD/USB, you can run the installer just to see the device on HDD containing your linux installation.

It would be something like /dev/sda1 and in ext4.

2. If you haven’t run the installer, you can see the partition table using gparted. Press Alt-F2 and type gparted and hit Enter. 

If it tells you that gparted needs root permission then, instead of just ‘gparted’ type in ‘gksu gparted’ and hit enter. If you wanna know about gksu. Now if you have identified your linux’s / folder partition go to next step.

3. On your terminal (hit Ctrl+Alt+T to pop open) type: sudo mount /dev/sdXY /mnt  here, replace X with a,b,h etc as you found above. Y is the number. For mine it was: sudo mount /dev/sda1 /mnt

4. You haven’t done anything destructive or permanent in the above steps. At this step you will try to revive the old grub. If your ‘/’ (root) folder’s location was /dev/sda1, now you will use it as /dev/sda to refer to the device as a whole. NOT WITH NUMBER

So, at the terminal you will type: sudo grub-install –root-directory=/mnt/ /dev/sdX

It it showed success. You are done. Reboot machine and you will see your old grub2 boot loader. But, Windows might not appear there. Dont panic! Go to next step to fix. 🙂

5. Boot up in your good old Ubuntu. And fire up your terminal again. Type: sudo update-grub 

It will fetch your windows to the boot loader as well. Cheers!

USB Startup disk


You just installed Windows over your Ubuntu box and that ruined your boot menu leaving Windows as your only option. So, you are forced to use Windows.

Now, every time that happens you gotta find a reliable link that actually works. So, I decided to blog it instead of just sharing on twitter or FB, which I do millions and I never would go browse them while I am at office or with quality company (I wont like someone stalk behind me or let them think I am wasting time at facebook!).

Enough talks, the only valuable input to this post is, I have used  “Universal USB Installer” and that actually work! Others should work too at this HowToGeek article.

Installing Doctrine2 using PEAR


I was having a some sort of hell trying to install Doctrine via PEAR lately.
$sudo pear channel-discover pear.doctrine-project.org
$sudo pear install -o pear.doctrine-project.org/DoctrineORM

Was giving me errors like:
Package "pear.doctrine-project.org/DoctrineORM" dependency "pear.symfony.com/Console" has no releases
Package "pear.doctrine-project.org/DoctrineDBAL" dependency "pear.symfony.com/Console" has no releases
doctrine/DoctrineORM requires package "pear.symfony.com/Console" (version >= 2.0.0)
doctrine/DoctrineORM requires package "pear.symfony.com/Yaml" (version >= 2.0.0), installed version is 1.0.6
doctrine/DoctrineDBAL requires package "pear.symfony.com/Console" (version >= 2.0.0)
No valid packages found
install failed

See, for some unknown reason the versions are not correct for the dependencies. Tried the solutions as stated in this StackOverflow topic for updating PEAR, but didn’t help!

Tried to remove/purge pear. But it didn’t help. Tried to install the Console, Yaml etc separately, also didn’t help.

Then when I tried to purge pear again I got the following error:

Removing php-pear …
Purging configuration files for php-pear ...
dpkg: warning: while removing php-pear, directory '/usr/share/doc/php5-common/PEAR' not empty so not removed
dpkg: warning: while removing php-pear, directory '/usr/share/php/.channels' not empty so not removed

There were some other folders which was reported to be not empty:
/usr/share/php/.registry/
/usr/share/php/.channels/.alias
/usr/share/php/data
/usr/share/doc/php5-common/PEAR/Archive_Tar/docs
/usr/share/doc/php5-common/PEAR

So, I removed them all!

Now, I again installed pear.

sudo apt-get install php-pear
Fingers crossed…

Added Doctrine channel: sudo pear channel-discover pear.doctrine-project.org
And it didn’t say this time that channel is already in registry. Smiling…

Now to fire up doctrine installation, hope this time it works…
sudo pear install -o pear.doctrine-project.org/DoctrineORM

et viola! it did!
Attempting to discover channel "pear.symfony.com"...
downloading channel.xml ...
Starting to download channel.xml (811 bytes)
....done: 811 bytes
Auto-discovered channel "pear.symfony.com", alias "symfony2", adding to registry
downloading DoctrineORM-2.3.0.tgz ...
Starting to download DoctrineORM-2.3.0.tgz (260,644 bytes)
...done: 260,644 bytes
downloading DoctrineCommon-2.3.0.tgz ...
Starting to download DoctrineCommon-2.3.0.tgz (59,473 bytes)
...done: 59,473 bytes
downloading DoctrineDBAL-2.3.0.tgz ...
Starting to download DoctrineDBAL-2.3.0.tgz (143,996 bytes)
...done: 143,996 bytes
downloading Console-2.1.3.tgz ...
Starting to download Console-2.1.3.tgz (51,354 bytes)
...done: 51,354 bytes
downloading Yaml-2.1.3.tgz ...
Starting to download Yaml-2.1.3.tgz (38,573 bytes)
...done: 38,573 bytes
install ok: channel://pear.doctrine-project.org/DoctrineCommon-2.3.0
install ok: channel://pear.symfony.com/Console-2.1.3
install ok: channel://pear.symfony.com/Yaml-2.1.3
install ok: channel://pear.doctrine-project.org/DoctrineDBAL-2.3.0
install ok: channel://pear.doctrine-project.org/DoctrineORM-2.3.0

Now lets test.
sudo pear list -c pear.doctrine-project.org

Results in:
Installed packages, channel pear.doctrine-project.org:
======================================================
Package Version State
DoctrineCommon 2.3.0 stable
DoctrineDBAL 2.3.0 stable
DoctrineORM 2.3.0 stable

Now, try doctrine at terminal:
lenin@office:/usr/share/php/.channels$ doctrine
Doctrine Command Line Interface version 2.3.0

Usage:
 [options] command [arguments]
Options:
 --help -h Display this help message.
 --quiet -q Do not output any message.
 --verbose -v Increase verbosity of messages.
 --version -V Display this application version.
 --ansi Force ANSI output.
 --no-ansi Disable ANSI output.
 --no-interaction -n Do not ask any interactive question.
Available commands:
 help Displays help for a command
 list Lists commands
 dbal
 dbal:import Import SQL file(s) directly to Database.
 dbal:run-sql Executes arbitrary SQL directly from the command line.
 orm
 orm:clear-cache:metadata Clear all metadata cache of the various cache drivers.
 orm:clear-cache:query Clear all query cache of the various cache drivers.
 orm:clear-cache:result Clear all result cache of the various cache drivers.
 orm:convert-d1-schema Converts Doctrine 1.X schema into a Doctrine 2.X schema.
 orm:convert-mapping Convert mapping information between supported formats.
 orm:ensure-production-settings Verify that Doctrine is properly configured for a production environment.
 orm:generate-entities Generate entity classes and method stubs from your mapping information.
 orm:generate-proxies Generates proxy classes for entity classes.
 orm:generate-repositories Generate repository classes from your mapping information.
 orm:info Show basic information about all mapped entities
 orm:run-dql Executes arbitrary DQL directly from the command line.
 orm:schema-tool:create Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output.
 orm:schema-tool:drop Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output.
 orm:schema-tool:update Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.
 orm:validate-schema Validate the mapping files.

So, thats it.

কালীগঞ্জ, গাজীপুর এবং নারায়ণগঞ্জ ভ্রমণ


Image0115Image0120Image0119Image0118Image0117Image0116
Image0121Image0126Image0125Image0124Image0123Image0122
রাঙ্গামাটিয়া, কালীগঞ্জImage0129Image0130Image0128Image0132Image0134
Image0133Image0137Image0138Image0136Image0135Image0141

This visit was mainly to Kaligonj upazilla of Gazipur (btw dont get confused that if I am from Gazipur because my name is Ghazi [notice the spelling!] 😉 ). I am in fact descendant of Ghazi family of Dohar upazilla of Dhaka.

While returning we decided that we’d take different route and will not come back through Uttara. Rather we traveled via Dhaka bypass road and Kanchan bridge then we visited historical Murapara College of Narayangonj. In total it was a 100km round trip to Gazipur.

We visited 4/5 chapels and churches of Kaligonj upazilla.

My escort was Pervez Robin of Joypara, Dohar. Who actually initiated this travel idea. So, all thanks goes to him.