ciplogic.com
Live with grace. Write superb software.

A while back, in November 2014, I was posting an article showing that over the course of a year and a half or so (my blog was rehosted from February 2014), fail2ban blocked 1633 IPs.

Today I checked again, and to my surprise I got:

[root@ciplogic ~]# iptables -L -n | grep REJECT | wc -l
5853

For the first time segment (273 days period) I averaged 5.98 IP bans a day. From that day to today I got: 5853-1633 = 4220 new bans. The time period from November 2014 to today is 573 days.

That means in the last year the banning grew to 7.36 bans a day (~20% increase). And we need to remember that this is also with the previous backlist.

So today, beside applauding fail2ban's relentless work, I changed the port of the SSH server.

To my surprise from this morning, until now, there is radio silence from the fail2ban new bans. I guess most scanners don't do a port scanning first, and they just try to find default or weirdly configured SSH servers.

So here's my second tip. Change your SSH server port.

A while back I wrote a small program named fast-live-reload. The point of it was to be able to do things whenever files change (be that refreshing browsers, or executing programs, such as Compass compilation).

Here is another sample on how I use it to try out python snippets really fast:

I basically split my current view in two (using byobu), and I edit in the left view with my trusty vim. Whenever I save, fast-live-reload picks it up and executes the script.

Instant feedback is instant ;-).

Finally the site is now online.

If you want to jump into web based integration testing, then all you need installed is python regardless of verson 2 or 3, and get Germanium:

pip install germanium

Writing a test becomes then as easy as:

from germanium.static import *
from time import sleep
 
open_browser("ff")
go_to("http://www.google.com")
type_keys("germanium pypy<enter>", Input("q"))
wait(Link("Python Package Index"))
click(Link("Python Package Index"))
sleep(5)
close_browser()

The full documentation is available under the API Documentation link.

Since I already wrote an article on having Docker running with OverlayFS on Ubuntu 14.04, I won't go over all of it again. Here is a not so quick link on why it's cool to have it. Basically it's faster, harder, better, stronger, and scales better.

The only note is that since Ubuntu comes with v4 Kernels, there is no need to install any more packages except docker itself. The commands below must be ran as root.

TL;DR Docker With OverlayFS on Ubuntu 16.04:

wget https://get.docker.com -O - | sh
 
systemctl stop docker
 
CONFIGURATION_FILE=$(systemctl show --property=FragmentPath docker | cut -f2 -d=)
cp $CONFIGURATION_FILE /etc/systemd/system/docker.service
 
perl -pi -e 's/^(ExecStart=.+)$/$1 -s overlay/' /etc/systemd/system/docker.service
 
systemctl daemon-reload
systemctl start docker

Details

The first step just installs docker, straight from docker.com.

wget https://get.docker.com -O - | sh

Awesome. The problem now is that it runs with the aufs driver, so we need to stop docker.

systemctl stop docker

The next step is to create a copy of the current configuration file from the system itself. We will override the configuration from the system by copying it as /etc/systemd/system/docker.service .

CONFIGURATION_FILE=$(systemctl show --property=FragmentPath docker | cut -f2 -d=)
cp $CONFIGURATION_FILE /etc/systemd/system/docker.service

Now, we change the ExecStart line by appending the OverlayFS setting:

perl -pi -e 's/^(ExecStart=.+)$/$1 -s overlay/' /etc/systemd/system/docker.service

We now tell systemd that the configuration files have updated, and start docker again:

systemctl daemon-reload
systemctl start docker

Done. Enjoy.

 

I am happy to announce the availability of Germanium 1.7.3.

Germanium is an Python API simplifying WebDriver access into very simple commands, making for very readable code:

from germanium.static import *
from time import sleep
 
open_browser("ff")
go_to("http://www.google.com")
type_keys("germanium pypy<enter>", Input("q"))
wait(Link("Python Package Index"))
click(Link("Python Package Index"))
sleep(5)
close_browser()

It's best used for test automation, and is available straight from pip:

pip install germanium

Germanium is tested against Python 2.7, Python 3.4 and Python 3.5, and Firefox, Chrome and IE on each release.

Also, it has pretty decent documentation.

Enjoy using it :), and if you have any issues with it, questions, feature requests, etc. please open up an issue on GitHub.

Disqus Comments

comments powered by Disqus

Germanium

The one to rule them all. The browsers that is.

SharpKnight

SharpKnight is an Android chess game.

MagicGroup

MagicGroup is an eclipse plugin.