Forward connection to local development environment in LAN

I needed a quick way to test a few things on a webapp running locally (on my Linux box) from another machine running Mac OSX.

Quick and easy way (although insecure, make sure you only do this on a private LAN) was to use socat.

Install on Archlinux (server):

sudo pacman -S socat

Install on the MacOSX client via homebrew:

brew install socat

Proxy local connection to the LAN (on the server; assuming the webapp runs locally on port 5000):

socat tcp-listen:8000,fork tcp:localhost:5000

Proxy remote connection to localhost (so we can access it with the benefits ...

Caching docker image on CircleCI

At BKNO3 we use Docker and docker-compose for development, in order to make sure every developer can easily and reliably set up a development environment locally, even if they're not familiar with the project itself (we have several components, with different developers working on each one).

The same docker containers are used to run continuous integration (on CircleCI) as well, in order to reduce the differences between the dev/ci/prod environments.

A big pain in doing so, however, was the time spent rebuilding the whole docker image every time the test suite was run, even if nothing changed ...

Even better testing, with py.test + tox + travis

I recently wrote a post about using py.test and tox. Now I improved the technique a bit, so here it is a new post with all the recent improvements.

(Please refer to that post for the problems I had to solve, and reasons behind the need of this kind of customizations).

The new test class

In order to properly support Python3, I'm using this test class in my

from setuptools.command.test import test as TestCommand

class PyTest(TestCommand):
    test_package_name = 'MyMainPackage'

    def finalize_options(self):
        _test_args = [
            '--cov={0}'.format(self.test_package_name ...

GitHub-pages-like publishing

I really love using GitHub pages for publishing stuff: I can easily setup the required steps to build & publish my website, and then forget about it.

When I need to make a change, I can just pull the latest copy, do the changes, push back and publish.

No need to remember to update remote copies, restart services, etc.

So, I decided to figure out a way to use the same workflow on my servers too, and this is what I came out with.

First, let me introduce ghp-import

It's a nice script to quickly import a directory in the ...

Auto-starting tmux with panes & services

I'm working on a django-based project that uses celery workers in order to run some heavy tasks. Plus, the UI is built using brunch.

So, each time I want to start all the needed services, I have to:

  • Open a bunch of terminals (usually in a tmux session)
  • Enable virtualenv in each terminal
  • Start the django development server
  • Start a celery worker
  • Start the brunch file-watcher service
  • Maybe open a htop too, just to monitor the resources usage

Of course, I'm not going to do that by hand each time. Instead, I wrote a tmux configuration script ...

Page 1 / 2 »