Tahsin Abrar's WebLog

Think different.. Be Passionate!

Install LAMP Stack on Ubuntu

The acronym of LAMP stands for Linux, Apache, MySQL, and PHP. It’s straight forward to install LAMP on Ubuntu.

To install apache:

sudo apt-get update
sudo apt-get install apache2

To install MySQL:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.

Once you have installed MySQL, we should activate it with this command:

 sudo mysql_install_db 

Finish up by running the MySQL set up script:

 sudo /usr/bin/mysql_secure_installation 

The prompt will ask you for your current root password. Then the prompt will ask you if you want to change the root password. Go ahead and choose N and move on to the next steps.

It’s easiest just to say Yes to all the options. At the end, MySQL will reload and implement the new changes.


Now, to install PHP:

 sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt 

Then restart Apache.

 sudo service apache2 restart 

Install PHPMyAdmin

 sudo apt-get install phpmyadmin apache2-utils 

Restart Apache.

 sudo service apache2 restart 


Install PHP and curl

sudo apt-get -y install php5-cli curl

Install mcrypt and php5-mcrypt

sudo apt-get -y install mcrypt php5-mcrypt

Enable php5-mcrypt

sudo php5enmod mcrypt

Install SQLite

sudo apt-get install php5-sqlite

Enable htaccess in Apache

First enable rewrite using this command:

 sudo a2enmod rewrite 

Then restart apache2:

 sudo service apache2 restart 

Then go into the sites-available folder:

 cd /etc/apache2/sites-available 

Edit the file named default.conf and change AllowOverride none to AllowOverride All. Or, if the Directory part is missing, then put this after DocumentRoot line :

<Directory "/var/www/html">
AllowOverride All

This will make .htaccess work in your server VPS.

This worked on an Ubuntu 14.04.3.

Using MySQL database via command line

If you’re a Unix user, and also a developer, then you’re surely love to do stuff with command line interface. It’s fun to work in a command line interface environment.

Don’t be afraid. It’s easy to use MySQL database for basic operation via command line interface.
To start mysql console:

mysql -u username -p

Then write your password when prompt. It will open the mysql console. After that, in mysql console, you can try these to use basic mysql operations:

  1.   To show all databases: show databases;
  2. To select a database from the database list, write: use <database-name>;
  3. To show tables from the selected database, write: show tables;
  4. To create a new table in the selected database, write:
    CREATE TABLE <table-name> (<field-name> <field-type> (length) );


    CREATE TABLE customers ( id INT (11), name VARCHAR(100), age INT(11), birthday DATE );
  5. To view the table structure, write:
    DESCRIBE <table-name>;


    DESCRIBE customers;
  6. To close the mysql console, write: exit; or \q;

These are the basic operations. By the way, you can use all others database queries with the command line.

Now, if you want to backup one of your database with command line, you can mysqldump. Write:

mysqldump -u username -p db_name > new_file_path_with_name


mysqldump -u username -p testdb > ~/Desktop/testdb.sql

And, if you want to import a file to the database, try:

mysql -u username -p db_name < backup_file.sql

That’s it! Happy coding!

Setting up my Ubuntu for Web Development

Update apt cache

sudo apt-get update

Install Guake Terminal

If you love to work in terminal, then you’ll must love Guake terminal. By pressing F12, you can easily turn on/off the terminal. To install it, run:

sudo apt-get -y install guake

Add Guake to StartUp Applications

After installing Guake terminal, it’ll not start automatically. To start Guake terminal when the machine boot:

Goto System -> Preferences -> Startup Applications.


Dash -> Type: Startup Applications

The Startup Application Preferences window opens. Then, click in Add, give a Name for the Application in the Name field (“Guake” it’s enough), and then type “guake” without quotes in the command field and click Add. Then close the Startup Application Preferences window and restat the machine, now Guake should start automatically on login.

Or, if you want to do it with command prompt, then:

sudo cp /usr/share/applications/guake.desktop /etc/xdg/autostart/


Install dotfiles

If you want to personalize your system, then you can use any of the dotfiles available in github. I’m a fan of mathiasbynens/dotfiles. To use it:

git clone https://github.com/mathiasbynens/dotfiles.git &amp;amp;lt;span class="pl-k"&amp;amp;gt;&amp;amp;amp;amp;&amp;amp;amp;amp;&amp;amp;lt;/span&amp;amp;gt; &amp;amp;lt;span class="pl-c1"&amp;amp;gt;cd&amp;amp;lt;/span&amp;amp;gt; dotfiles &amp;amp;lt;span class="pl-k"&amp;amp;gt;&amp;amp;amp;amp;&amp;amp;amp;amp;&amp;amp;lt;/span&amp;amp;gt; &amp;amp;lt;span class="pl-c1"&amp;amp;gt;source&amp;amp;lt;/span&amp;amp;gt; bootstrap.sh

Install Remarkable (Markdown Editor)

To directly download the Remarkable Editor, go to here.

Or, if you want to download it with terminal, then open the terminal:

 wget https://remarkableapp.github.io/files/remarkable_1.62_all.deb 


Then install the .deb file on your system.

Install Nautilus-open-terminal

sudo apt-get -y install nautilus-open-terminal

Install Unity Tweak Tool

sudo apt-get -y install unity-tweak-tool

Install Unrar

sudo apt-get -y install unrar

Funny story : The Story of Mr. McArthur Wheeler

The Story of Mr. McArthur Wheeler – a man who robbed two banks after covering his face with lemon juice in the mistaken belief that it would make him invisible, because lemon juice is usable as invisible ink.


On one fine morning in Pittsburgh (PA), in the year 1995, a man aged 44, known by the name McArthur Wheeler decided to rob a bank. Since he thought he knew a lot about a peculiar chemical property of lemon juice, he decided to smear the juice on his face before executing his plan to rob the bank.

His logic – As lemon juice can be used to write invisible letters that become visible only when the letter is held close to a heat source, he thought, the same thing would work on his face too. By smearing lemon juice all over his face, he thought that his face would become invisible to the security cameras at the bank. He did not just think that, he was pretty confident about this. He even checked his “trick” by taking a selfie with a polaroid camera. I’m not sure if the film was defective, or the camera wasn’t operated properly, but the camera did give him a blank image. The blank image made him absolutely sure that this trick would work. Or he would not have ever dared to rob a bank with lemon juice on his face.

That day, he went on and robbed not one, but two saving banks in Pittsburgh. A few hours after he had done his job, the police got their hands on the surveillance tape and decided to play it on the 11 O’Clock news. An hour later, an informant identified McArthur in the news video and contacted the police with the man’s name. McArthur got arrested on the same day. Ironically, the same surveillance cameras that he was confident would not be able to capture his face, got him behind the bars. During his interaction with the police, he was incredulous on how his ignorance had failed him.

Two psychologists studied on this story and this effect has since been named the Dunning-Kruger effect after the authors of the study.

If you’ve observed carefully, people who aren’t very good at humour or sarcasm often tell poor jokes and expect people around them to laugh hard. But when people don’t laugh, they seem genuinely shocked. It is incredible to see them totally unaware of how bad they are at it.

At every place, it is a common tendency of the least skilled people to have an inflated sense of self-competency.

“Ignorance sure is a dangerous thing.”

HowTo: Open a Microsoft Access .accdb file in Ubuntu

Recently, I need to run a .accdb file in Ubuntu. I use ubuntu 14.04 LTS version. I tried to run with LibreOffice Base. But failed. And thanks to AskUbuntu. I got the solution from there.


We can use the UCanAccess JDBC driver to connect to Access databases (.mdb and .accdb) in LibreOffice Base. Here’s how I did it on a clean install of Ubuntu 14.04 LTS.

First, I installed LibreOffice Base itself

sudo apt-get install libreoffice-base

Then I downloaded UCanAccess to my Downloads folder and unzipped it.

I launched LibreOffice (not Base, just LibreOffice itself)


and chose Tools > Options


On the Advanced tab I clicked the “Class Path…” button


and then added the following five (5) JAR files using the “Add Archive…” button:



Note that you must close and re-open LibreOffice for the new Class Path values to take effect.

Then I launched LibreOffice Base, and in Step 1 of the wizard I chose “Connect to an existing database (JDBC)”


The Access file I wanted to manipulate was named “baseTest.accdb” in my Downloads folder, so in Step 2 the “Datasource URL” was


and the “JDBC driver class” was



In Step 3, I left the “User name” field empty and just clicked “Next >>”.

In Step 4, I saved the LibreOffice Base database as “accdbTest.odb” in my Documents folder.

When the wizard completed it opened my LibreOffice database and I could see the tables in the .accdb file



This solution is collected from here. Thanks Gord Thompson, you helped me a lot.

Install SQLite on Ubuntu

The default Ubuntu PHP package does not include the PDO SQLite extension. So, whenever we’re using some program that use SQLite, then we get this error – “PDO Driver for SQLite is missing.”

So, How can we install the SQLite PDO extension?

For this, just need to do:

sudo apt-get install php5-sqlite

Next time, you can find it via:

apt-cache search php | grep sqlite

Install Unijoy in Ubuntu

Install Unijoy in Ubuntu 14.04 LTS:

If you want to install unijoy in ubuntu, then follow the procedures:

  1. First, Open Terminal (Ctrl + Alt + T)

  2. Run this command:

sudo apt-get install ibus-m17n m17n-db ibus-gtk m17n-contrib
  1. Verify that unijoy is already there:
sudo dpkg -L m17n-db | grep unijoy
  1. Now that you have installed unijoy, type and enter the following:
ibus-daemon -xdr

It’ll run the ibus daemon to allow the Unijoy layout to appear in Keyboard settings.

  1. Now click the Settings icon at the right top part of your screen, then click System Settings. Now click Text Entry. Click the plus (+) button, search unijoy and select Bengali (unijoy (m17n))


Laravel Installation: The easiest way

First time installing Laravel on Windows seems difficult for someone like me. That’s why, I’m writing step by step procedure on how to install laravel on Windows.

  •  Step-01: Download Composer

    At first, we need to setup the composer. For this, Go to composer’s website and download the Composer-setup.exe file from the Windows installer Section.

  •  Step-02: Install Composer

    Install the composer into your computer. When installing composer, Remember the following:
    — Select “Do not install Shell Menus”
    — Locate the PATH of php.exe , if you’re using XAMP that is installed into your C drive, then the Path is similar to like this: C:\xampp\php\php.exe
    Read More

Learning English – 01

I was reading a post from a Facebook page Learn English, and suddenly I got the idea to note down each new English words or grammatical rules in my blog that we all need to know for learning English. Hopefully this post will also help others to learn English.

# Learning -01: homophones

Homophones are words that sound the same but have a different meaning and spelling.
knew – new
throne – thrown
whole – hole
bored – board
hour – our


# Learning -02: while versus during

‘During’ is a preposition which is used before a noun (during + noun) and it says when something happens.
No one spoke a word during the meeting.

‘While’ is a conjunction that is used to talk about two things that are happening at the same time and is used with a subject and a verb (while + subject + verb).
A dolphin appeared, while we were watching the whales.

  Read More

Using Emmet plugin in Sublime Text & Notepad++

যারা ওয়েব ডেভেলপমেন্টের সাথে জড়িত, তাদের প্রায় সবসময়ই HTML, CSS এর কোডগুলো নিয়ে কাজ করতে হয়। HTML, CSS এর কোডগুলো এমন যে, এগুলো আসলে একই লেখা বারে বারে লিখতে হয়। পুরো কোড টাইপ করে লিখাটা আসলেই অনেক সময় নষ্ট করে ফেলে। এর জন্য ভালো একটা Text Editor থাকলে কাজগুলো অনেক সহজ হয়ে যায়। এরকম একটা Text Editor হচ্ছে Sublime Text Editor.  যদিও প্রথম দিকে কাজ শেখার জন্য পুরো কোড টাইপ করে লিখাটাই শ্রেয়। এবং সেজন্য Notepadd++ Editor ব্যবহার করলে ভালো হয়।

Text Editor এর সাথে আরও কিছু প্লাগইন আছে, যেগুলো ব্যবহার করলে আপনি খুব কম সময়েই অনেক বেশি কোড লিখতে পারবেন। এরকম একটা প্লাগইন হচ্ছে  Emmet । যখন Emmet Plugin ব্যবহার করা শুরু করবেন, তখন মনে হবে আপনি কোড নিয়ে জাদু করছেন। ;) যারা নিয়মিত HTML ফাইল নিয়ে কাজ করেন, তাদের জন্য এটা খুবই কাজের এবং উপকারী। শুধুমাত্র অল্প কিছু কোড লিখে দিলেই পুরো Snippet টা এই প্লাগইনের মাধ্যমে জেনারেট হয়ে যায়।

আমি এখানে Sublime Text Editor এবং Notepad++ Editor এ কিভাবে Emmet Plugin install করতে হয়, সেটা নিয়ে লিখছি।

Read More