Category Archives: Technology

Anything related to the field of Technology that I write, be it PCMR, Windows, Ubuntu, Android, Website development, my gadgets, you will find all linked here. Occasionally I also write about my general view on how I use technology to my advantage. Feel free to ask me any questions in comments.

Fixing Manjaro Boot Menu

I was fed up of Windows update erasing my grub entries. So I have documented the steps to fix it, the steps which works for me. I hope it helps me when I lost my grub bootloader again.

To fix the bootloader, follow the below steps:

  1. Boot from a Manjaro Live USB
  2. Open Terminal
  3. Type below command:
sudo manjaro-chroot -a
grub-install /dev/sda
grub-install --recheck /dev/sda
update-grub

Source: https://gist.github.com/dianjuar/a6e0d801a9f71f8edc06321178390320

How to setup WordPress on Digital Ocean (2020)

With incidents such as Australian bush fire, Covid-19 Pandemic and civil unrest in many countries over one reason or the other, 2020 is basically proving to be one long nightmare. To make it worse for me, my server got hacked, majorly due to lack of proper security or a bad WordPress vulnerability (To put it in the words of Einstein, mildly, human stupidity has no limit).

So I decided to migrate the server to a new one and this time decided to invest some time in making it more secure. This guide is basically a document to setup such a server to host WordPress sites with as much security hardening as I possibly can do. 2020, bring it on!

Continue reading How to setup WordPress on Digital Ocean (2020)

Convert VBA Editor to Dark Theme

So there I was, trying to find best color combination for making my VBA editor in dark theme. While I did find an open source utility on GitHub to hack the VBE.dll and then replace it in the system, I simply wanted to know a color combination that I can quickly set in the built in VBA color palette editor so that I can make the editor dark.

So I made this guide for myself to do just that, a quick 2 min will give you dark theme!

To set these, in the VBA editor, goto Tools -> Options -> Editor Format. Then refer below table to set the colors.

Now set the colors to below:

FieldForegroundBackground
Normal Text White Black
Comment Text Dark Grey Black
Keyword Text Light Green Black
Identifier Text Sky Blue Black
Bookmark Text Dark Green Black
Call Return Text Blue Black

And there, in 2 min now your VBA editor looks something like below. You can tweak it to your liking.

Final result

How to secure your site using Lets Encrypt

If you have your own site, encrypting is something that should be mandatory. Not only does it makes your site secure against hackers/crackers but also google rank those sites higher who serve their site on https.
Here’s how you can secure your wordpress based site using certificate provide by Lets Encrypt.

Some background:

I am quoting the following direct from the Let’s Encrypt site:

To enable HTTPS on your website, you need to get a certificate (a type of file) from a Certificate Authority (CA). Let’s Encrypt is one such CA. In order to get a certificate for your website’s domain from Let’s Encrypt, you have to demonstrate control over the domain. With Let’s Encrypt, you do this using software that uses the ACME protocol, which typically runs on your web host.

If you have shell access (that is if you can connect to your host using PuTTY), you can follow the instructions provided here to install certbot.

Process:

Assuming your wordpress site runs on nginx web server on Debian 9, here’s how to do it:
Add the repository source in your sources.list:

deb http://ftp.debian.org/debian stretch-backports main

to your /etc/apt/sources.list (or add a new file with the “.list” extension to /etc/apt/sources.list.d/) Continue reading How to secure your site using Lets Encrypt

Telegram and WhatsApp

WhatsApp

If I remember correctly I was first introduced to WhatsApp as early as 2012 by one of my IRL friend. It was the thing which was “in” at the time. But it wasn’t that well known. Adoption of WhatsApp spread like wildfire since then, and now in 2018, it’s like everyone who have a smartphone have WhatsApp on their phone. Heck, even the non smartphone, like Symbian have a WhatsApp client now. What started of as a small project in 2009 by Brian Acton and Jan Koum, both former employees of Yahoo, in Mountain View, California, soon grew to be a company worthy to be acquired by the Facebook giant in 2014. The acquisition took just US $19 billion out of Facebook’s pockets, but Zuckerberg knew it was a bargain.
The USP of WhatsApp was it’s simplicity and ad free experience. The founders promised that it will remain ad free for eternity but never promised anything about simplicity. After being bought by Facebook, WhatsApp went numerous changes which traded the simplicity to introduce features like Instagram, which was another social network app company acquired by Facebook in 2012 earlier for mere 1 billion (sounds like a steal in comparison to WhatsApp deal now, isn’t it?).

Telegram

Telegram on the other hand was developed by two Russian brothers, Nikolai and Pavel Durov who had previously founded the Russian social network VK, but had to leave the company after it was taken over by the Mail.ru Group (credit: Wikipedia). From it’s initial release in 2012, it have grown to become a great alternative to WhatsApp and currently is struggling to keep it out of grips of influential like big corporations and government scrutiny.
When I first stumbled on Telegram in October 2015, I confused it with a copy of the app WhatsApp but digging deeper I realized it offered something to the table which WhatsApp couldn’t especially after it’s acquisition by Zuckerburg. I soon began to love Telegram for what it offered and the convenience it bought with it. In those times I use to be a frequent user of IRC and use a channel to communicate most of my online friends. But Telegram changed that. Now I have almost left IRC for Telegram and use it for a lot more reasons then just communication with online friends. I use it as a pastebin, a medium to transfer files, a way to get updates on cryptocurrency and also to chat secretly, if needed.

Difference between WhatsApp and Telegram

I have tired to compare both of the social network app on features and technical factors.
[table “4” not found /]

