A DNS server with Batteries Included with PowerDNS, Docker and Python

Posted on Tue 06 September 2016 in Systems • Tagged with Docker, Python, REST, PowerDNSLeave a comment

If you have to frequently create, destroy and re-configure DNS zones for testing purposes you will agree that manually editing a Bind zone file is an annoying and error-prone task.

In order to make this job simpler I worked on this Docker container: the container instantiate a PowerDNS and provides ...

Continue reading

A server launcher with log console in Python Tkinter

Posted on Fri 13 March 2015 in Python • Tagged with GUI, Multithreading, python, Tkinter, UDPLeave a comment

I'm working on an Tk application that should start and stop an UDP server, I need to show server logs in the Tk GUI with a "Pause & Resume" button.

I already have the UDP server implemented using the blocking SocketServer.BaseRequestHandler , so in order to wrap a GUI to ...

Continue reading

SIP packets filtering with iptables

Posted on Wed 22 January 2014 in VoIP • Tagged with iptables, netfilter, python, sipLeave a comment

One of the most powerful iptables match is the u32 module.
Using the u32 match you are able to write a firewall rule matching against a single bit of a network packet.

If you wanna play with u32 module you have to be prepared to deal with a syntax very ...

Continue reading

Using special chars in Python string Templates

Posted on Wed 05 June 2013 in Python • Tagged with coding, python, strings, templatingLeave a comment

PEP-292 introduced a nice Python templating feature.
Templates placehoder names are subject to some restrictions,Documentation says:

$identifier names a substitution placeholder matching a mapping key of "identifier".
By default, "identifier" must spell a Python identifier.
The first non-identifier character after the $ character terminates this placeholder specification.

This means that ...

Continue reading

Encoding and decoding Encapsulated DHCP options (RFC 2132)

Posted on Fri 19 October 2012 in Python • Tagged with decoding, dhcp, encapsulated options, encoding, python, rfc2132Leave a comment

Vendor specific DHCP options may be provided encapsulated in DHCP option 43.
With this little script you can encode and decode vendor encapsulated option according to RFC 2132.

For example with this command you can tunnel options 66 (TFTP Server), 67 (TFTP Path), 132 (VLAN ID) and 133 (VLAN QOS ...

Continue reading

Simple CMS using web.py and Markdown

Posted on Fri 18 November 2011 in Python • Tagged with python, web.py, webapplicationsLeave a comment

With a bit of code you can build a simple but powerful, single page, CMS using python, web.py and content stored in markdown files.

1) the application: application.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20 ...
Continue reading

Client side result pagination in python-ldap

Posted on Tue 25 October 2011 in Python • Tagged with code, ldap, python, python-ldapLeave a comment

Sometime I must fighting with monkeys-configured LDAP servers.
This time DIT does not support RFC2696 (Paged Results for LDAP query), the data tree contains over 90000 entries.
Thanks to ldap.resiter is possible to implement client side pagination in ldap scripts.
These simple lines of code explain how to:

import ...
Continue reading

Reading Windows and Office product key

Posted on Wed 17 December 2008 in Hacks • Tagged with product key, python, registry, windowsLeave a comment

I product key di M\$ Windows e Office vengono salvati nel registro in alcune chiavi cifrate
Pygetkey decifra le chiavi e le stampa a video oppure le salva in chiaro in un'altra chiave di registro. Puo' inoltre preleveare i product key da un pc remoto.

Pygetkey è scritto in ...

Continue reading

Check_web_form.py

Posted on Wed 24 September 2008 in Systems • Tagged with http, nagios, pythonLeave a comment

Check script di nagios per eseguire il submit di un form e cercare dei valori nella response del server.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31 ...
Continue reading

Software

Posted on Sun 05 February 2006 in Hacks • Tagged with bacula, nagios, python, rsync, scriptLeave a comment

Era un progettino che avevo dato all’università : esegue dei backup differenziali o full utilizzando rsync: Batbu

Bacula: i .deb per sarge della 1.38.5 bacula-1.38.5 UPDATE: non piu' mantenuto

Plugin nagios:

  • check-imap-login Un plugin per nagios per eseguire un login su un server IMAP (o IMAPS ...
Continue reading