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… 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
  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

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.


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. || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || || ||

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
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>
        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 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

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
$ git push origin master

$ git remote rm oldmirror

Sequel Pro keyboard shortcut change

Sequel Pro

Sequel Pro is a fast, easy-to-use database Client for working with MySQL databases. It has a lot of other features you can explore more on the Website.

Keyboard Shortcut

Sequel Pro by default doesn’t provide a feature to change a KeyMapping. However, changing keyboard shortcuts in Sequel Pro is very much possible in Mac. My major use case is to “Save Query” & I use it a lot. I generally create separate files for different Databases. I am used to Command+S(⌘+S) to save the ongoing work but that doesn’t work for Sequel Pro by default.

But it’s not supported by Sequel Pro directly, but we have a workaround for the same. Here we go:

  • In Mac, we can add shortcuts via System Preferences for an Application.
  • Go to Keyboard > Shortcuts > Application Shortcuts.
  • Now click the “+” button and a window will open with options to select/add Application, Menu Title & Keyboard Shortcut.
  • Select “Sequel Pro” in Application and enter “Save Query” as the Menu Title and assign “cmd+S”.

Sequel Pro shortcut for save query

  • Similarly, then add “Save Connection” and assign “ctrl+cmd+S” – both shortcuts will get swapped.

Once you are done it will look like the below screenshot.

Sequel Pro keyboard shortcuts

Similarly, you can add more shortcuts for Sequel Pro and for other Applications as well.

By single command on Terminal

You can also use the below command in Terminal to create both of the shortcuts. We can check the settings by executing $ defaults read com.sequelpro.SequelPro

defaults write com.sequelpro.SequelPro NSUserKeyEquivalents '{
    "Save Connection" = "@^s";
    "Save Query" = "@s";



Best deal on Apple iPhone X in India with future upgrade

iPhone X went on sale in India at 6pm IST on Friday(3rd Nov, 2017). It is already delivered to few people who pre-booked it. If you are also looking to buy an iPhone X wait, we will show you the best deal. We will explain, why it is the cheapest option. In addition we will also show an example to yearly upgrade iPhone by paying less.

People are waiting for an Apple exchange program for long, in India. Which means, we can get a new iPhone on discounted price by exchanging the old one. Now we don’t need it any more. Thanks to Flipkart Buyback Guarantee, this is the best offering in market, which works similar to that.

As per Flipkart, you can own an iPhone X at just 13,500 if you already own an iPhone 7 plus. Flipkart is offering cashback on Citibank cards, buyback guarantee and exchange as well. Here are the details of offer.

  • Cashback for Citi Credit and Citi World Debit card users:
    • ₹10,000 cashback when you buy iPhone X
    • ₹15,000 cashback when you buy iPhone X and AirPods
    • ₹22,000 cashback when you buy iPhone X and Apple Watch
  • Up to ₹45,500 guaranteed buyback value if exchanged b/w 6-8 months, & 36,600 if exchanged b/w 9-12 months.
  • You can also get up to ₹20,000 off on exchange of iPhone 7 Plus.

iphone x in 13500

This is a best offer available in market. Where you need to pay 45,500+13500=59000 & will get an iPhone X. You can again exchange iPhone X after 11 months and get a new phone around 36,600 free or discount of same amount on higher end phone.

This is not the final exchange price of iPhone X as you need to exchange the iPhone 7 and then need to buy a new phone to redeem 45,500. Lets convert this calculations to exchange model. Where we will calculate the price of new phone after 11 months. Generally Flipkart offers 50% buyback guarantee, if you exchange b/w 6-8 months and 40% if you exchange b/w 9-12 months. That is calculated on MRP instead of discounted price, as of today.

You will say the exchange price is simply 59k. No, because the iPhone 7 plus that we are giving in exchange didn’t had buyback guarantee. I guess it was launched at 72k and the exchange would be around 29k instead of 20k. The exchange price of iPhone X will be 50k. Apple fans will love that deal.

Lets assume, iPhone 11 will launch next year at price range of 80k and we will get 40% buyback. Lets calculate the future exchange the price at Flipkart. This is an assumption, please cross validate the numbers.

Assume price of iPhone 11 in future ₹80,000
General Cashback from bank offers ₹10,000
Guaranteed exchange value of iPhone X ₹36,600
Final price of iPhone 11 ₹34,000

As per our assumptions Apple fans can use iPhone X and iPhone 11 each for an year each (total 2 years), by paying 50k and 34k respectively. This is a great offer for Apple fans who want upgraded phone each and every time.


Redis 3.0.0 stable is released

Redis 3.0.0

On April 1st Redis team announced the release of Redis 3.0.0 stable. It is the firs stable version of Redis with native support for clustering. Team was working on this from long and many of the features were already back ported to Redis 2.8.

Major Changes

Other new things implemented in 3.0.0 that may be significative to
users not interested in Redis Cluster are:

  • An improved LRU algorithm, ways more precise to evict the older keys.
  • Redis 3.0.0 is generally sensibly faster under high (pipelined) load.
  • AOF rewrite was reworked in order to reduce latency spikes with slow disks when the process undertakes the final “write” of the accumulated buffer.

Changes compared to Redis 2.8?

  • Redis Cluster: a distributed implementation of a subset of Redis.
  • New “embedded string” object encoding resulting in less cache misses. Big speed gain under certain work loads.
  • AOF child -> parent final data transmission to minimise latency due to “last write” during AOF rewrites.
  • Much improved LRU approximation algorithm for keys eviction.
  • WAIT command to block waiting for a write to be transmitted to the specified number of slaves.
  • MIGRATE connection caching. Much faster keys migraitons.
  • MIGRATE new options COPY and REPLACE.
  • CLIENT PAUSE command: stop processing client requests for a specified amount of time.
  • BITCOUNT performance improvements. * CONFIG SET accepts memory values in different units (for example you can use “CONFIG SET maxmemory 1gb”).
  • Redis log format slightly changed reporting in each line the role of the instance (master/slave) or if it’s a saving child log.
  • INCR performance improvements.