Skip to content

Instantly share code, notes, and snippets.

@x-way
x-way / punchcard.awk
Last active March 7, 2021 05:56
ASCII 'punchcard' graph for git commits
#!/usr/bin/awk -f
#
# punchcard.awk - ASCII 'punchcard' graph for git log
#
# Written in September 2011 by Andreas Jaggi <andreas.jaggi@waterwave.ch>
#
# usage:$ git log | punchcard.awk
# +-------------------------------------------------------------------------------------------------+
# Tue | . . o . . o O O 0 O |
# Wed | . . . . 0 O o |
word count
Error 18170
Invalid 9409
Failed 8514
No 8131
Unable 4962
Not 4935
Could 4422
Cannot 3888
Unknown 3409
@x-way
x-way / makeblacklist.sh
Created February 13, 2013 16:48
Create blacklist for HAVP from phishtank and adserver blacklists
#!/bin/sh
cd /etc/havp
OUTFILE=/etc/havp/blacklist
ADSERVERLIST=/etc/havp/adserverlist
PHISHTANK=/etc/havp/phishtank
MYBLACKLIST=/etc/havp/myblacklist
@x-way
x-way / index.php
Last active December 17, 2015 23:39
dyndns server
<?php
$myip = null;
$hostname = null;
$type = null;
$user = null;
$password = null;
$myzone = 'example.com';
$myserver = 'nameserver.example.com';
@x-way
x-way / glue_records.sh
Created May 28, 2013 08:35
Get the glue records for a domain
#!/bin/bash
TGT=$1
ROOT=${TGT##*.}
ROOT=${ROOT%.}
ROOT="${ROOT}."
RS=$(dig +short -t ns $ROOT|sed 1q)
dig +noall +additional +norec $TGT @$RS
@x-way
x-way / update_serials.sh
Created May 26, 2013 05:28
Update the serial number in BIND zone files with the current unix timestamp
#!/bin/bash
sed -i -e "s/[0-9]\{10\}/$(date +%10s)/" "$@"
#!/usr/bin/perl
#
# Written by Andreas Jaggi <andreas.jaggi@waterwave.ch> in December 2015
#
use strict;
use warnings;
use nflog;
use NetPacket::IP qw(IP_PROTO_UDP);
#!/usr/bin/python
#
# Written by Andreas Jaggi <andreas.jaggi@waterwave.ch> in December 2015
#
from socket import AF_INET, AF_INET6, inet_ntop
import nflog
from dpkt import ip, dns