Blogging again

I used to have  a posterous blog (even before it was renamed spaces, and then shutdown post twitter acquisition). What made me post frequently is the ability to easily post by email. Since the shutdown I have posted a few short tidbits on coderwall but nothing substantial. I have been also posting on my company’s blog. I have been procrastinating setting up my own blog ever since then.

Finally I have gotten around to setting up a simple wordpress install with a few plugins to recreate my posterous setup. Namely using postie with an email mailbox that I can post to. I am considering using WordPress Jetpack … but hesitant to do so.

Tmux – Attach to Different Windows

I am (was) a big time GNU Screen user. Once byobu arrived, I was a big fan of that and switched to it (byobu, is basically a fancy/pretty .screenrc). Byobu shortly after made Tmux the default and I was slow in adopting the use of Tmux instead of screen. Recently though I decided to embrace Tmux for its claimed lightweight. There are a few variations which once embraced can actually be a good thing.

Oneliner to generate a Django Secret Key

Debian – Truly Unattended Upgrades

This will make sure you bypass those pesky questions, with the safest option. For when you want to do an upgrade in a script (such as from a Vagrant :shell provision)

Making Byobu Behave

I love byobu (the awesome screen/tmux wrapper). One of my pet peeves with byobu, is it takes over the Function keys (F-keys). There is very little to no documentation on how to disable that by default. Here is how …

For Tmux:

For Screen:

Avoid Hyphens in Puppet Class Names

We had been using hyphens in class names until I faced an issue that I wasn’t able to figure out. The issue is, if you have a class name with a hyphen, and then try to grab a fully qualified variable from the class, the puppet dsl parser thinks its a minus.

They seemed to fix the issue and should be released with puppet 3.5; but until then, use underscores if you need to but avoid the issue.

Here is the doc that briefly mentions the gotcha:

Hopefully this helps save some time if you hit this issue.

Enable HG Extensions for one command

Sometimes you want to enable an extension for just one command (either being on a different machine, or just don’t really want to clutter your hgrc for a one time thing) you can use –config directly on the command line, for example to enable the purge extension

Should you use underscore prefixes in python (private) variables?


especially not double underscores, never! … if you really really want and have an itch you want to scratch use one underscore, that’s more than enough to tell users that they shouldn’t change it.

Django OR Querysets using Binary Operator

One of Django’s cool (maybe the coolest) and undocumented feature is being able to OR and AND queries using bitwise (& and |) operators. It is a variation to the Q object that is documented.

Now this becomes really useful when you use related_managers:

while aTable and xTable are totally different instances yet they reference MyTable

Multiple ENV vars with UWSGI

To send in multiple environment variables using the uwsgi ini, you just need to pass in multiple env parameters for example: