Jan 242013
 

nsupdate is a command line too that comes with ISC’s DNS server BIND. It can update RRs and more on your DNS server. Authentication is done with a key file.

First create keys using

dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 512 -n HOST sub.dyn.example.com.

then the tool nsupdate to remotely update the nameserver:

IPV6="2001:db8::dead:beaf"

#IPV4="192.168.0.2"
IPV4=$(curl -s "http://v4.ipv6-test.com/api/myip.php")
#IPV6="2001:db8::dead:beaf"
IPV6=$(curl -s 'http://v6.ipv6-test.com/api/myip.php')

KEY=/home/philipp/Kmyhost.dyn.example.com.+157+22656.key
NS=ns2.example.com
DOMAIN=myhost.dyn.example.com.
ZONE=dyn.example.com.

nsupdate -k $KEY -v << EOF
server $NS
zone $ZONE
update delete $DOMAIN A
update delete $DOMAIN AAAA
update add $DOMAIN 30 A $IPV4
update add $DOMAIN 30 AAAA $IPV6
show
send
EOF

Python Alternatives for nsupdate

Here is the script I came up with:

Dec 022012
 

Find out more about IP addresses (IPv4 and IPv6) using the Python module IPy:

#!/usr/bin/env python

from IPy import IP, IPSet

ip_s = raw_input('Please enter an IP address or range: ')
try:
    i = IP(ip_s)
except ValueError:
    print('Could not understand your input %s. Exiting.' % ip_s)
    from sys import exit
    exit(1)

print('I understood: %s' % i)
print('This is an IPv%d address.' % i.version())

#if i._prefixlen != 32: # a network
if len(i) > 1: # a network
    print('net: %s' % i.net())
    print('netmask: %s' % i.netmask())
    print('broadcast: %s' % i.broadcast())
    print('reverse notation of net address: %s' % i.reverseNames()[0])
    print('size of subnet: %s' % len(i))
else: # a single IP
    print('reverse notation: %s' % i.reverseNames()[0])

if i.version() == 6:
    print('normal notation: %s' % i.strNormal())
    print('full size notation: %s' % i.strFullsize())
print('hexadecimal notation: %s' % i.strHex())
print('string notation of binary value: %s' % i.strBin())
print('type of ip: %s' % i.iptype())
if i.get_mac(): print('found possible mac address: %s' % i.get_mac())
Jun 142012
 

I wrote a converter for Wikidot syntax that outputs Markdown syntax. You can use it to move from Wikidot.com to any Markdown based wiki / blog / note collection.

I set up an online converter that you can use to convert your Wikidot syntax files to Markdown.

The converter itself is written in Python and I published it on Github: wikidot-to-markdown.

The converter does not cover the full Wikidot syntax and features yet. If you would like another feature to be supported, fork the project on Github and implement it, or contact me about it.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Apr 262012
 

I found an interesting plugin called IntranetSubNetwork on the Piwik trac ticket #1054. I was thinking that this would be perfect to adopt it to my needs to determine between IPv4 and IPv6 users on my site. Those needs were already specified in a feature suggestion for Piwik.

So I took the plugin and put it on a Github repository: pklaus / IntranetSubNetwork.

With the plugin you’re able to assign each visitor to a ‘network category’ according to the range his or her IP belongs to. The network category name will then be stored in the Piwik database in the column location_ip of the table piwik_log_visit.

Piwik Plugin IntranetSubNetwork: Show IPv4 vs. IPv6 Statistics
Apr 232012
 

I needed an easy way to switch power outlets on and off remotely. So I bought a Koukaam NETIO230A and wrote a Python module to communicate with it via TCP. Now I added a Bottle based web app written in Python that uses that class to interact with the NETIO230A. It consists of an API (not very elaborate yet) and a single page that uses the API via AJAX.

Here is the finished Bottle code: webserver.py. And here is a screenshot of how the app looks:

Screenshot of the NETIO230A bottle web app

Mar 032012
 

If you want to use 10 Gigabit Ethernet at home you have to make a choice what technology you want to use. There are about eleven different standards for 10 Gigabit Ethernet, 6 using fiber optics and about 5 for copper connections.

Products are still relatively costly though. A cheaper alternative might be to use IP-over-Infiniband.

Fiber connectivity

At home you would rather choose multi-mode fibers (MMF) as they are cheaper and the distances at home are less than 300m long. (For long range communication you would use single-mode fibers – SMF.)
SMF cables are usually yellow, while MMF cables are orange or aqua.

Dec 282011
 

Get the requisite: AqBanking via Homebrew on Mac OS X:

brew install aqbanking
# ↑ At the time of writing (2011-12-28) this will get you AqBanking v5.0.16

Now set up your ING-DiBa online banking account (needs activated HBCI interface):

ktoblzcheck 50010517 5400040302
aqhbci-tool4 --help
aqhbci-tool4 adduser -N philipp -u 5400040302 -b 50010517 -s https://fints.ing-diba.de/fints/ -t pintan --hbciversion=220
# ↓ not needed for ING-DiBa (but possibly for Sparkasse, VR-Bank etc.)
#aqhbci-tool4 listitanmodes -b <blz>
#aqhbci-tool4 setitanmode -b <blz> -m 911
# ↓ not really needed (done automatically when running getsysid)
#aqhbci-tool4 getcert
aqhbci-tool4 getsysid
aqhbci-tool4 getaccounts
aqhbci-tool4 listaccounts

This will set up your aqbanking settings in .aqbanking/settings/. Now you’re ready to query your transactions:

Dec 112011
 

This is an iMacros script to extract transaction details on the online banking website of the German branch of the bank ING-DiBa. As this is mostly interesting to Germans, the following blog post is in German. If you want to read it in English, consider translating it using Google Translate.

Aug 132011
 

ENUM can be used to find out if you can call someone via VoIP instead of a regular call when all you have is the phone number. It works by sending a DNS like query for the phone number.

Possible ENUM servers are:

  • e164.arpa official!
  • e164.org
  • e164.info
  • enum.org

To query +43 780 004711 on e164.arpa run:

dig +short 1.1.7.4.0.0.0.8.7.3.4.e164.arpa any

The result is:

dns1.nemox.net. hostmaster.nemox.net. 2006022400 1200 3600 604800 600
dns1.nemox.net.
dns3.nemox.net.
dns4.nemox.net.
dns2.nemox.net.
100 10 "u" "E2U+sip" "!^.*$!sip:enum-test@sip.nemox.net!" .
100 10 "u" "E2U+web:http" "!^.*$!http://q.nemox.net/!" .
100 10 "u" "E2U+email:mailto" "!^.*$!mailto:info@nemox.net!" .

This mechanism is described in http://www.ietf.org/rfc/rfc2916.txt.

Jun 202011
 

Yesterday, I had to prepare for an exam at the University but instead of learning for it I wrote a small tool to browse the unicode characters. You can have a look at it on http://pklaus.github.com/js-Unicode-Selector. It’s fun to browse all the characters available on the Unicode system!

It also features permanent links for the character so if you want to share a character with somebody else, click on permalink, copy the adress and give it to somebody else.

js-Unicode-Selector – A tool to have a closer look at Unicode Symbols