Using local password manager

Bit of history

Long time ago I was using LastPass. and it worked well for me for a long time, till it was acquired. I heard some "bad" things, which honestly I do not remember, but it was probably like the "free" option will go away.

I started looking for options, and chanced upon Dashlane.

Honestly it worked really well, but there is this inkling that I can't explain, that I need to move out.

I tried KeePass - but honestly, it just doesn't compare. It is a just a storage. Without ability to autofill the login pages, it is just too cumbersome.

I've been hearing great things about pass

I had tried it earlier in Feb 2017, but the companion browser addons did not work (at that time) So I went back to Dashlane (I never stopped)

Import the data from Dashlane

One of the issue was I wanted to import my existing data from Dashlane to pass. But this is not natively supported. (For various valid reasons) But there was an importer that worked with KeePass2 CSV file.

This is a python script - very well written - I might add.

It clearly documents the columns.

Dashlane has "unsecure" export option, which exports the passwords in "normal" CSV file.

The sequence of the columns required by the importer wasn't far off.

I manually fixed this issue, and populated the title column.

Upgrade. Issues

Since my pass was old, I decided to upgrade. Bunch of extensions also required relatively newer version.

brew upgrade pass

This upgraded gpg as well. Warning says "backup ~/.gnupg"

mv .gnupg .gnupg.back

Now that .gnupg was backed up, time to use the upgraded software.

brew link --overwrite gnupg
pass init <PassStore Key>
python keepass2csv2pass.py dashlane-new.csv

Most import failed because there was no gpg key

So ..

gpg2 --full-generate-key

Now python keepass2csv2pass.py dashlane-new.csv worked.

confirm using

pass about.me

Autofill aka Integration with the Browser

But pass is a command line tool. It is just a backend for storage and retrieval for the data.

For autofill, there is browserpass

There is some bug, which prevents autofill from working.

The workaround was to unlock the passstore using pass command from the terminal first. I was asked for the passphrase interactively in the terminal.

Once it was "unlocked", I had to (re) start firefox from the terminal using open -a firefox

As of this writing, see this open bugs related to gpg passphrase:

Keep the passstore up to date

One time import is never enough when switching password manager. Ability to update existing entries and creating new ones is equally important.

pass falls short here.

Inserting new entry is not easy as using Dashlane (which is very well integrated with the browser)

But "extension" are supposed to take care of that. There is already a feature request on the browserpass

None the less, here is how you do it.

pass insert group/username
Enter password for group/username:
Retype password for group/username:

I had a bit of a problem, since I had imported my old GPG keys from gpg1 to gpg2

When I used pass insert for the first time I saw the following error:

There is no assurance this key belongs to the named user

Since the working has changed a LOT (use of trustdb, as opposed to secring) I need to explicitly trust the imported keys.

The way to do this is "edit" the key and set the trust level explicitly.

# Get the list of keys
gpg2 --list-keys
# Edit the key(s) you just imported
gpg2 --edit-key <KEYID>
# When asked, choose the trust level (5) being maximum, called ultimate
# confirm with "y"

On a related note, KeePassXC, along with PassIFox looks promising. I'm waiting for this issue to be fixed so that I can continue to enable multiprocess support in Firefox.

How to use multiple versions of python at the same time

If you install python via the package manager for your OS (brew, apt-get, yum) you can have only one version of python at the same time.

At best one python2 and one python3

But if you want to have (and want ability to easily switch between) say 3.5.2 and 3.6.0 (and 2.7.2) then you should definitely consider using pyenv

pyenv is not platform specific. It installs all the versions in your home directory under ~/.pyenv

Some useful commands:

pyenv versions  # Lists the various versions on your system
pyenv install -l # Lists available versions you can install
pyenv install 2.7.0 # Install Python 2.7.0

Off course there is lot more on the pyenv page

There is a pyenv plugin that helps manager virual environments. See here

Micro-TILs

Recently I started learning elixir. During this process I came across two TIL blogs.

First one is TIL app created by Hashrocket.

At first they created it in Rails .

Recently they created (ported ?) it to Elixir. Source

The other is more interesting to me. One of the (ex?) HashRocket engineer Josh Branchaud has his own til repo Although he hasn't published these anywhere (Other than this public repo) it contains a lot of gems.

The way these are different is that each entry is a tiny piece of useful information. Small enough that I would not have called it a blog "post". But who is to say how much should a blog post be ? After all, several tweets that are just under 140 character contain the useful information.

I too have collected several "notes" over the years. I never organized nor publish them, thinking "no one needs them", but who am I to decide ? May be some one will find these useful.

So I have decided to decide to publish these as and when I learn. I may post some of the older ones initially as well.

I call them "Micro-TILs" !!

Sidney Sheldon

I had known Sydney Sheldon as an author of several best-selling novels like "The Other Side of Midnight", "Rage of Angels", "Master of the Game" etc. I grew up reading his novels (mostly marathi translations)

Later, during my few years in US, I used to watch "I Dream of Jeanie" and came to know him as the producer and writer of this show.

Little did I know, that I had all this backwards. Literally.

Recently I read his autobiography "The Other Side of Me". It turns out he had a huge career in Hollywood and Broadway before that. Later in life, he did television, and lastly a novelist.

The book starts with his thoughts of suicide when nothing was going right for him. This was during the peak of "great depression". His father talked him out of it. (He referred to both his parents by their first name)

He later reveals, that later in his life (After he won an Oscar) when he visited a psychiatrist, that he suffered from "Manic Depression", and "1 out of 5" people suffering from this end up taking their own life. (Sydney Sheldon lived till the age of 89, just 12 days short of his 90th birthday)

