My Most Frequently Used Shell Command
ps aux | grep chrome | grep -v grep | awk '{print $2}' | xargs sudo kill -9
all words by human
ps aux | grep chrome | grep -v grep | awk '{print $2}' | xargs sudo kill -9
Much like we refactor code for maintenability, every now and then it pays to take a look at our infrastructure and see if there is anything we can improve. For example, recently I decided to shutdown…
Over the past few days, I have been busy upgrading a few libraries we were using to gain much needed new functionality. Amongst those is upgrading DJango 1.4 to 1.6 to get the new User model as well as be able to drop the PGBouncer dependancy because DJango 1.6 supports persistent database connections. Unfortunately, as of Django 1.5, the url template tag requires the argument to be a string or context variable, which means I have to scour through a few hundred templates and change tags from something like {% url post post.slug %} to {% url “post” post.slug %}. Well, instead of doing that, here is a handy regular expression to do the replacement for us: s/(\{% url[\s]+?)([^"'\s][^\s]+)/$1'$2'/g.…
I have recently undertaken the task of rebuilding our analytics stack at Sidelines. I’ll share more details as to what motivated me to do so and why in a later post. One of the solutions I’m exploring, is streaming data to be queried by Google BigQuery. The basic premise is that each event will have its own table and each event carries a lot of properties to give it context. For example, a click on a brand creative will contain properties describing the user that clicked, such as browser, screen resolution, etc. It will also have properties around the type of creative; was an image used? What was the resolution? How long was the title? What was the template. Overall, each event averages to about 50 different properties. The problem I faced, is that Google BigQuery requires the table schema to be defined prior to inserting data. Some other services I’m exploring like Keen.io are kind enough to do the schema inference for you. Because I really didn’t want to define schemas for all these events, I wrote a quick script that will create the JSON required to create the table prior to inserting the first event.…