View AXFR zone file migration to PowerDNS
#!/bin/sh
# Quick and dirty zone file migration from AXFR to PowerDNS with MySQL backend. Contains zero error handling.
# $1 = zone (i.e. google.com)
# $2 = IP of the nameserver which allows AXFR for the zone in $1 (make sure to whitelist your outgoing IP on that nameserver)
dig +nosplit +onesoa @$2 $1 AXFR > /tmp/$zone.$$; zone2sql --gmysql --zone-name=$1 --zone=/tmp/$zone.$$ > /tmp/$1.zone; sed -i 's/NATIVE/MASTER/g' /tmp/$1.zone; rm /tmp/$zone.$$;
echo "SQL zone file is now available as /tmp/$1.zone"
echo "Import the SQL zone file using mysql -uroot -p pdns < /tmp/$1.zone"
echo "Important: Check the new zone with pdnsutil check-zone $1 after importing"
View sshfpgen.sh
#!/bin/bash
# Creates SSHFP Records for all available keys
#
# Copyright (c) 2013, John W. O'Brien
#
# See the accompanying LICENSE file for usage
#
# IANA code points
# https://www.iana.org/assignments/dns-sshfp-rr-parameters/
View Compiling Quagga with SNMP support
apt-get install iproute
apt-get build-dep quagga
export WANT_SNMP=1 && mkdir -p /root/src/quagga && cd /root/src/quagga && apt-get -b source quagga && cd /root/src/quagga
dpkg -i quagga_0.99.22.4-3ubuntu1_amd64.deb # (your version may be different)
apt-mark hold quagga # so it won't be replaced by a newer version unless we say so
View naswake.sh
#!/bin/sh
. /etc/rc.common
CheckForNetwork
while [ "${NETWORKUP}" != "-YES-" ]
do
sleep 1
NETWORKUP=
CheckForNetwork
done
/usr/local/bin/wakeonlan 00:08:9B:C5:BD:21 #<-- Enter NAS MAC address here
View com.trick77.wol.plist
<?xml version="1.0"
encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0">
<dict>
<key>Label</key>
<string>com.trick77.wol2</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/naswake.sh</string>
</array>
View virt-backup.pl
#!/usr/bin/perl -w
#
# 1. Install required dependencies:
# sudo apt-get install -y libxml-simple-perl pv libsys-virt-perl
# 2. Run it like this (assuming the LVM disk size is 20G):
# /virt-backup.pl --vm mykvm --state --snapsize=20G --backupdir /tmp --debug --compress
#
# AUTHOR
# Daniel Berteaud <daniel@firewall-services.com>
#
View gov.sh
#!/bin/bash
available_governors=$(cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors \
| head -1 | sed -e 's/ \([a-zA-Z0-9]\)/|\1/g' -e 's/ $//')
if [ $# -ne 1 ]
then
echo "Usage: $0 [$available_governors]"
fi
function current_cpu_governor ()
{
View gist:c86e374f8ee1998925c4
### Keybase proof
I hereby claim:
* I am trick77 on github.
* I am trick77 (https://keybase.io/trick77) on keybase.
* I have a public key whose fingerprint is 0D7F 1F4C 3C3E 5B04 D48B 9959 3F3D 3A43 8A08 8D6F
To claim this, I am signing this object: