PyCon 2013

I’ve spent the last week hanging out in Silicon Valley for PyCon as well as to hang out with my co-workers. This year’s experience was very different from the previous years, which I can probably attribute to a couple things.

First, I drove down with my friend and co-worker Rob Hudson, which allowed me to bring my bicycle. Having a way to get around that isn’t just relying on the public transit is pretty amazing. I’ve gotten lost a few times but overall it has been pretty fantastic. It also means I am not getting out of the habit of spending time on my bicycle each morning and evening.

Second, I am sharing a house with co-workers and new friends of mine (Tarek, Alexis, Oliver, and Julien) which changes things pretty drastically. I no longer go back to a lonely hotel room, I have a comfortable house with friends. I can cook breakfast or dinner, spend time chatting with about code, projects and linguistics until late into the night, etc. It also means I am forced to explore the surrounding area a bit since I bike through it.

Finally, I am a Mozilla employee this year. I am not a funemployed guy who has only worked at small time startups, instead I’ve worked on a high scale website at a company that plenty of people can recognize.

It has been a wonderful time at PyCon, I have another day of sprints left, then I head to MV to hang out with my co-workers for a day before I take the long train ride back to Portland.

pytmux Released

So this last weekend I wrote a tool named pytmux. It is a basic session builder/wrapper around tmux so you can get going faster when you start up your system. It uses a JSON based config files, is pretty minimal right now, but I hope to make it better in the future as I use it more.

The idea is you specify what you want a session to look like in JSON, like so:

{
    "name": "wraithan.net",
    "windows": [
        {
            "name": "editor",
            "command": "workon wraithan.net && emacs"
        },
        {
            "command": "workon wraithan.net && make regenerate"
        },
        {
            "command": "workon wraithan.net && git pull"
        }
    ]
}

Then you run:

pytmux run wraithan.net  # This is keyed off of file name.

And blamo! It builds a session as well as it can. It also has convenience commands like pytmux list, pytmux edit <config>, and pytmux doctor. Which you can learn about in the README currently. Better docs (such as sphinx on RTD) in the future if that is really needed.

Anyway, I hope y’all like it. Feel free to open issues on the tracker on GitHub if there are any features missing that you’d like.

Server Time

About a year ago, some friend and I were talking about each getting servers then going to a local data center and getting a third of a rack. There was lots of excitement but unfortunately most of us weren’t in a position to purchase the needed hardware at the time. Fast forward a year and now the topic has come up again but this time things are looking a lot more feasible.

Now, why would someone need or even want a hardware server in these days of fluffy cloud servers floating everywhere? Isn’t managing a server pretty lack luster now that we have these wonderful solutions like Heroku? It’s true, running a server isn’t glamorous, but it is cost effective depending on your skill level, needs, and willingness to put in a little bit of effort.

The cost is where it really shines. The up front cost of ~$1800 that I am looking at for the server I’d like is pretty steep, it doesn’t say, “I’m saving money!” when you look at it. But, how I like to look at it is how the cost breaks down over the course of a year or two. $150/mo if you put it over a year, $75/mo if you put it over two. Which still looks pretty hefty, but consider the amount of hardware you get for that. This is a dual Xeon system, each 4×2.4GHz, 64GB of RAM (easily able ramp that up to 256GB) and I’ll be running 1TB of redundant storage to start with and have the ability to expand that if needed.

This gives me the ability to replace a couple of my Rackspace VPSs as well as build sites that require out of band work to be done without paying $36/mo per dyno on Heroku. This is where my savings will start to kick in. Considering over 2 years I am looking at $75/mo for the hardware and $50/mo (likely closer to $40) for the hosting for a total of $125/mo. If I am able to take down my VPSs which total out to ~$35/mo, and replace 3 Heroku worker dynos, I am able to break even. If I use it more than that, then I am saving money. And with the level of hardware I am getting, it wont be hard to use it for more things.

All of this said, I’ll still be using Heroku to host my sites. Their deployment, add-on management, and databases are pretty great. Especially since I don’t want to have to deal with things like changing my nginx config every time I add a server, writing/modifying a deployment script for each new service, etc. I just get some extra things I’ve been wanting, and the ability to consolidate some of my servers and costs. Overall I am pretty stoked.

If you are a friend of mine, especially in the Portland area, and interested in joining us, let me know. I’ll gladly give you more information. We are keeping it to people we know and trust since people will potentially have hardware access.

What Did I Do Today

I have really inconsistent productivity. Some days I am on fire and really hammering out code. Other days I get to the end and have nothing to show for it and really have a hard time remembering what I was doing. To this end my boss and I have decided it would be helpful if at the end of the day I send a report of progress I made on my bugs.

I opted include some other stuff, both for my boss’ sake and for my own tracking of my day. The basic format of the email is:

Today:

  • http://bugzil.la/700000 :
    • Wrote some code and made progress in the morning.
    • Finished in the afternoon, landed.
  • Other stuff: Helped edit someone’s blog post

Tomorrow:

I felt ok about today, I was distracted a bit with IRC questions. I might try keeping IRC minimized for parts of the day and only look at it when I am highlighted.

After doing this for two days, I’m deciding to do this in other parts of my life to varying degrees. For SC2, I’ll be doing a weekly report, because it is an approximately equivalent, since I am planning 5-10 hours of SC2 practice a week and that is near the same as my 6-10 hour work day.

I’m also thinking that I might do this for my bike riding as well. Weekly makes sense for this as well, because individual rides are less interesting but looking at them in aggregate I can see some trends and progress.

Publishing New Content

I am currently debating between two different ways of dealing with publishing new posts. On one side I have a really simple fabric file that lets me publish from any of my OS X or Linux systems. On the other side I am considering setting up my weblistener from ZenIRCBot and using that to listen for call back from GitHub saying there is new content.

The fabric solution is an already working solution that doesn’t require much upkeep and because it does the push as well as going to the server and publishing it is the same amount of commands. It doesn’t have a server side component might crash (other than the sshd which I trust.) But it restricts me from posting from certain devices of mine.

The automatic publishing solution has two daemon scripts and the redis daemon to get working. I could cut this down to a single script but that requires writing more code which hasn’t been tested. On the other hand it just requires me to push my new posts and other changes and see them on the site rather rapidly. This allows me to use GitHub for windows or mobile applications. I game from windows and one of my blogs is about gaming which makes this solution pretty ideal.

I think I am going to setup the automatic publishing and see how it goes. I don’t have to remove my fabric setup because I add the automatic publishing which lets me fall back on it. When I have the whole thing working I’ll do a full write-up on it including source.

Categories as Subdomains

So one of the things I wanted to do with my blog is to have Tech, Life, and SC2 under their own domains so I can link to just that domain when things are specific. It was actually surprising easy to do this, just a simple nginx rewrite rule and some modifications of the theme templates.

This is the entry for SC2:

server {
    listen       80;
    server_name  sc2.wraithan.net;

    location / {
        root   /srv/http/wraithan.net/output/;
        index  category/sc2.html;
    }

    #error_page  404              /404.html;

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

Then I changed the places that linked to the category in the template to look like:

<li {% if cat == category %}class="active"{% endif %}><a href="http://{{ cat.name.lower() }}.wraithan.net/">{{ cat }}</a></li>

I could (should) probably generalize it a bit better, but this is better than nothing!

Switching to Pelican

So, I haven’t been blogging lately because I’ve been meaning to scrap my Blogger setup and move to using Pelican. Part of the battle was getting a theme that made me happy, the other part of the battle was sitting down to actually make things happen.

First off, let me just say that Pelican is a pretty great platform. And I am not saying that because I have the pleasure of working with Alexis, but because it lets me use reST to write my entries and I can heavily customize everything about its display.

One of the things I knew I wanted was the ability to use bootstrap themes. Luckily someone else had already made that possible, two someones in fact! I found both of them in the pelican-themes repo which houses a number of themes for Pelican. themes/bootstrap and themes/bootstrap2 are the two that are included in this aggregation and I found I liked the layout of themes/bootstrap a bit more.

Unfortunately, I found that themes/bootstrap was built for a much older version of bootstrap and that I’d have to modify things to make it work. Also, I found a couple stylistic nits with it (especially when I changed to a darker theme) that needed addressing as well. Fortunately for me, it wasn’t very hard to update it to the newest bootstrap and I’ll be sending a pull request to pelican-themes with the fixes needed once I am pretty sure I have ironed everything out.

Get Involved

Getting involved is something I’ve blogged about a few times on here. Each time has been a pledge to get more involved in the open source community in different ways. I am more involved now than I have ever been previously. I feel comfortable finding an issue in a project, forking it, fixing it and sending a pull request. Also, I find myself writing docs for projects and sending them as pull requests as well.

I was reading a post from Alex Gaynor about funding open source developers. I am all for that and in fact am using Gittip to fund several developers. Currently, I only fund each developer $3/week, which only comes out to $13.50 a month for each of them. But, I am unsure how many people I am going to end up funding and want to feel things out a bit before I commit more than that.

Now I find myself putting forward a little time and money here and there to various projects but I still don’t feel like that is enough. I can’t seem to get past the 2-3 commits on a project then walk away mentality that I’ve built up.

My next goal is to become really involved in some project or community, and not because it is convenient but because I find it fun and engaging. In this goal though, I’m not going to beat myself up for not getting deep into a project. Just getting more commits in—be it docs, tests, or actual code—will improve my impact on the community. If I end up just being a nomad who dabbles in many projects but manages to consistently do that, I’m ok with that.

ZenIRCBot 2.2

ZenIRCBot! I haven’t spoken about this for a while on my blog but here I am. I gave a talk on ZenIRCBot yesterday here at Open Source Bridge. The talk wasn’t great but Eric Holscher also gave a talk and his was fantastic.

On to the main topic of this post though, something that I was working on months ago but got side tracked when I decided to finally get a job again is ZenIRCBot 2.2. Most of this update is the change from an internal API to ZenIRCBot API being its own beast that is on NPM and PyPI. The internal API is depreciated and I plan to remove it in 2.4. There will be no continued development on it. Instead the new API libraries will be developed. If you have additional languages that you’d like supported please feel free to write an equivalent library and send a pull request.

There should also be better protocol parity across the various versions of the bot (node.js, python and clojure). And the docs should much more closely match what happens, regardless of what version of the bot you are running. This was facilitated by finally writing a way of doing integration testing. It is still pretty new and developing rapidly but it has already served a great purposed.

If this release breaks anything for you please let me know, preferably as an issue on github.

Julython!

I just learned about a project that is rather exciting to me: Julython. If you are looking for an excuse to write some python, this is a great one.

The idea is to commit at least a little bit every day of July on a python project, preferably one that is open source. You get 10 points for committing to a tracked project for the first time and 1 point for each commit after that on the project. This is interesting because it encourages people to work on a wide variety of projects, as well as encouraging numerous small commits.

The variety of projects side is pretty rad, you can add tracking to forks of projects (so it at least tracks your fork) so you get big points for working on a lot of other peoples projects. Hopefully people who do that, then send a pull request to get their code integrated. I really enjoy the idea that I get lots of points for helping out and getting involved with a many projects.

The numerous small commits side is interesting as well. Some people subscribe to commit early, commit often. I try to but tend to get side tracked and end up with a lot of changes that I then have to split up into their own commits. If I am being lazy and it is a personal project, I might just be lazy and commit it all in one commit. This will encourage me to fix that habit.

Anyway, my main focuses for this month will be two projects of mine: ZenIRCBot and SC2Clan. I also hope to patch other people’s projects and get involved where I can in as many places as I can.