Categories
Code

Bash punchcard

When are you using the command line? I use a python script and a change to my HISTTIMEFORMAT to keep track of when I am active on the command line.  Since I use vim, this means that every time I launch my text editor along with every time I run a command is recorded. This is my punch card since I got this computer in July, along with a punchcard of just commands that start with git and just commands that start with vim.

All commands
all git related commands
all vim commands

It’s interesting to see that I open Vim on Mondays much more than I commit code on Mondays. I think I need to spend some time figuring out how to make Mondays a day with more commits.

I first uploaded my bash punch card in 2012. I was much better at only working during the day then. I later did it in 2013 with both my personal and work computers.

Categories
Code Programming

Introducing Punchcard.py

If you haven’t noticed, I like punchcard graphs.  I like them so much, I have a script that to generate them.  I’ve now released this script for everyone to use.

Punchcard.py is simple to use and I hope you find it useful.  It accepts a stream of unix timestamps and creates a punchcard graph. It can very useful if you’re trying to figure out days and times of activity.

How Do I Install punchcard.py?

The easiest way to install punchcard.py is with pip.  Just run

pip install punchcard.py

If you install it manually (by cloning the punchcard.py git repository and running python setup.py install), you’ll also need to install the dependency pygooglechart.

What options are available

The only option that is currently available is to change the filename. To do that, use the -f option like

punchcard.py -f tweets.png

How do I generate a stream of timestamps

For WordPress Posts, I Butchered the WordPress importer plugin. To use this, clone that repo and run

php punchcard.php export_file_name.xml | punchcard.py

For Twitter, I created a similar simple script. I have the script setup for retweets, original tweets and all tweets. I just change the echo line at the end depending on which I want to output. To use this script, I run

php twitter.php archive.csv | punchcard.py

What should I do if I find bugs

Please create a github issue with any bugs you might find. Please make sure to include steps to reproduce including a relevant data source file.

Inspiration

This script is largely just an abstraction of Bash History Punchcard by Matt Behrens. Without his work, this wouldn’t exist.

Final Notes

If you use punchcard.py to create any interesting graphs, tweet @aaronjorbin, I’d love to see that it’s being used.

Categories
About Aaron

Tweet Punchcards

I might have a small obsession with punchcard graphs lately. I built them for my bash history and posts on this site.. I recently downloaded my twitter archive, so I decided to build some punch card graphs with that.

All Tweets

I figured that this would be a good way to see if there was a difference between when I retweet vs when I tweet my own content.
Continue reading “Tweet Punchcards”

Categories
About Aaron

Punch Card of posts on this site

After building punch card of my bash history earlier today, I thought it would be interesting to build one of my posting history on this blog.   I had no idea I posted on Monday so much.  The times are all Pacific (since that is where I started my site), so I have a feeling most of these times are actually about three hours later than they seem to be.

Categories
Programming

Bash History Punchcard

My friend Drew turned me on to a small hack to my history file that allows me to see a github style punchcard of when I am most active. Checkout Bash History Punchcard on github and make sure to add

export HISTTIMEFORMAT='%Y-%m-%d %H:%M:%S - '

to your bash config to make it work. My punch card from my work machine is pasted below. I wish I had upped my bash history when I started since I only have what I’ve done going back to the end of December on here. No matter what, it’s cool to see when I’ve been doing the most work.