<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Tahsin Abrar's Blog</title>
 <link href="http://tahsinabrar.github.io/atom.xml" rel="self"/>
 <link href="http://tahsinabrar.github.io/"/>
 <updated>2026-11-13T17:53:30+00:00</updated>
 <id>http://tahsinabrar.github.io</id>
 <author>
   <name>Tahsin Abrar</name>
   <email>abrar.cste@gmail.com</email>
 </author>

 
 <entry>
   <title>Create Virtual Host on Ubuntu</title>
   <link href="http://tahsinabrar.github.io/2016/09/17/create-virtual-host/"/>
   <updated>2016-09-17T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2016/09/17/create-virtual-host</id>
   <content type="html">&lt;p&gt;Suppose, You want to create a virtual host for your laravel project like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;project.dev&lt;/code&gt;. To create a virtual host for a project, you need to follow the steps below:&lt;/p&gt;

&lt;p&gt;For Ubuntu LAMP, Open &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/ete/apache2/sites-available/00-default.conf&lt;/code&gt; and add this:&lt;/p&gt;

&lt;p&gt;Or,  create a new file i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/apache2/sites-available/project.dev.conf&lt;/code&gt; and insert the snippet:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
    ServerAdmin admin@admin.com
    DocumentRoot /var/www/html/project/public
    ServerName  project.dev

    &amp;lt;Directory /var/www/html/project/public&amp;gt;
          Options Indexes FollowSymLinks
         AllowOverride All
          Require all granted
    &amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then open &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/hosts&lt;/code&gt; file, and add this line under localhost line:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;127.0.0.1     project.dev&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you create a new file in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/apache2/sites-available&lt;/code&gt; directory, then you need to enable the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conf&lt;/code&gt; file by:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo a2ensite project.dev.conf&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By the way, if you didn’t enable rewrite mode for using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;htaccess&lt;/code&gt; in apache yet, then:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo a2enmod rewrite&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Create Laravel Project in an existing directory on Ubuntu</title>
   <link href="http://tahsinabrar.github.io/2015/11/18/create-laravel-project-in-existing-directory/"/>
   <updated>2015-11-18T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/11/18/create-laravel-project-in-existing-directory</id>
   <content type="html">&lt;p&gt;Installing Laravel with laravel global command is too easy.&lt;br /&gt;
We just need to do &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;laravel new projectName&lt;/code&gt;. That’s it!&lt;/p&gt;

&lt;p&gt;But what will happen if we create a new folder first and then try laravel global command to get the laravel files within that directory?&lt;/p&gt;

&lt;p&gt;It is not possible in a single command, because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;laravel new&lt;/code&gt; need a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;name&lt;/code&gt; parameter and it’ll create a new folder within the directory. To install laravel within the existing current directory, we need to install laravel first into a new folder and then move all the files from that directory to new directory.&lt;/p&gt;

&lt;p&gt;That means we need more than one command to do it. That’s why I write a script that will create new laravel project within an existing directory. Thus, you can do all the process only by running the script. &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Here is a script that will install laravel in your existing directory:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/TahsinAbrar/fc67c3ef50da63e43da9.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;br /&gt;
Now, If you want to create an alias for running this shell script file, you can do that by editing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bashrc&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bash_profile&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.aliases&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Add this line for creating an aliases: (If the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;laravel.sh&lt;/code&gt; file exists in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~&lt;/code&gt; directory. )&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;alias laranew=&quot;~/laravel.sh&quot;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then just run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;laranew&lt;/code&gt; to anywhere you want to install laravel.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Change Server Name on Ubuntu</title>
   <link href="http://tahsinabrar.github.io/2015/10/30/change-server-name-on-ubuntu/"/>
   <updated>2015-10-30T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/10/30/change-server-name-on-ubuntu</id>
   <content type="html">&lt;p&gt;When we install ubuntu on our System, it shows as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;userName@serverName&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The default &lt;em&gt;server/computer&lt;/em&gt; name was set when you were installing Ubuntu. You can easily change it to whatever you want in both Desktop &amp;amp; Server by editing the hosts and hostname files.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;To do this temporarily until next boot, follow the instructions:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl +Alt + t&lt;/code&gt; on keyboard to open the terminal. When it opens, run the below command:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo hostname NEW_NAME_HERE&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will temporarily change the hostname until next reboot. The change won’t be visible immediately in your current terminal. You can start a new terminal to see the new temporary hostname.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;To change the name permanently,
