Author Archive

A Powerline style prompt for your shell

July 23, 2017 Leave a comment

For a hassle free powerline like shell. Works with bash and zsh.

* Shows some important details about the git/svn/hg/fossil branch (see below)
* Changes color if the last command exited with a failure code
* If you’re too deep into a directory tree, shortens the displayed path with an ellipsis
* Shows the current Python virtualenv environment
* It’s easy to customize and extend. See below for details.

Categories: bash, zsh Tags:


July 23, 2017 Leave a comment

Git status with powerline


1. pip install –user powerline-gitstatus

Follow the instructions in on site
2. Add custom highlight groups.

vim .local/lib/python2.7/site-packages/powerline/config_files/colorschemes/default.json


  "groups": {
    "gitstatus":                 { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch":          { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_clean":    { "fg": "green",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_dirty":    { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_detached": { "fg": "mediumpurple",    "bg": "gray2", "attrs": [] },
    "gitstatus_tag":             { "fg": "darkcyan",        "bg": "gray2", "attrs": [] },
    "gitstatus_behind":          { "fg": "gray10",          "bg": "gray2", "attrs": [] },
    "gitstatus_ahead":           { "fg": "gray10",          "bg": "gray2", "attrs": [] },
    "gitstatus_staged":          { "fg": "green",           "bg": "gray2", "attrs": [] },
    "gitstatus_unmerged":        { "fg": "brightred",       "bg": "gray2", "attrs": [] },
    "gitstatus_changed":         { "fg": "mediumorange",    "bg": "gray2", "attrs": [] },
    "gitstatus_untracked":       { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
    "gitstatus_stashed":         { "fg": "darkblue",        "bg": "gray2", "attrs": [] },
    "gitstatus:divider":         { "fg": "gray8",           "bg": "gray2", "attrs": [] }

3. Activate the Gitstatus segment.

vim .local/lib/python2.7/site-packages/powerline/config_files/colorschemes/default.json


    "function": "powerline_gitstatus.gitstatus",
    "priority": 40

4. Show most recent tag reachable in the current branch.

vim .local/lib/python2.7/site-packages/powerline/config_files/themes/shell/__main__.json


"gitstatus": {
    "args": {
        "show_tag": true

These are json files. Be careful with syntax. If editing existing files, remember to add the necessary commas where needed.



July 23, 2017 Leave a comment

Installing powerline-status

1. pip install –user powerline-status
2. Add the following to .bashrc

if [ -d "$HOME/.local/bin" ]; then

export POWERLINE_COMMAND=powerline
powerline-daemon -q

. ${REPOSITORY_ROOT}/powerline/bindings/bash/

3. Source .bashrc. It may give some errors. Open up a new terminal and see if the changes have taken effect.

$ source .bashrc
bash: /home/rodnee/.local/lib/python2.7/site-packages/powerline/bindings/bash/../../../scripts/powerline-config: No such file or directory
bash: /home/rodnee/.local/lib/python2.7/site-packages/powerline/bindings/bash/../../../scripts/powerline-config: No such file or directory


I could not get it to work with zsh. Opted for instead.

Categories: bash Tags: ,

jq – a lightweight and flexible command-line JSON processor

July 17, 2017 Leave a comment

jq is like sed for JSON data – you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.

jq is written in portable C, and it has zero runtime dependencies. You can download a single binary, scp it to a far away machine of the same type, and expect it to work.

jq can mangle the data format that you have into the one that you want with very little effort, and the program to do so is often shorter and simpler than you’d expect.

Categories: Interesting Tags: , ,

This cell phone can make calls even without a battery

July 6, 2017 Leave a comment

“HELLO, HELLO. I am calling from a battery-free phone.” Vamsi Talla’s words in a cluttered lab at the University of Washington in Seattle are barely audible through pops and static. But the fact they can be heard at all, on a nearby Android smartphone, is revolutionary, because Talla’s own cell phone has no battery at all. It draws what little power it needs from thin air.
The prototype cell phone is the culmination of a years-long quest by Talla, a research associate at the lab of Joshua Smith, who researches computer science and electrical engineering at UW. “If you had to pick one device to make battery-free, what would you pick,” asks Smith. “A cell phone is one of the most useful objects there is. Now imagine if your battery ran out and you could still send texts and make calls.”

Categories: Interesting


May 24, 2017 Leave a comment

I needed to have a local SNS/SQS setup for testing. GoAWS worked for me.

Written in Go this is a clone of the AWS SQS/SNS systems. This system is designed to emulate SQS and SNS in a local environment so developers can test their interfaces without having to connect the the AWS Cloud and possibly incurring the expense, or even worse actually write to production topics/queues by mistake. If you see any problems or would like to see a new feature, please open an issue here in github. As well, I will logon to Gitter so we can discuss your deployment issues or the weather.

Categories: Interesting Tags: , ,

May 23, 2017 Leave a comment


Given a version number MAJOR.MINOR.PATCH, increment the:

1. MAJOR version when you make incompatible API changes,
2. MINOR version when you add functionality in a backwards-compatible manner, and
3. PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Categories: Interesting