// archives

Python

This tag is associated with 5 posts

data2sound, audible covert channel

Via reddit I have found this interesting piece of software, for now it is just a PoC showing in a simple way how to code data into sound. The approach works perfectly and it could be improved with not so much work to produce some of that “8bits music”. The package contains two python scripts, [...]

Python: Simple Socket Server

The simplest socket server, don’t know why but I always forget how bind is used in python. import socket   sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(("127.0.0.1", 1024 + 666)) sock.listen(5)     client, details = sock.accept() while 1: data = client.recv(1024) print "data : %s" % repr(data)

Python: POST XML over HTTP

Short post to remind myself how to do HTTP requests using python, really easy stuff that I quickly forget. Straight forward example using httplib and urllib from python. In the example I just perform some kind of login request retrieve the session id and then other request sending XML data using POST. Code! Feel free [...]

Twitter Internal Fragmentation: Python + Twitter

As a toy project to play a little bit more with Python and accessing Twitter, I came out with the idea of calculating the Internal Fragmentation of user’s tweet. To interface with Twitter services I used the Twitter extension located at http://code.google.com/p/python-twitter/, which has a pretty straightforward API. The script shown below gives you back [...]

SQUID + Active Directory

A few post ago I wrote about integrating SQUID and Active Directory in order to allow/deny users to access specific webpages depeding on the groups a user belongs. The windows package of Squid comes with several external programs which can be used as external ACLs which allow you to query the local Active Directory in [...]