run the following command to edit the host files:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo gedit /etc/hostname /etc/hosts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For Ubuntu server without a GUI, run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo vi /etc/hostname&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo vi /etc/hosts&lt;/code&gt; and edit them one by one. In both files, change the name to what you want and save them.&lt;/p&gt;

&lt;p&gt;Finally, restart your computer to apply the changes.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>File Permission for project release</title>
   <link href="http://tahsinabrar.github.io/2015/10/29/file-permission-for-product-release/"/>
   <updated>2015-10-29T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/10/29/file-permission-for-product-release</id>
   <content type="html">&lt;p&gt;Before launching a project, it’s difficult to check each and every files and directories of the project. It’ll be easier if there is any command that will automatically set the same permission for all of the files and directories.&lt;/p&gt;

&lt;p&gt;To do this, Open your project root directory in the Terminal ( Ctrl+Alt+T ) and run the following command to reset your file permission:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;find &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;nt&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;644 &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And to reset  the directory permission :&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;find &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-type&lt;/span&gt; d &lt;span class=&quot;nt&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;755 &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That’s it! Now all the directories within the project get 755 permission and all of the files get 644 permission. Now, you can easily deploy your project without any security hole.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Using MySQL database via CLI</title>
   <link href="http://tahsinabrar.github.io/2015/10/28/using-mysql-database-via-cli/"/>
   <updated>2015-10-28T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/10/28/using-mysql-database-via-cli</id>
   <content type="html">&lt;p&gt;If you’re a Unix user, and also a developer, then you’re surely love to do stuff with &lt;em&gt;command line interface (CLI)&lt;/em&gt;. It’s fun to work in a command line interface environment.&lt;/p&gt;

&lt;p&gt;Don’t be afraid. It’s easy to use MySQL database for basic operation via command line interface.&lt;/p&gt;

&lt;p&gt;To start mysql console, open your terminal by pressing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl + Alt + T&lt;/code&gt; and write: 
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mysql -u username -p&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then write your mysql password when prompt. It will open the mysql console.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Type &apos;help;&apos; or &apos;\h&apos; for help. Type &apos;\c&apos; to clear the current input statement.
mysql&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After that, in mysql console, you can try these to use basic mysql operations:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;To show all databases: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;show databases;&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To select a database from the database list, write: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;use &amp;lt;database-name&amp;gt;;&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show tables from the selected database, write: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;show tables;&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To create a new table in the selected database, write:&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CREATE TABLE &amp;lt;table-name&amp;gt; (&amp;lt;field-name&amp;gt; &amp;lt;field-type&amp;gt; (length) );&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;  &lt;span class=&quot;k&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;customers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;VARCHAR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;age&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;INT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;birthday&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;DATE&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;To view the table structure, write: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DESCRIBE &amp;lt;table-name&amp;gt;;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;example: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DESCRIBE customers;&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;And, now if you want to close the mysql console, write: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exit;&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\q;&lt;/code&gt; on the mysql console.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;These are the basic operations. By the way, you can use all others database queries with the command line.&lt;/p&gt;

