Sunday, April 23, 2017

[SOLVED] - Connecting to Amazon EC2 Instance from Terminal in Ubuntu using SSH

This tutorial shows you how to connect to your Amazon EC2 Instance from your Ubunut's terminal/CLI by making use of SSH.

NOTE: if you have not installed a tool like OpenSSH in your Ubuntu system you may do so by checking out the following tutorial: or use a tool like PuTTY.

1. First down the EC2 Key Pair Private Key for your EC2 instance. To generate Key Pair, you may check the following tutorial:

2. Copy the Key pair (.pem) key to the location of your choice and make note of the location path. In my case, I created a folder called 'aws-keys' under my 'home' directory and placed the '.pem' file there.

3. Open your terminal & change the file/folder permission to 600 where you have stored your '.pem' key, else you will get an error as shown in the image below:

Click image to enlarge
NOTE: since you have changed 'file permission' to 600, you will have to use sudo.

 $ sudo chmod -R 600 aws-keys  

 4. Now enter the following commands to connect to your AWS EC2 Instance:

 sudo ssh -i file_name.pem ec2-user@<publicDNS>  

You can find your publicDNS in your EC2 Dashboard. Please refer image below:

Click image to enlarge
If login is successful you will see a message similar to the one show in the image below, depending upon your Amazon Machine Image (AMI).

Click image to enlarge

Uninstalling LibreOffice from Ubuntu using Terminal/Command Line

Please follow the instruction below to Uninstall LibreOffice from your Ubuntu system:

 sudo apt-get remove --purge libreoffice*  
 sudo apt-get clean  
 sudo apt-get autoremove  

Installing LibreOffice in Ubuntu from .deb Packages using Terminal

This tutorial will show you how to install the latest version of LibreOffice in your Ubuntu system. If you haven't downloaded the latest build for LibreOffice, go ahead do it at:

1. When you unpack the downloaded archive, you will see that the contents have been decompressed into a sub-directory.

2. Now,change directory to the one starting with "LibreOffice_", followed by the version number and some platform information. Example:

 $ cd LibreOffice_5.3.2.2_Linux_x86-64_deb  

4. This directory contains a subdirectory called "DEBS". Change directory to the "DEBS" directory.

 $ cd DEBS  

5. Now open your terminal (CTRL+ALT+T) and enter as below.The following commands will install LibreOffice and the desktop integration packages (you may just copy and paste them into the terminal screen rather than trying to type them):

 $ sudo dpkg -i *.deb  

The installation process is now completed, and you should have icons for all the LibreOffice applications in your desktop's Applications/Office menu. You may also open your Unity Dash & start LibreOffice from there.

To uninstall LibreOffice,

Please check my other tutorial at:

Friday, April 7, 2017

Lesson 1- Introduction to Amazon Elastic Compute Cloud (EC2)

This video gives you a clear understanding of the basics of Amazon EC2 web services.

Sunday, March 26, 2017

[SOLVED] - Add Currently Logged in User to Apache User & Group [www-data:www-data]

If you are experiencing permission issues with your web directories and files, use the following commands to resolve it, This solution is very helpful if you are trying to run Wordpress/Other CMS in localhost environment:

1. Adds the currently logged in user to the www-data group.

 sudo usermod -aG www-data $USER  

2. Changes the ownership of the /var/www directory to www-data group.
 sudo chown -R www-data:www-data /var/www directory_name

3. Sets the proper permissions so you can upload files via sftp, manage files via command-line, and upload plugins and media directly in WordPress.
 sudo chmod -R 774 /var/www directory_name

Saturday, March 11, 2017

How to Zip/Compress files using Terminal in Ubuntu/Linux

Use the following commands to compress your files using terminal. First, make sure you have Zip already installed in your system.

>> To install Zip: Open you terminal (CTRL+ALT+T) and enter the command below:
 sudo apt-get install zip gzip tar  

>> To Zip:
 zip -r foldername  

  • r: recursive
  • filename of the compressed-file that you are creating
  • folder_name: filename of folder that you want to compress
Seems to be much faster and consume almost 80%-90% less CPU processes than the one using GUI/Archive Manager.; but file size seems to be large by 10-20 MB than the one created using the menu option available in GUI/Archive Manager.

>> To Unzip:

Zip stores relative path names by default. There are several parameter-options available for zip. For that read: the manual (man zip). For a starting this will do.

Most often you will see .tar.gz endings in linux-world. That's the product of two tools: TAR (the tape archiver) and GZIP (the GNU-Zip). Tar has got the call option to automatically gzip/gunzip files after "taring".
 tar -cvzf may_arch.tar.gz my_folder  

  • -c means "create"
  • -v means "verbose" (sometimes bothersome and slowing down...)
  • -z means "use (GNU)zip"
  • -f XYZ declares the name of the output file. (You should chose a helping name like XYZ.tar.gz)
There may also be .tar.bz2 endings. This is the product of the -j parameter instead of the -z parameter: you will choose compression with BZIP2 (-> man bzip2).

To extract you simply use -x (eXtract) instead of -c (Create):
 tar -xvzf may_arch.tar.gz  

Wednesday, March 8, 2017

[SOLVED] - W: GPG error: .. The following signatures were invalid: BADSIG ... Ubuntu Extras Archive Automatic Signing Key

While trying to UPDATE/UPGRADE your Ubuntu system from the terminal, you might be bumping, time and again into what is called the BAD SIGNATURE error. Something like this:

W: GPG error: trusty Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key <>

To solve the bad signature error in your Ubuntu Installation try the following solution:
 sudo apt-key adv --keyserver --recv-keys your_key_number  
 Example: sudo apt-key adv --keyserver --recv-keys 16126D3A3E5C1192  
Rebuild your software cache:
 sudo apt-get clean   
 cd /var/lib/apt   
 sudo mv lists oldlist   
 sudo mkdir -p lists/partial   
 sudo apt-get clean   
 sudo apt-get update  
If the above solution doesn't work, you may try the solution below:
 $ sudo -i  
 # apt-get clean  
 # cd /var/lib/apt  
 # mv lists lists.old  
 # mkdir -p lists/partial  
 # apt-get clean  
 # apt-get update  

Sunday, February 26, 2017

Enabling Multi-byte UTF-8 support in Drupal 7

This tutorial explains the various steps to enable Multi-byte UTF-8 support in Drupal 7. It's a very simple and straightforward process and if implemented rightly, you can easily convert your 'character set' & collation to

According to this post in, multi-byte UTF-8 support for MySQL and other database drivers, allows emojis, Asian symbols, mathematical symbols, etc with your Drupal 7 installation. The only caveat to this is that your Drupal installation must be at least Version 7.50 or higher.

  •  Drupal: Version 7.50 or above
 Initially when you check your Drupal Site Report at: admin/reports/status, you will see a message similar to the image below:

Click on image to enlarge

 The steps below have been compiled from the following post at


1. In order to be able to use this, the following requirements must be met:

In order to allow for large indexes, MySQL must be set up with the following my.cnf settings:


These settings are available as of MySQL 5.5.14, and are defaults in MySQL 5.7.7 and up.

After editing the my.cnf file (often located at /etc/mysql/my.cnf), don't forget to restart the mysql service (for example, with the command sudo service mysql restart) in order to load the new configuration.

2. The PHP MySQL driver must support the utf8mb4 charset (libmysqlclient 5.5.3 and up, as well as mysqlnd 5.0.9 and up).

3. The MySQL server must support the utf8mb4 charset (5.5.3 and up).

Run the command mysql --version to see your current MySQL version.

Steps to enable 


For existing Drupal installations
  • First, back up your database and convert all existing tables to utf8mb4, such as by using the drush command provided by the utf8mb4_convert contrib project.
  • Set the "charset" and "collation" keys on the database connection array in settings.php to "utf8mb4" and "utf8mb4_general_ci" respectively:

     $databases['default']['default'] = array(  
      'driver' => 'mysql',  
      'database' => 'databasename',  
      'username' => 'username',  
      'password' => 'password',  
      'host' => 'localhost',  
      'charset' => 'utf8mb4',  
      'collation' => 'utf8mb4_general_ci',  

 For new Drupal installations

  • Prior to running the installer, edit settings.php and manually add in the full database settings array code, with 'charset' as 'utf8mb4', and 'collation' as 'utf8mb4_general_ci', and with the actual values for 'database', 'username', 'password', 'host', as shown below:

     databases['default']['default'] = array(  
      'driver' => 'mysql',  
      'database' => 'databasename',  
      'username' => 'username',  
      'password' => 'password',  
      'host' => 'localhost',  
      'charset' => 'utf8mb4',  
      'collation' => 'utf8mb4_general_ci',  

  • Then run the installer specifically by accessing install.php, as in (not just

Other database systems

  • PostgreSQL and SQLite support 4-byte UTF-8 out-of-the-box, so no special changes are needed for these.
  • MariaDB and other MySQL equivalents should likely work with similar instructions as above for MySQL.
  • Database drivers provided by contributed modules may or may not support this feature. The best place to look for answers is the issue queue of the contributed module which provides the database driver you are using.
Now when you look at your Drupal Site Report, you should be getting a warning message as the image below, which is related to Database 4 byte UTF-8 support:

Click on image to enlarge 

Converting Characterset & Collation to utf8mb4:

Using SQL commands:

 ALTER DATABASE db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;  
 ALTER TABLE tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;  

Or if you're still on MySQL 5.5.2 or older which didn't support 4-byte UTF-8, use utf8 instead of utf8mb4:

 ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;  
 ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;  


Easier way using Drush:

Now to convert all your database tables to utf8mb4 characterset and utf8mb4_general_ci collation, you may make use of the following Drush command called UTF8MB4 Convert. Please find detailed instructions of this command here:

The conversion process in your terminal after executing the above commands should be as below:

Click image to enlarge
 Final Message After Conversion:

Click image to enlarge
Finally when all your tables are converted, you can view each of their's Collation by using any database management tool such as phpMyAdmin. 

Click image to enlarge

Finally your Drupal site should display a message like this, confirming successful enabling of  Multi-byte UTF-8 support.

Click image to enlarge
 That's all there is to enable multi-byte UTF-8 support in Drupal 7.

Wednesday, February 22, 2017

Redirect One URL To Another URL Using htaccess in Magento and Other Websites

Below is the technique which you can use to redirect a URL to another URL using htaccess in Magento or various other websites.

 Redirect 302 /en/php/index.php  

Note: A 301 redirect means that the page has permanently moved to a new location. A 302 redirect means that the move is only temporary. Search engines need to figure out whether to keep the old page, or replace it with the one found at the new location. So, if your link has changed permanently then go for 301 redirect else go for a 302 redirect.

For various other redirect techniques you may check the link below:

सिक्नुहोस - मोबाइल फोनलाई FAST बनाउने र MEMORY SPACE बढाउने टेकनिक

Learn how to make your mobile fast and increase your memory space in your Android phones.

Sunday, February 5, 2017

Word Wrapping/Line Wrapping in Geany

If you are looking to line wrap or word wrap your codes in Geany use the following keys combinations:

Press ALT+D +L to toggle Line wrapping or Word wrapping.

Friday, February 3, 2017

Reset Product ID to One (1) in Magento 2x

If you have deleted your sample products and would like to reset the product id to one (1) or any number of your choice, open up your phpMyAdmin or any MySQL client of your choice and enter the following command:

 ALTER TABLE `catalog_product_entity` AUTO_INCREMENT =1  

If you have used table prefix don't forget to append that as well before catalog_product_entity. Example: table-prefix_catalog_product_entity.

Monday, January 23, 2017

Product Automatically Converting To Virtual Product Instead of Simple Product in Magento

If you are experiencing a queer problem where by your products are automatically converting to virtual product instead of the default simple product then one of the reason might be —while creating the product, under the weight field you might be selecting the option - 'This item has no weight.' & when you do this Magento saves the products as virtual product. To save a product as simple product you must select the option as 'This item has weight.'

In case you have lots of product that are virtual and you would like to convert them to simple products, you can run this simple SQL query as below:

 UPDATE catalog_product_entity SET type_id = 'simple' WHERE type_id = 'virtual'  


Saturday, January 7, 2017

Marketplace or Multi Store/Multi Website Solution in Magento 2 - Know which to use

Just like I had been all this while, you too must be confused between Marketplace or Multi Vendor/Multi Website solution, and unable to make your choice. In this post I will explain to you as to whether you should go for a Marketplace or Multi Store/Multi Website solution. There can be many reasons, but the ones below, were the ones that made me eventually go for a marketplace, in spite of successfully building a Multi Vendor Solution.

1. Marketplace: You should go for a marketplace solution if you are looking to provide the following features/services in your website:
  • Multi Vendor Solution
  • Ability for users to register as vendors and start selling their products on your website. All this can be done from your site's frontend which isn't the case with Multi Store/Website.
  • Amazon/Ebay kind of solution
Fig: Multi Website/Multi Store (click on image to enlarge)

 2. Multi Store/Multi Website: You should go for a multi store/multi website solution in the following case:
  • Use a single Magento installation to create several stores & websites which eases website maintenance related tasks.
  • The following features are shared in a multi store setup:
    • Payment Gateway (shared)
    • Shipment (shared)
    • Category (optional)
    • Catalog is shared or not shared depending upon how you have set up your Category. If you have same category for all the stores then the products will be shared between all the stores. If you have separate categories for separate stores then the product can be restricted to each store. 
    • Users are shared across all the store enabling single account log in across stores.
  •  The following features are shared/not shared in a multi website setup, depending upon your configuration:
    • Payment Gateway (Can be unique for each website)
    • Shipping (Can be unique for each website)
    • User account (Can be restricted or shared across websites depending upon your configuration)

Top Magento Hosting:

Top 5 Posts (Weekly)

Lets Connect: