A beautiful poem about Sikkim State

Sikkim, a land of beauty rare,
With snow-capped peaks and verdant air,
A state of India, small but grand,
With culture rich and history grand.

The people here are warm and kind,
With traditions that will blow your mind,
From Buddhism to Hindu to Christianity,
All religions here in perfect harmony.

Mount Kanchenjunga, the crowning glory,
Looms high above in all its story,
The glaciers and the rivers flow,
Nature’s beauty here on show.

The monasteries here, ancient and grand,
Will take your breath away with a glance,
The festivals are a colorful sight,
A celebration of culture and might.

Sikkim, a land of beauty rare,
With snow-capped peaks and verdant air,
A state of India, small but grand,
With culture rich and history grand.

How to find a flat in Bangalore

Finding a flat in Bangalore is very tough. I have listed down a few tips. However, you need to work hard or be lucky to get a flat in Bangalore.

  1. Understand Google Map from teammates and identify all the apartments in the target area.
  2. Rank them.
  3. Work on the ranked list and ask in office portals, who live in these apartments.
  4. Taking a walk around the Target location, it helps.
  5. Check office portals, if someone is looking for a flatmate.
  6. Join Flat and flatmates ( Bangalore chapter ) here https://fb.me/groups/543987232323064… A very big community to find flat and flatmates. You may get brokers posts initially, keep trying.
  7. Check @BangaloreRoomi twitter bot. A Twitter bot that tracks all the folks who are in dire need of flatmates in Bangalore.
  8. Check https://www.nobroker.in/
  9. At last if you are not able to find any. Go for PGs like stanzaliving, zolostays, nestaway, etc. However PGs are boring.

A few don’t as well 😀

  • Don’t wait for your friends to move to Bangalore. Time to make new friends. You will learn more from new people. That is also one of the best thing about Bangalore.
  • Don’t stay too far from office, just to save rent. You will end up wasting more time and money on cabs. Don’t measure the distance from office. Measure the time to reach office in peak hours. If you have just moved to Bangalore, then assume you don’t have a clue about the traffic.
  • Doesn’t matter if a there is a Grocery market near by apartment. Everything gets delivered at home in Bangalore and a few items in just 10mins. All the milk apps deliver almost everything before you even wake up.

Common Gmail filters

gmail filters

Search mails for all Meeting/calendar related messages inside inbox
invite.ics in:inbox

Search mails for all Meeting/calendar related messages without Replies or Forwards
invite.ics -subject:”re:||Fwd:”

Search emails larger than 10MB

Search emails older than 2 years
(use “m” for months and “d” for days)

Search emails in the last 30 days or newer than 1 month|
(use “m” for months and “d” for days)

Search a word exactly matches the result:
use a plus sign like +universe
If you want to search emails with a word exactly matching universe. Try searching +universe. You will not get results for “universes” or “universal“.

A detailed list of Gmail filters is available here https://support.google.com/mail/answer/7190?hl=en

Install WordPress with Nginx

We will talk about how to configure PHP with Nginx and then we can use WordPress with Nginx. Here we will use PHP-7.0 with fpm. you can modify it according to current PHP version. These commands are tested on an Ubuntu system. You can change them accordingly.

Login to the instance where you want to do this setup.

Install PHP, Mysql and Nginx

$ sudo su
# apt-get update
# apt-get install vim
# apt-get install mysql-server nginx php7.0-fpm php7.0-mysql php-apcu \
    pwgen python-setuptools curl git unzip php7.0-curl php7.0-gd php7.0-intl \
    php-pear php-imagick php7.0-mcrypt php7.0-pspell php7.0-recode \
    php7.0-sqlite php7.0-xmlrpc php7.0-xsl

Tweak your php-fpm settings, and change the cgi.fix_pathinfo setting from 1 to 0

Increase the max upload filesize and post max size to 20MB:

$ sudo sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/fpm/php.ini
$ sudo sed -i "s/upload_max_filesize =.*/upload_max_filesize = 20M/g" /etc/php/7.0/fpm/php.ini
$ sudo sed -i "s/post_max_size =.*/post_max_size = 20M/g" /etc/php/7.0/fpm/php.ini

Now configure Nginx’s default site by editing /etc/nginx/sites-available/default:

server {
        listen   80;
        listen   [::]:80 default ipv6only=on;
        root /var/www/wordpress;
        index index.php;
        client_max_body_size 20M;

        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                include fastcgi_params;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

When you make changes to your configuration, you will need to restart the associated services:

$ sudo service nginx restart
$ sudo service php7.0-fpm restart

This configuration will serve php from /var/www/wordpress – drop an index.php file there with following code. Visit your instance’s IP address in your browser to confirm that everything has been configured – make sure you delete that file once you’re done.


Migrate existing WordPress with backup

Take backup of existing WordPress, use plugin BackWPup, to backup the files and database. Run the job manually on your machine, it will create a compressed file in “/wp-content/uploads/backwpup-**-backups]“.

Start a http server in that folder. It is possible that your firewall rules doesn’t allow external traffic on other ports. Better you check Firewall rules or transfer it through “SCP”.

$ python -m SimpleHTTPServer 3389

Goto the new machine where the nginx and php is installed.

$ cd /var/www/wordpress
$ wget http://ip:3389/wordpress.tar.gz
$ tar -xvzf wordpress.tar.gz
$ chown -R www-data:www-data
  1. Extract content of this folder on /var/www/wordpress/
  2. Login to Database with the root password entered during setup.
  3. Create Mysql user for wordpress.
# mysql -uroot -p

mysql> CREATE DATABASE wordpress_db;
mysql> CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'CHOOSSE_STRONG_PASSWORD';
mysql> GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress-user'@'localhost';
mysql> \q

Export sql file

mysql -uwordpress-user -p wordpress_db < wordpress.sql

Check DB credentials in “wp-config.php”.

Now open IP in browser and wordpress should be up and running.

References: http://jonnyreeves.co.uk/2016/wordpress-on-a-google-compute-engine-f1-micro/

Delete spam emails

We need to periodically clean our inbox and unsubscribe the unnecessary emails. However, a lot of unsubscribe links are broken and their systems don’t work. That is a low priority for a lot of email systems. Not just that we also deal with:

  • Emails with no unsubscribe link
  • Obscured/tiny/low contrast link, which is mostly impossible to find.
  • Unsubscribe link take ages to load or never loads.
  • Link doesn’t work.
  • Takes your email, then fails on submit or doesn’t unsubscribe from the list.
  • Will ask you to “wait for 2 weeks”.

As soon as you deal with the above cases mark them spam. That will keep your inbox clean.

In case we haven’t done this for long and our inbox may be full of spam. It can take a lot of time to clean the inbox. In the last few weeks, I have collected a list of domain names that are SPAM for me.

Just copy-paste the below text into the Gmail search box. If you see the emails, go though the subject quickly and delete them as per your need.

mailerassist.com || mailclues.info || moneyoq.com || mailzter.in || sportsguru.in || promotials.com || carecrofts.com || indiaretailnews.com || yoysocial.com || weeken-days.com || displaymailbox.com || hindbulletin.net || e.2mg.in || transitinbox.com || horoscopefree.co.in || chtah.com || utrans01.com || freekacharge.com || aff-deals.com || holidayicare.com || alcondigital.com || gbooksite.in || reviewmeter.in || casaconsultant.com || sealists.com || multymaniac.com || linuxmedia.biz || shomots.com || jmails.info || simplego.in || loperu.com || lunips.com || naurd.com || gnandu.com || ascendingmedia.in || hyper.ocn.ne.jp || yenady.com || shiningindiaa.com || mail2gmail.com || shyawaynewsletter.com || couponfall.com || couponfall.info || ecomsale.in || mysocialbite.co.in || mgn2inbox.com || mailscart.com || alcondigital.in || freekacharge.in || update@smtpbox-1.com || chiemarublog.com || basictexture.com

How to Install WordPress with Apache on Ubuntu 18.04

A lot of people use WordPress as it is the world’s most popular website builder.

The quick way to install WordPress on an Ubuntu machine with Apache. We can also call it WordPress with LAMP. Just copy to paste the commands and see how it works.

If the Ubuntu version is below 18.04, then add below lines

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Installing PHP 7.4 and Mysql Server

sudo apt install php7.4 libapache2-mod-php7.4 mysql-server php7.4-mysql
sudo apt install php7.4-curl php7.4-gd php7.4-xml php7.4-mbstring php7.4-xmlrpc php7.4-zip php7.4-soap php7.4-intl

Download WordPress and set permissions

cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
mv -r wordpress /var/www/.
cd /var/www/
sudo chown www-data:www-data -R wordpress
cd wordpress
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;

Mysql setup

sudo mysql -u root
mysql> CREATE DATABASE wordpress;
mysql> CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'test123456';
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
mysql> \q

Setting up Apache virtual host

vim /etc/apache2/sites-available/wordpress.conf
#add below lines in above file
<VirtualHost *:80>
        ServerName www.domainxyz.com
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/wordpress

        <Directory /var/www/wordpress>
                #Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                #Require all granted
        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
sudo a2ensite wordpress
sudo a2dissite 000-default.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

sudo apt install imagemagick
sudo apt install php7.4-imagick
sudo systemctl restart apache2

Now check your domain or http://localhost.com and follow instructions on the browser. Your wordpress installation is done.

Feel free to add comments for any improvements or issues.

12 months Free hosting on Microsoft Azure

Azure 12 months free trail

Microsoft Azure is providing 12 months free trial to test their product offering. We will explain, how we can get the 12 months of free hosting or free virtual machine. That can be used to host low traffic web servers, small databases, micro services, servers for proof-of-concepts, build servers, and code repositories. Even I feel their prices are very reasonable as compared to other cloud providers.

Step 1:

Go to the Azure website https://azure.microsoft.com/en-in/free/

Azure free 12 months trial

Click on the Start free button, it will take you to sign in page of microsoft.

Step 2: Create MS account or use existing account

microsoft azure login

We need to either use the existing Microsoft/outlook/Skype/GitHub account or we can create a new account. This is flow is very easy. Once you will be done with the account sign in. You will land on the Card verification page.

They will ask for a credit card however it is just for verification purpose and will only deduct 2 INR. After this step is done you will be redirected to Azure Portal.

azure card page

Step 3: Azure portal

On Azure portal will look like the below screenshot. When you land here you can take the tour as well.

Azure portal

Microsoft is also giving 13,300 Rs credit for one month to explore/use other Azure services.

azure portal credits

Step 4: Create Resource

Click on first option “create a resource” where you see a “+” (plus) sign.

Azure home or dashboard

Now we will reach on below page. Where you will get multiple options to create a machine.

  1. Subscription should be mentioned as a free trial.
  2. Resource group, you can create one and give it a name. Click on the “create new” link and enter the name. I have named it “azure_free_trial” as shown in the screenshot.
  3. Virtual machine name, This will be used as a hostname of your machine. I have named it “azure”.
  4. I haven’t changed Region & Availability options.
  5. Image: I have chosen “Ubuntu”, as I usually work on Unix based environments. However, there are multiple Operating system options are available. You can choose as per your requirement.
  6. Size: This is an important step, Here I have changed it to “B1s” as this instance suits my requirement and will cost 501 Rs per month(after 1 year), Only if I will upgrade my account after the free trial will end.
  7. Authentication type: This is how you want to access your machine? By a username/password or by the public key. People who knows how to use the public key method, better use the public key, as it is more secure. For simplicity of this, we can go with username and password. This machine will be accessible all over the world, please make sure you don’t share the password with anyone.
  8. Inbound Ports: For now we have selected all 3 ports, so we don’t face issues, incase we set up a server on the server.
  9. Now we need to click on the Review + create button, Advance users can check other configurations.
  10. On Review + create tab Click on the create button.
  11. Deployment in progress: The machine is getting assigned and created with selected OS.
Azure machine deployment in progress
Azure machine deployment successful

Step 4: Login to machine

Click on Go to resource button, you will land on overview page.

Azure free trail overview

Now go to the terminal/bash and ssh into the machine:

~$ ssh username@publicIP 

enter the password you have given earlier. Below is the screenshot of the same. Now you can use this machine for free for 12 months Enjoy 🙂

Azure Standard B1s machine and available memory

This machine is free for 12 months and if you like the services of Azure you can carry on with their paid subscription. Which is cheaper as compared to other competitors, that’s what I feel.

Please free to comment & feedback are welcome

Migrate to Github

Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.

$ cd $repo-directory
$ git remote rename origin oldmirror
$ git remote add origin https://github.com/user/new-repo.git
$ git push origin master

$ git remote rm oldmirror