While there are numerous things which are great on Telegram, I haven’t even mentioned that most of the security features were first added on Telegram and later came out with WhatsApp. But the most important thing is the commitment of Telegram founders which are making efforts to make it more secure and not to let big corporate giants controlling them, thereby it promises more security and privacy. For me though, the most important thing is feature and convenience and for that Telegram is perfect. No wonder more and more companies are choosing Telegram for it’s ability to connect to masses.

Setting up WordPress on Debian 9.3 x64 on a Virtual Machine on Windows 10

In this article I am documenting the exact steps that one needs to host a wordpress based site on a Debian based virtual machine (VM). I choose debian since that’s one of the preferred distro based on it’s stability and smaller footprint on resources compared to Ubuntu. But you may very well choose Ubuntu, only some steps in below documentation would differ.
This article deals with following technologies:

  1. Windows 10: The host operating system
  2. Oracle VirtualBox: The Virtual Machine software
  3. Debian 9.3 x64: The distro which we will install on the VM
  4. nginx: The web server
  5. mariadb: MySQL database solutions
  6. php: The package which installs on Debian automatically as a dependency
  7. phpMyAdmin: Administration tool for MariaDB

Continue reading Setting up WordPress on Debian 9.3 x64 on a Virtual Machine on Windows 10

Resurrecting Soft Bricked Moto E

So I had a Moto E that was showing weird issues. Sometimes when it’s rebooted it stucks in bootloop and fails to finish the boot sequence. The home screen just doesn’t appear. I manage to flash a fresh ROM on it and after which it starts to work. I haven’t been able to identify the problem yet, but the turnaround is working good as of now. So I just want to document the process of fixing the soft bricked Moto E:

*** DISCLAIMER ***
Please note that this is just a documentation of the process I followed to fix my Moto E. This is by no means an accurate or official guide to fix your Moto E. If you do mess up your phone trying to follow this documentation, you can't blame me.

The simple procedure for a fresh Moto E is to first unlock the bootloader of Moto E. Which is a simple one time process which includes using the following command in fastboot mode: fastboot oem get_unlock_data. The unlock is complete when you enter a code on Motorola website and they give you a return string to unlock it. The guide is here. Continue reading Resurrecting Soft Bricked Moto E

Commands to Analyze Space through Terminal

This article lists a few ways to analyze the usage space of the hard disk through Terminal.

Space occupied by all folder sorted ascending order:

sudo du -h * | sort -h

The command ‘du’ is used in terminal which stands for disk usage. But the command alone gives listing of all files along with their size. The above command sorts the list, so that the highest space folder appears in bottom of the list. SUDO added since if you want it to run in root folder, normal command won’t have access to system folders.

Space on disk:

df -h

Above command is not path sensitive, which means you can run it from anywhere and also don’t require sudo.

Disk space usage per user:

sudo find . -printf "%u %s\n" | awk '{user[$1]+=$2}; END{ for( i in user) print i " " user[i]}'

Above script (combination of commands) prints disk usage per user and is not path sensitive. The script uses find and awk (extraction command) to give a list of users along with the space they are consuming in bytes.

Viewing first top directories taking space

du --max-depth=1 2> /dev/null | sort -n -r | head -n20

The above command would list top few directories along with their size, sorted in descending order.

Third Party Utility:

On debian, install ncdu by following command:

sudo apt-get install ncdu -s

Once install, you can use the utility ncdu to easily see the size of various folders through a friendly user interface right within Terminal. Here’s the ncdu manual: https://dev.yorhel.nl/ncdu/man
If above command don’t install ncdu try forcing the install by following command:

sudo apt-get install -f -y ncdu

With above command you can pin point the folder which is taking up space in little time. Also note that the sometimes you need to go deeper by using the command, sudo su, to view space of files taken up by say, /var directory.

Which Instant Messenger is best for me?

With all the advances that have happened in the world of Internet, one thing is at the core of it. That is Instant Communication. And from the ages of Internet Chat Relays (IRC) to WhatsApp and everything in between is playing a pivotal role in connecting people from all corners of the globe. And if you are confused as to what Instant Messenger is right for you, here is a flowchart that lets you decide between few of them.
IM_Flowchart
WhatsApp: Everyone uses it since everyone else uses it. But things such as dependency on mobile even if you want to chat on browser makes it a very poorly developed IM.
IRC (Internet Chat Relay): It’s the most powerful IM that the netizens have ever used. You can chat privately, in rooms, on PC, on your phone, use bots, leave offline messages.. really the only limit is your imagination and skills to make more functionality.
Steam: Steam being the most popular client for gaming provides a client for both Windows, Linux and Android. So if you are a gamer you would tend to use it much extensively.
Telegram: It’s currently the most versatile IM as of now. With features such as true cross platform (you can run it on command line!), ability to share self expiring secret messages, cloud storage (so that you don’t loose your chat history) and with the introduction of bots, I am in love with this IM. Also the fact that you don’t need to share your mobile number like WhatsApp makes it perfect for privacy conscious users.
So which IM you use the most and what would be your choice, if you don’t have to come under peer pressure to choose more popular Instant Messenger?

Steps to add a WordPress Site to an existing VPS

I use to have a hard time configuring a new site under a common VPS. So I decided to document the steps for easy reference in future.
Following are the steps to add a new site “site-name.com” under a new user account “username” on your Linux VPS. This is to note that this works if you have the following web service solution stack (LAMP):
Linux OS : Debian
Web server: Nginx (Not Apache)
Database: MySQL
Application Programming Language: PHP
So here we go:
1. Buy the domain. Call it site-name.com.
2. Set the nameserver of the domain to point to the IP address of your VPS under ‘A’ record which stands for ‘Address’. For reference, there are other kinds of record like ‘CNAME’ and ‘MX’, but you don’t need to set them at this point.
3. Create a new user on VPS by command by following command.

sudo adduser username

This command also creates a new home directory for the user.
Continue reading Steps to add a WordPress Site to an existing VPS