A Wonderful world with ansible

1 minute read Published:

Ansible is a beautiful tool to help you manage a lot of linux server. It follows the philosophy that orchestrating servers should be dead simple rather than complex as writing software. Here some quick and simple use for ansible update apt cache and install python-requests: ansible all -u myuser -s -m apt -a "pkg=python-requests state=installed update_cache=yes" copy /tmp/myfile to any host : ansible all -u myuser -s -m copy -a "

From Screen to Tmux

2 minute read Published:

If you ever worked on long task you’ll end up having the need of detaching from your terminal and come back the next day, without loosing your output. This is where screen and tmux come handy, by making you able to detach your console and logging out. Lately i’ve been trying to migrate from screen to tmux, mostly because tmux looks more advanced and modern from screen. Thanks to this page it’s quite easy to migrate from screen to tmux

Killing in the name of

1 minute read Published:

Using psmisc in python i’ve found this function quite useful in many projects i’ve been working lately. Basically it will kill all the process older than one hour that match “name” All those try except are just to avoid permission denied on kill or on name check. def killing_in_the_name_of(name): now = time.time() for p in psutil.get_process_list(): exe = "" try: exe = p.exe except Exception,e: pass if name in exe: exetime = now - p.

A suitable vimrc for python

1 minute read Published:

Since i find myself in a lot of trouble when going to a new linux system due to misconfigured vim i thought i might share with you my tipical default configuration for vim that is good for developing in python here are the main lines, since i use a dark background i like a lot the “background=dark” feature set compatible syntax on set background=dark if has("autocmd") au BufReadPost * if line("