Monday, December 31, 2012

When Spammers Attack, Make Musubi

Musubi is a little tool I wrote to check your mail servers' reputation on DNSBLs. There are quite a few of these scripts out there, but this one does more than simply check a list of DNSBLs.


Unlike other scripts I found, when musubi finds an IP listed on a DNSBL, it also queries for a DNS TXT record to find the reason you were blacklisted.

Finding all your mail servers' IPs can be a little confusing. Musubi will take a domain name, find the MX records, give you all the IPS for the servers and make sure the reverse DNS (PTR) is correct. It also fetches SPF TXT records.

Normally, you'd use a tool like 'dig' to figure this all out. I wanted something the average person can use without needing to use multiple 'dig' commands.

If you work for an ISP or web hosting company, you can throw a whole range of IPs at Musubi for your shared hosting using CIDR notation.

Most ISPs and web hosting companies have their own internal tools for this, but you may want to take a look at Musubi if you used threads. Musubi uses gevent and is very fast (hundreds of DNSBL lookups in seconds) thanks to some borrowed code from Vince Carney's dnsbl.py.

Musubi uses cliff for the command-line framework and is easily extensible. Web front-end with scheduled checks, Twilio SMS notification etc. are coming next.

I wrote most of this while helping a friend in a panic fix his company's PTR records and add an SPF record for his mail servers that were getting blacklisted, so it's a bit messy and un-tested. 0.1 is available on Github and PyPi

    https://github.com/cakebread/musubi
    http://pypi.python.org/pypi/musubi

Wednesday, April 4, 2012

Twerp 0.0.5 Released

I'm excited to announce Twerp 0.0.5 is available. Twerp is the telephone hackers toolkit. It's a command-line app for Twilio written in Python.

New features in 0.0.5:

from the command-line:
  • Voice conferences: create, join, list conferences and participants
  • Buy new phone numbers with basic searching by area code or phrase  
  • Account management: list, rename and create new Twilio sub-accounts
  • Application management: list your Twilio Apps

Twerp exposes a lot of the Twilio API, so you have to be careful if you're using a live account. You can cancel all calls in progress for example, re-route calls etc.

Use a Twilio Sub-Account

Creating a Twilio sub-account with just one or two phone numbers for testing will save you a lot of headaches.

First, create a new Twilio sub-account:

$ twerp --create-sub-account Testing

$ twerp --list-accounts

cakebread
ACnnnnnnnnnnnnnnnnnnnnnnnn

Testing
ACnnnnnnnnnnnnnnnnnnnnnnnn


Now if you login to twilio.com, you'll see a drop-down box where your Master account name was (usually your email address):




Replace the master Twilio ACCOUNT_SID and AUTH_TOKEN in ~/.twerprc with your new sub-account information and you're all set.

 Now you can buy a number for that sub-account:

$ twerp  --area-code 310

 +1 310-555-1212
  ...
  ...

$ twerp --buy +13105551212

And annoy your co-workers with your new phone number:

   $ twerp -d 213-555-9999 --say 'Hi, this is twerp. Good bye.'

Monday, February 6, 2012

Yolk development

I released 0.4.3 last night because 0.4.2 was missing some documentation and license files. I may release a 0.4.4 this week. This release will contain some user-submitted patches.

Today in yolk development:
  • Tox for testing yolk with Python 2.6, 2.7 and 3.2.
  • py.test for unit tests
  • Jenkins for continuous integration (using Tox and py.test)
  • git-flow for managing it all
I'm still configuring Jenkins to do everything I want, but it's been working great with Tox + py.test, so far. [Edit: Jenkins is up at http://cakebread.info/jenkins]

The current code base will become 1.0 soon. This branch will support Python <=2.5 and may or may not get new features from the upcoming 2.0 branch.

The 2.0 branch (origin/develop on github) will work with both Python 2 and Python 3.

Sunday, February 5, 2012

I've released yolk 0.4.2!



yolk 0.4.2 is a bug fix release in preparation for supporting both Python 2 and 3.  Yes, it's time to get yolk off of the Python3 Wall of Shame.


I'm using gitflow to manage yolk's release and it is working great, so far.

Two bug fixes:
  •  --entry-map patch from Jesus Rivero (Neurogeek)
  • Fix for -C if you don't supply an integer
I've also switched to the BSD license from the GPL-2.

I'm working my way through some old bug reports and should have 0.4.3 out shortly.

The 'develop' branch on github is going to be used for the Python2/3 version.

Tuesday, January 17, 2012

twerp - Command-line tool for Twilio hackers

I released twerp 0.0.4 today. Here's what you can do with twerp from the command-line today:


  •  Send and receive SMS text messages
  • Make voice calls and conference calls
  • List all calls in progress, ringing or queued
  • Enter interactive mode after initiating call and controlling call flow live
  • Tail your Twilio API error log from the command-line!
  • List all your Twilio phone numbers and detailed info about each
  • Show log entries for given SID
I'm going to make a screencast showing how to use twerp to start a phone call, go into interactive mode and control the flow of the call by issuing commands. 

Here's an example:

twerp --dial +12135551212 --say "Hi, this is twerp calling. How are you?" --interactive
 twerp (CA3j...043) >> forward +18005551212
twerp (CA3j...043) >> url http://server.com/some_twiml.xml
twerp (...)  >> list
Ringing: CAaaec865YADAYADA68c4a864ec
twerp (CA209...9ec) >> hangup
Call hung up.

There's not much point in making a TODO now, because twerp has barely covered a fraction of the Twilio API. That said, it's already very useful for hacking on Twilio, understanding how call flow works with TwiML, checking your Twilio logs etc.


In the near future:


  • Put your TwiML in ~/.twerp/twiml/ and you can execute it without uploading it to a server (it simply uses the Twimlet for echoing TwiML).
  • Easier conference calling with interactive control from the command-line or via touchpad
  • Distribute-based plugin system using entry points so you can make your own command-line applications based on twerp, installable with pip.

Friday, January 6, 2012

Guided by Tones - a Guided by Voices Useless Invention

Guided by Tones is a little project I made to celebrate the release of the new Guided by Voices album with the original line-up.

Some of the sound clips are from Robert Pollard's "Relaxation of the Asshole" album.

+1 877-860-0GBV or +1 877-860-0428


Thursday, January 5, 2012

twerp a Twilio command-line client for 2012

twerp is my Twilio command-line client written in Python. I'm releasing it early, but have a ton of features in the works. This is my Twilio hacker DOer tool for 2012, so I may be entering it in their contest. Or, as I guess they'd say, I'm drawing fucking owls!

Current features in 0.0.1:
  • Send and receive SMS text messages on the command line
  • List your Twilio phone numbers with details about each (ACCOUNT_SID, various URLs etc.)
  • Check your logs by message ID to see if it sent successfully
Feature plans in the works:

  • Initiate calls from the command line and directing them to TWIML (due later today!)
  • Full featured text messaging GUI using urwid curses library on the command line
  • Generate TWIML on the command-line and launch a Flask app for quick testing and prototyping
  • Python Distribute based plugin system so you can extend twerp with separate Python pacakges