During his initial days he worked in a pharmacy, in check room of a hotel, and struggled as a song writer. He got his break, writing plays.

During the World War 2, he joined the armed forces and was trained to be a pilot. He was never sent to the active war zone due to his slip disk problem. He continued his work on Broadway.

At one point, he had three musicals on Broadway.

This eventually lead to his entry in Hollywood. He won an Oscar for his first screenplay.

He worked with several leading men and women of those days.

He eventually became a producer, worked with several leading movie studios of the time.

During the initial days of Television, people from Hollywood considered Television as their rival, and wouldn't do TV. Sheldon was (probably) one of the first people to move to Television. (He had almost decided NOT to do television, till he met Patty Duke, the star of the proposed Sitcom, over lunch, just as a courtesy)

Towards the end of the book, he says that he had a plot that was "begging to be written" but thought that it would not be a good material for visual medium like movie or television, since he wanted to share the "thoughts" of the leading character with the audience. That is how he become a novelist, and then wrote several novels and became best selling author.

The biography ends with publishing of his first novel.

In the last chapter of his book, he talks about few interesting experiences he had when doing research for his novels.

Just like his other books, it was a great read.

Growing up in South Africa during the Apartheid

Note: These are not MY experiences

This week I listened to two podcasts that happen to talk about growing up in South Africa during the Apartheid. It is one thing to read about it online, and quite another to hear experiences from someone who was part of it growing up.


The first story is that of Susan David, the Author of the book Emotional Agility She recently appeared on the James Altucher Show (Episode 203) which is where I heard this story.

Susan was a white female, growing up in South Africa during the Apartheid. She had a nanny - a black woman - who was very kind to her. She was Susan's friend, confidant, and "second mother". Susan grew up in an area designated only for "white" people, the nanny could not stay with her family. That means she was separated from her own children.

Once a year, she would travel to meet her family, children for 48-72 hours. She would carry gifts for them, but what was heart wrenching was that the shoes, or cloths won't fit, since the last time she has seen her children they were (say) 5 years old, and now they had grown (and were 6 years old) and thus shoes/cloths won't fit.


The other story is about Trevor Noah, the new host of the Daily show. He was recently interviewed on the Freakonomics Radio podcast.

Trevor was born and raised in South Africa to a black mother, and white European father. So he was a mixed race kid. As per the Apartheid laws of that time he was "born a crime" (Thus the name of his book). That means, neither of his parents could openly "own" him.

His mother would pretend to be his "baby sitter" if they were seen together, and his father would "run away", if he called him "daddy" in public place.

He says, he was "lucky" to go to a school that was considered a "white" school.


To listen to the complete stories, with the full context, listen to the podcasts. Links given above.

Sketches : Hands

This post comes from a podcast episode called "Fool me once". So the title of this post is apt. The post does not contain a drawing of a hand. ;)


I recently started listening to a new podcast called "Tell me something I don't know". TMSIDK for short.

In this episode one of the contestant, A.E. Kieren [1] , tells us that "hands" are conspicuously missing from the Art of the renaissance period.

The reason being that hands are very difficult to draw, and hence the artist would "charge" extra if the "paid" assignment required the hands to be included.

On a lighter note, he suggest that now onwards, if you see a portrait from the renaissance period without hands, feel free to assume that the person who commissioned that portrait was "too cheap to pay extra for the hands" 😉

[1]

A.E.Kieren is an artist himself. He drew sketches of the judges of this episode, which you can see on the episode page. He mentions that during his college days, his teacher told him "hands" were his weak spot, in front of the whole class So he created a separate sketchbook just for "hands" and practiced "hands" relentlessly, each day.

Writing golang code with spacemacs

Since I use spacemacs, everything is easy.

As soon as I started editing a .go file, spacemacs offered to enable the go layer. (I could have easily done it myself, but it is always awesome when your editor "knows" and offers to help.)

After saving the .spacemacs and SPC f e R later (and I think I had to reopen the buffer, I don't remember) I had working syntax highlighting and "coding time error checking" (Thanks flycheck)

This is when I noticed the "hard" tabs. See [References]

I was surprised to find out that gofmt tool uses tabs (width=8) to format the go code. I quickly learnt that I should not try to enforce use of spaces, instead I could set my own tab width, the way I want.

So I added the following line to my .spacemacs

(add-hook 'go-mode-hook (lambda() (setq go-tab-width 4)))

As I neared successfully completing my first go program, I appreciated how complete the golang support is, in the spacemacs go layer.

As soon as I save the file, the gofmt command is fires up, and shows up any errors in the right hand side buffer (split window)

If there are no errors, the it formats the code as per the (go) standards.

There are more go layer functionalities like :

  • godoc : Shows up the documentation. Works offline as well. I checked ;)
  • go-import-add : I'm yet to realize the usefulness of this, but seems nice.

You can send a buffer or a region to the "go playground"

Most of these are available via M-x command or via the menu bar.

I may write part two of this, or just update this once I start using go seriously

Edit [Jan 2, 2017]

As I started writing more go code, I felt that I need auto completion, which is configured by default in the go layer, but was broken, because I had not installed the external dependencies [1]

Once I did that, auto-completion started working well.

I have not yet installed gomtalinter, mostly because I am too new to go and I think the errors shown by default are enough for me. In future, I might start using gomtalinter.

For default keyboard shortcuts configured for the go layer, see [2]


[1] Spacemacs go layer pre-requisites
[2] Spacemacs go commands
[References]
Google Analytics Alternative