PowerDNS Script to add new zones using pdnsutil

vertical server racks and clean cabling

I recently began using PowerDNS, and it has a really nice command line utility called “pdnsutil” which is sadly under-documented, so I am sharing my bash script which creates a new zone and a reverse dns zone, using pdnsutil.

This script is extremely basic, and I welcome any efforts to fork and improve it.

Be sure to specify your own nameservers where I have placed ns1.nameserver.com and ns2.nameserver.com

The DKIM record is based on a ‘standard’ DKIM configuration that I use, yours may vary.

anti-spam script

Monty Python spam skit

I created a script to notify the abuse@ person for an IP address, while simultaneously banning that IP address for a time-period using fail2ban.

In my case this is useful for spam that I receive through a web based contact form. I don’t want to put a captcha on the form, and most of the spam was coming from the same IPs every day.

This script depends on curl, pcregrep and fail2ban. You could replace fail2ban with iptables however setting an expiration date with iptables alone is more complicated. Since I use fail2ban everywhere (and you should too), this method is just easier. pcregrep is required for doing a multi-line regex match.

How to Disassemble & Repair the official Disney Store Zootopia Carrot Pen

Zootopia Carrot Pen

I’m a big fan of the film so when I saw they had this pen I had to buy one. It records great and writes adequately. It is possible to replace the pen part, however one should take great care when disassembling so as not to break any of the plastic bits.

There was one issue which seems like a defect to me. The spring on the pen is a bit too large for it, and on mine it shifted up and wedged itself on the block which is supposed to keep the spring down. As a result the retractable feature stopped working.

To repair the retractability, I carefully disassembled the pen:
1. There are two covered screws near the top, the covers can be removed with a sewing needle.

2. The silver cone tip is where everything locks together so that is where one must be very careful not to break the pen. The cone has two ‘teeth’ which fit inside the two orange halves, and each orange half has a tooth which fits into the cone.

3. Once disassembled, a bit of electrical tape wrapped tightly around the “blocker” part of the pen, just above where the spring goes, will keep the spring from shifting upward. A smaller spring might be a better solution, but who knows where to find such a thing.

~ fin

UPDATE Jan 7th, 2017

The pen broke again a few weeks ago, sadly.. The electrical tape must have slid from it’s spot as I feared it might. I’ll need a more permanent solution, perhaps a tiny bit of epoxy. It’s a low priority, I really love the pen, perhaps I’ll write Disney and asked if they’ve addressed the issue in a new batch.