Computer

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("