&lt;p&gt;Now, if you want to backup one of your database with command line, you can use mysqldump.
Open the terminal by pressing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+Alt+T&lt;/code&gt; and write:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;  &lt;span class=&quot;n&quot;&gt;mysqldump&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;db_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;new_file_path_with_name&lt;/span&gt;
  &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;  &lt;span class=&quot;n&quot;&gt;mysqldump&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;testdb&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;~/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Desktop&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;testdb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sql&lt;/span&gt;
  &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And, if you want to import a file to the database, open the terminal and try:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;  &lt;span class=&quot;n&quot;&gt;mysql&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;db_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;backup_file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sql&lt;/span&gt;
  &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That’s it! Happy coding!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Install LAMP Stack on Ubuntu</title>
   <link href="http://tahsinabrar.github.io/2015/10/27/install-lamp-on-ubuntu/"/>
   <updated>2015-10-27T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/10/27/install-lamp-on-ubuntu</id>
   <content type="html">&lt;p&gt;The acronym of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LAMP&lt;/code&gt; stands for Linux, Apache, MySQL, and PHP. It’s straight forward to install LAMP on Ubuntu.&lt;/p&gt;

&lt;p&gt;To install apache:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install apache2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To install MySQL:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Once you have installed MySQL, we should activate it with this command:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo mysql_install_db&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finish up by running the MySQL set up script:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo /usr/bin/mysql_secure_installation&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;It’s easiest just to say Yes to all the options. At the end, MySQL will reload and implement the new changes.&lt;/p&gt;

&lt;p&gt;Now, to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PHP&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then restart Apache.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo service apache2 restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PHPMyAdmin&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get install phpmyadmin apache2-utils&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Restart Apache.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo service apache2 restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PHP&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get -y install php5-cli curl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install mcrypt and php5-mcrypt&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get -y install mcrypt php5-mcrypt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Enable php5-mcrypt&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo php5enmod mcrypt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install SQLite&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get install php5-sqlite&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Enable htaccess in Apache&lt;/p&gt;

&lt;p&gt;First enable rewrite using this command:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo a2enmod rewrite&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then restart apache2:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo service apache2 restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then go into the sites-available folder:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /etc/apache2/sites-available&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;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 :&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;Directory &quot;/var/www/html&quot;&amp;gt;
AllowOverride All
&amp;lt;/Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will make &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.htaccess&lt;/code&gt; work in your server VPS.&lt;/p&gt;

&lt;p&gt;This worked on an Ubuntu 14.04.3.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Set Proper permission for upload folder</title>
   <link href="http://tahsinabrar.github.io/2015/10/23/proper-permission-for-upload-folder/"/>
   <updated>2015-10-23T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/10/23/proper-permission-for-upload-folder</id>
   <content type="html">&lt;h3 id=&quot;what-are-the-proper-permissions-for-an-upload-folder-with-phpapache&quot;&gt;What are the proper permissions for an upload folder with PHP/Apache?&lt;/h3&gt;

&lt;p&gt;The proper permission for an upload folder is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;775&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But sometimes only giving &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chmod 775 -R folders/path&lt;/code&gt; and change ownership of the folder doesn’t work when we’re trying to upload a file to that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;folders/path&lt;/code&gt;. For this, we’ve to bind the apache &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www-data&lt;/code&gt; group with our user.&lt;/p&gt;

&lt;p&gt;Before telling how to bind the apache &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www-data&lt;/code&gt; group with our existing user, we can review the basic understanding of how to add new user/existing user to a group. If you’ve the basic understanding, &lt;a href=&quot;#target&quot;&gt;&lt;mark&gt;click here&lt;/mark&gt;&lt;/a&gt; to skip it.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Change ownership of a folder: To change the ownership of the folder,&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chown userName:groupName -R folder/path&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;How to Add a new user to a group:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo adduser user group&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;small&gt;Remember this will add a new user to a group.&lt;/small&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Removing a user from a group:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo deluser user group&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;useradd&lt;/code&gt; command will try to add a new user. To modify an existing user, like adding that user to a new group, use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;usermod&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Try this:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo usermod -a -G groupName userName&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The user will need to logout and log back in to see their new group added.&lt;/p&gt;

&lt;div id=&quot;target&quot;&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
  Now, after changing folder permission and changing ownership of the folder, if you can’t upload files with the browser, change the folder ownership with apache &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www-data&lt;/code&gt; group :&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo chown userName:groupName -R folder/path&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For me, it is: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo chown abrar:www-data -R upload/folder/path&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;small&gt;Because my userName is abrar.&lt;/small&gt;&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Working with Git - Git LifeHacks</title>
   <link href="http://tahsinabrar.github.io/2015/10/22/git-lifehacks/"/>
   <updated>2015-10-22T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/10/22/git-lifehacks</id>
   <content type="html">&lt;h3 id=&quot;git-basic&quot;&gt;Git Basic:&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;To add all the changes for commit : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git add -A&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;For commit : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git commit -m &quot;Your commit message&quot;&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;For commit with all the changes in a single line :&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git commit -am &quot;Your commit message&quot;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;small&gt;With this, you don’t need to write &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git add -A&lt;/code&gt;&lt;/small&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To push from the remote : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git push origin branchName&lt;/code&gt;&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;&lt;small&gt;Just for understanding,&lt;/small&gt;&lt;/p&gt;

      &lt;p&gt;&lt;small&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;origin&lt;/code&gt; is an alias on your system for a particular remote repository. It’s not actually a property of that repository.&lt;/small&gt;&lt;/p&gt;

      &lt;p&gt;&lt;small&gt;By doing  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git push origin branchname&lt;/code&gt;&lt;/small&gt;&lt;/p&gt;

      &lt;p&gt;&lt;small&gt;you’re saying to push to the origin repository. There’s no requirement to name the remote repository origin: in fact the same repository could have a different alias for another developer.&lt;/small&gt;&lt;/p&gt;

      &lt;p&gt;&lt;small&gt;Remotes are simply an alias that store the url of repositories. You can see what url belongs to each remote by using&lt;/small&gt;&lt;/p&gt;

      &lt;p&gt;&lt;small&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git remote -v&lt;/code&gt;&lt;/small&gt;&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show the changes that you made after the last commit, run : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git diff&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show the changes which have been staged, run : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git diff --cached&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git status -v&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show all the changes from HEAD which have been staged and also which have been not committed yet, run : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git diff HEAD&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show all the previous commits in terminal, run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git log&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show all the previous commits messages only in terminal , run:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git log --oneline&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;small&gt;Display commit with graph tree: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git log --oneline --graph&lt;/code&gt;&lt;/small&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show all commits with reference log, run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git reflog&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To show only few of the previous commits in terminal, run:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git log -&amp;lt;number&amp;gt;&lt;/code&gt; i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git log -2&lt;/code&gt; for last two commits.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To remove a file from git repo, run : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git rm filename&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To move/rename a file, run :&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git mv current/file/path new/path/of/file&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;To clean the current working directory from the last commit,&lt;/p&gt;

    &lt;p&gt;run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git clean -f&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;advanced-git&quot;&gt;Advanced Git:&lt;/h2&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;how-to-reference-a-commit-to-the-issue-using-smart-commit-&quot;&gt;How to reference a commit to the issue (Using Smart commit) ?&lt;/h4&gt;
    &lt;p&gt;&lt;br /&gt;
When commit, just include &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#commit IssueNo&lt;/code&gt; with the commit.&lt;/p&gt;

    &lt;p&gt;i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git commit -m &quot;You commit message&quot; #comment Issue-No&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;or, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git commit -m &quot;Issue-No: You commit message&quot; #comment Issue-No&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;how-to-push-a-new-empty-branch-in-remote&quot;&gt;How to push a new, empty branch in remote?&lt;/h4&gt;

    &lt;p&gt;If your repo is still empty, you might try and create an empty commit, to have something to push:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git commit --allow-empty -m &quot;initial commit&quot;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;Then  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git push -u origin branchName&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;how-to-add-a-remote-branch-url&quot;&gt;How to add a remote branch url?&lt;/h4&gt;
    &lt;p&gt;&lt;br /&gt;
To add remote branch:
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git remote add origin &amp;lt;remote-url&amp;gt;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;or, to add another remote branch alongside with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;origin&lt;/code&gt;,&lt;/p&gt;

    &lt;p&gt;run:  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git remote add app &amp;lt;remote-url&amp;gt;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;small&gt;&lt;strong&gt;N.B.&lt;/strong&gt; Here &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;app&lt;/code&gt; can be any name.&lt;/small&gt;&lt;/p&gt;

    &lt;p&gt;To change the remote url:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git remote set-url &amp;lt;appname&amp;gt; &amp;lt;new-remote-url&amp;gt;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;i.e.&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git remote set-url origin https://github.com/laravel/laravel.git&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;how-to-delete-a-branch-&quot;&gt;How to Delete a branch ?&lt;/h4&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git branch -d &amp;lt;branchname&amp;gt;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;Forcefully delete: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git branch -D &amp;lt;branchname&amp;gt;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;how-to-create-a-new-branch-from-the-existing-code-&quot;&gt;How to create a new branch from the existing code ?&lt;/h4&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git checkout -b &amp;lt;newBranchName&amp;gt;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;how-to-delete-last-git-commit-&quot;&gt;How to Delete Last Git Commit ?&lt;/h4&gt;
    &lt;p&gt;&lt;br /&gt;
If you have committed junk but not pushed,&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git reset --soft HEAD~1&lt;/code&gt; will do the work.&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;&lt;small&gt;If you want to get rid of any changes to tracked files in the working tree since the commit before head use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--hard&lt;/code&gt; instead.&lt;/small&gt;&lt;/p&gt;
    &lt;/blockquote&gt;

    &lt;p&gt;&lt;br /&gt;
Now if you already pushed and someone pulled which is usually my case, you can’t use git reset. You can however do a git revert,&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git revert HEAD&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;This will create a new commit that reverses everything introduced by the accidental commit.&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;&lt;small&gt;&lt;strong&gt;N.B.&lt;/strong&gt; Remember, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git revert&lt;/code&gt; will not remove your last commit. It will just create another new commit by fixing the last commit.&lt;/small&gt;&lt;/p&gt;
    &lt;/blockquote&gt;

    &lt;p&gt;&lt;br /&gt;
To delete the git commit from remote branch completely, you’ve to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git rebase&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git rebase -i &amp;lt;commit-number&amp;gt;&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;how-to-remove-a-file-from-the-git-stage-&quot;&gt;How to remove a file from the git stage ?&lt;/h4&gt;

    &lt;p&gt;If you do &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git add filename&lt;/code&gt;, the file will be in stage. So, to remove the file from stage, run:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git reset HEAD filename&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;And then if you want to remove the changes of a single file, run:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git checkout filename&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;h4 id=&quot;git-stash&quot;&gt;Git Stash&lt;/h4&gt;
    &lt;p&gt;You’re in the middle of some changes but something comes up that you need to jump over to, like a so-urgent-right-now bugfix, but don’t want to commit or lose your current edits. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git stash&lt;/code&gt; is there for you.&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;Run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git stash&lt;/code&gt; to make the working repository clean.
And It will then leave you at the state of the last commit.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git stash pop&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git stash apply&lt;/code&gt; to bring back the stashed code into the working directory.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git stash list&lt;/code&gt; to show the lists of stash items.&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Setting up Ubuntu for Web Development</title>
   <link href="http://tahsinabrar.github.io/2015/10/20/setting-up-ubuntu-for-web-development/"/>
   <updated>2015-10-20T00:00:00+00:00</updated>
   <id>http://tahsinabrar.github.io/2015/10/20/setting-up-ubuntu-for-web-development</id>
   <content type="html">&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Update apt cache : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get update&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Upgrade apt cache : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get upgrade&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Install Guake Terminal :&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;If you love to work in terminal, then you’ll must love Guake terminal. By pressing &lt;code&gt;F12&lt;/code&gt;, you can easily turn on/off the terminal.&lt;/p&gt;

    &lt;p&gt;To install guake terminal, run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get -y install guake&lt;/code&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;&lt;strong&gt;Add Guake to StartUp Applications&lt;/strong&gt;&lt;/p&gt;

        &lt;p&gt;After installing Guake terminal, it’ll not start automatically on boot. To start Guake terminal when the machine boot:&lt;/p&gt;

        &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Goto System -&amp;gt; Preferences -&amp;gt; Startup Applications&lt;/code&gt;&lt;/p&gt;

        &lt;p&gt;or  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Dash (Window button) -&amp;gt; Type: Startup Applications&lt;/code&gt;&lt;/p&gt;

        &lt;p&gt;The Startup Application Preferences window opens. Then, click in &lt;strong&gt;Add&lt;/strong&gt;, give a Name for the Application in the Name field (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;Guake&quot;&lt;/code&gt; it’s enough), and then type &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;guake&lt;/code&gt; in the command field and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

        &lt;p&gt;&lt;img src=&quot;https://googledrive.com/host/0B1rwm2Ee_JqOR05TWHVkYkJwTW8&quot; alt=&quot;On Startup load Guake Terminal&quot; /&gt;&lt;/p&gt;

        &lt;p&gt;Then close the Startup Application Preferences window and restat the machine, now Guake should start automatically on login.&lt;/p&gt;

        &lt;p&gt;Or, if you want to do it with command prompt, then:&lt;/p&gt;

        &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo cp /usr/share/applications/guake.desktop /etc/xdg/autostart/&lt;/code&gt;&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Install dotfiles&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;If you want to personalize your system, then you can use any of the dotfiles available in github. I’m a fan of &lt;a href=&quot;https://github.com/mathiasbynens/dotfiles&quot;&gt;mathiasbynens/dotfiles&lt;/a&gt;.&lt;/p&gt;

    &lt;p&gt;To use it (in a single command):&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;    git clone https://github.com/mathiasbynens/dotfiles.git &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;dotfiles &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;source &lt;/span&gt;bootstrap.sh
  &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Install Remarkable (Markdown Editor)&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;To directly download the Remarkable Editor, go to their &lt;a href=&quot;https://remarkableapp.github.io/&quot;&gt;official website&lt;/a&gt;.&lt;/p&gt;

    &lt;p&gt;Or, if you want to download it with terminal, then open the terminal:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wget https://remarkableapp.github.io/files/remarkable_1.62_all.deb&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;Then install the .deb file on your system.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install Unity Tweak Tool&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get -y install unity-tweak-tool&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install Unrar&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get -y install unrar&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install Vim Editor&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get -y install vim&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Install Git&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get -y install git&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Setup SSH key :&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Open the terminal and write:  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh-keygen&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;Press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Enter&lt;/code&gt; for options. If you want to add a passphrase for the key, then insert the passphrase, otherwise skip it by pressing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Enter&lt;/code&gt;.&lt;/p&gt;

    &lt;p&gt;To copy the public SSH key to the clipboard, run:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xclip -sel clip &amp;lt; ~/.ssh/id_rsa.pub&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;If you want to check if any SSH key exists, then on terminal:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls -al ~/.ssh&lt;/code&gt;&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;It will lists the files in your .ssh directory, if they exist.&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Install LAMP Stack :&lt;/strong&gt;
Check this &lt;a href=&quot;http://tahsinabrar.github.io/2015/10/27/install-lamp-on-ubuntu/&quot;&gt;tutorial&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Install Bower&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm install -g bower&lt;/code&gt;&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;Bower requires &lt;a href=&quot;https://nodejs.org/&quot;&gt;nodejs&lt;/a&gt; and git pre-installed on the system.&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Install Composer Globally :&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Run these commands to globally install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;composer&lt;/code&gt; on your system:&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -sS https://getcomposer.org/installer | php&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mv composer.phar /usr/local/bin/composer&lt;/code&gt;&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;Note: If the above fails due to permissions, run the mv line again with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo&lt;/code&gt;.&lt;/p&gt;
    &lt;/blockquote&gt;

    &lt;p&gt;To check if composer successfully installed on your system,&lt;/p&gt;

    &lt;p&gt;run : &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;composer&lt;/code&gt; in terminal and you’ll see a list of helpful commands.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 

</feed>
