How to Encrypt and Decrpt files with GPG

Hi folks,

Today I write about an easy way to encrypt and decrypt files using GPG. GPG (also called GnuPG) is an acronym for GNU Privacy Guard. It is a free software replacement for Symantec’s PGP cryptographic software suite. It is a popular encryption software that supports several algorithms, including RSA, DSA, IDEA, etc. [1].

So, first, install GPG if you don’t already have it.

On a Mac run the command:

brew install gpg

Next, encrypt your file using the command, assuming you want to use AES-256 algorithm:

gpg --output <file name> --symmetric --cipher-algo AES256 <unencrypted file name>

You will be asked for a password which will be required for decryption.

To decrypt the file, use the following command:

gpg --decrypt <file name>

Again you will be asked for the password. Use the same one you provided during encryption.


  1. GNU Privacy Guard – Wikipedia, the free encyclopedia.

How to Scan Images Remotely

Hi folks,

Today I’ll briefly discuss a nice and easy way to scan images remotely. Suppose you have your multifunction printer or scanner hooked up to an Ubuntu server via a USB cable and you need to quickly scan a document while using a remote machine. How can you go about it? It’s easy. Just use the scanimage command over SSH. There’s an API called SANE (Scanner Access Made Easy) that provides a standard way to access raster image scanners [1]. SANE supports Windows, Linux, UNIX and OS/2. scanimage belongs to the SANE package and is available on Ubuntu by default.

First, log in to the server via SSH.

Next, turn on your printer/scanner and insert the document you wish to scan.

Next, run the following command:

scanimage --format=tiff ><your-file>.tiff

This should fire up your printer/scanner, scan the image and save the result in tiff format. From there you can transfer the output file to your machine for use.

Note that there are alternative ways to achieve this, e.g. by setting up a SANE daemon (saned) on your scanner server and then setting up a SANE client for Ubuntu or using TWAIN for Windows and Mac OS, thus allowing you to use compatible scanner software on the client [2].


  1. Scanner Access Now Easy – Wikipedia, the free encyclopedia.
  2. SaneDaemonTutorial – Community Help Wiki.

The Art of Treading Water

A few weeks ago I made my first successful attempt at treading water at the neighbourhood swimming pool. At the end of the lesson I asked my friendly instructor to allow me practice treading water and she obliged. Note that I had attempted treading water on numerous occasions using various techniques I had seen on Youtube at the pool only to find myself sinking fast to the bottom of the pool. This time, I did a few things different, thanks to instructions from my wise instructor. First, I had to look upawards. Second, I had to make sure my upper body was bent forward such that a line from my waist to my head made an angle of say thirty degrees to the vertical wall of the pool. Third, I had to constantly kick in a cycling motion, as if riding a bike. And finally, I had to rotate foreams in circles parallel to the surface of the water, palms open. Think of it as trying to wipe an imaginary table parallel to the water surface. On doing these four things simultaneously, I was able to keep my face above water for a good couple of seconds for the first time. Now that is hard core! But I was ecstatic afterwards. Now, having described my personal way of treading water, I’ll quickly go over the common ways I’ve found for treading water.

First, when treading water, it’s very helpful to move your arms in circles such that you effectively push the water downwards. By pushing the water downwards, the water pushes your body upwards in accordance with the law of conservation of momentum. Another helpful motion is the kick with the legs. There are a few types of kicks you can use to thread water.

First, using breast stroke kicks. Think of the regular breast stroke kicks, but you just do it downwards. It’s a fairly easy way to push the water downwards and hence your body upwards.

Second, flutter kicks. You can also use these to tread water. This generally requires more energy though, but for some people it just works.

Below is a nice video that shows using the aforementioned techniques.

Third, egg beater kick. This is basically the same as breast stroke kicks, but one leg at a time. Below is a video that demonstrates this.

So, how do you guys tread like to tread water? Feel free to leave comments.