Archive for October, 2015


October 28, 2015 Leave a comment


$ gpg –local-user -a –detach-sign

$ gpg –fingerprint

$ gpg –send-key –keyserver hkp://

To get your public key
$ gpg gpg –armor –export

To decrypt file that was shared with you
$ gpg –output

For this version of gpg

gpg (GnuPG/MacGPG2) 2.0.28
libgcrypt 1.6.3
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Categories: bash Tags:

How to use *args and **kwargs in Python

October 28, 2015 Leave a comment
Categories: python Tags: ,

Mosh – Mobile Shell

October 26, 2015 Leave a comment

Mosh (mobile shell)

Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.

Mosh is a replacement for SSH. It’s more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.

Mosh is free software, available for GNU/Linux, FreeBSD, Solaris, Mac OS X, and Android.

Categories: Interesting

sudo: Unable to resolve host (none)

October 26, 2015 Leave a comment

I changed the host name of my machine from penguin to penguin_1 by editing both /etc/hosts and /etc/hostname.
After which I started getting the error “sudo: unable to resolve host (none)

Found it on askubuntu hidden among the many answers. You can not have an underscore as a name. When I changed penguin_1 to penguin-1 in both files my issue was resolved.


Import Error: No module named django.core.wsgi

October 23, 2015 Leave a comment

I have an nginx + django + wsgi setup. When I try to bring up the site I was getting the import error.

Found a solution on stackoverflow. Turns out that wsgi was not able to find django in my site-packages. Following the pointers in the stackoverflow link below, I updated my sys.path and that fixed the issue.

import os
import sys

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "<my_project_name>.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()


Strings – Python 3

October 16, 2015 Leave a comment

Few people think about it, but text is incredibly complicated. Start with the alphabet. The people of Bougainville have the smallest alphabet in the world; their Rotokas alphabet is composed of only 12 letters: A, E, G, I, K, O, P, R, S, T, U, and V. On the other end of the spectrum, languages like Chinese, Japanese, and Korean have thousands of characters. English, of course, has 26 letters — 52 if you count uppercase and lowercase separately — plus a handful of !@#$%& punctuation marks.

Read the full article here

Categories: Interesting, python