Skip to main content

Posts

Using Docker: Is it worth it?

Many companies these days are starting using Docker in their workflow, both big shots and tiny startups, even open-source projects which might sometimes be somewhat conservative when it comes to tools. I'm not trying to provide any kind of instruction here but instead to ask questions you should be asking yourself before following or not following their lead. I'm concentrating on context of web services using Django and Python, but it should be applicable to more or less anything. I must admit that Docker is cool. Linux containers is a fascinating thing itself and Docker is a great tool for simplifying their use for whatever purpose. Reusable and simple to build and share images, an easy way to launch those images and do stuff with them is a must if you use them. But should you containerize everything? It might, on the other hand, over-complicate your process without any significant benefits. So the first question is: do you even need containers or would you better off withou...

A small catch in Python documentation (strftime).

Every developer knows  datetime.strftime()  method, but some don't know that its argument's format is not documented in full in the official documentation. For example, you won't find any mention of %s directive there which means UNIX epoch time, timestamp. It works (at least with every major version of Python on Linux, FreeBSD, and MacOS), I've tested it a few times myself, it's just not documented. I recently saw a piece of code where developers, being unaware of such a directive, used custom format string with both datetime.now() and time.time(), a function generator, and on top of it messed with model migrations (it all was about FileField.upload_to if you know what I'm talking about) when they could just use %s. From other undocumented features you might be interested in these: %C  is a century (%Y//100), could be helpful for complimenting %y or something, I guess. %u  is a weekday number with Monday as 1 and Sunday as 7 (as opposed to %w represen...

Nice Python pack for Vim

I usually use Vim for my coding and all other stuff requiring text editing. There are a lot of plugins, scripts, configs, packs for Vim and a lot of them help with Python. But  so far I could not find the pack I'd love and I'm too lazy to make it on my own, so I usually throw out and re-create my whole Vim config dir once a year or so. This time I used Klen's Python Mode  and it's good judging by number of tools involved: almost all code style/syntax helpers I know (pep8, pep257, pyflakes, pylint, mccabe, and pylama to integrate them), autopep8 to help with formatting and stuff, rope for refactoring (sorry, I won't overwhelm this post with links – look for them in readme in github repo). It can more or less integrate with virtualenv and, of course, use Python syntax and identation plugins for Vim. It provides commands for almost everything but doesn't provide a lot of convenient hot-keys. Also there are no hotkeys for Django stuff: I'd like to have hotke...

Shinken – a Short Review of Nagios: The Next Generation

What's it all about Whatever services you are running, there always a need for monitoring. You want to know that you service is down before you customers or bosses fire you :) There are a lot of open source software and hosted services for that, but services are usually featureless or costly (or both) and open source solutions are often featureless and outdated as well. But some of them are different. For some reason Shinken  doesn't get much of attention these days and I intend to fix it somehow. For those of you who don't know it yet, Shinken is monitoring software not very unlike Nagios  (and backward-compatible with it in most cases). But it's totally re-written with Python and have a lot of ready to use 'modules' and 'configuration packs'. Pros Shinken's core was divided into several separated services: arbiter, scheduler, broker, poller, etc. connected over network. It gives both better scalability and better availability. You can...

Pricing of good continuous integration service – reply to codeship

I've recently discovered nice continuous integration and continuous deployment service – codeship.io . It's not just another hosted Jenkins and it has some very interesting features (like integration with major code hosting services and development tools). But I won't probably use it except maybe for some pet projects of mine with no active development. Here are my reasons why: Free plan is no good for even one project. 50 builds per month is not enough for anything: any project in active development usually needs several daily builds, even if not counting merges and feature branches. Commit early, commit often (and with CI it also means test often) is the usual approach of our days. Cheapest paid plan costs $50 per month. Yes, it has unlimited almost everything, but fifty bucks is small, but significant amount of money and small business (or non-profit project) can usually utilize them better. Setting up Jenkins, on the other hand, would cost you about $5/mo for host...