This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ARGS="" | |
function usage() { | |
echo "Usage:" | |
echo " $0 [-c|--count] [-h|--help]" | |
echo "" | |
echo "Lists the folders currently known to LastPass." | |
echo "If the [-c|--count] argument is given, also lists a count per folder." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << EOF | sudo -u postgres psql -P pager=off maasdb 2> /dev/null | |
SELECT | |
sip.ip "bmc_ip", | |
node.hostname AS "machine_hostname", | |
bmc.power_type | |
FROM maasserver_bmc bmc | |
LEFT OUTER JOIN maasserver_staticipaddress sip | |
ON sip.id = bmc.ip_address_id | |
LEFT OUTER JOIN maasserver_node node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
if ! iptables -t filter -L FORWARD | grep PORT_FORWARD; then | |
iptables -t filter -N PORT_FORWARD | |
iptables -t filter -I FORWARD -j PORT_FORWARD | |
fi | |
if ! iptables -t nat -L PREROUTING | grep PORT_FORWARD_DNAT; then | |
iptables -t nat -N PORT_FORWARD_DNAT | |
iptables -t nat -I PREROUTING -j PORT_FORWARD_DNAT | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
TMPDIR="$(mktemp -d)" | |
function cleanup() { | |
rm -rf "$TMPDIR" | |
} | |
trap cleanup EXIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ps auxwwww | grep dhclient | grep -o '\-lf .*' | awk '{ print $2 }' \ | |
| xargs -n 1 grep -o 'dhcp-server-identifier [A-Za-z0-9\.:]*' 2> /dev/null \ | |
| sort -u | awk '{ print $2 }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo cat /proc/net/vlan/config | tail -n +3 | sed 's/\W*|\W*/ /g' | sort -n -k 3,2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import sys | |
import jinja2 | |
import markdown | |
# To install dependencies in a virtualenv: | |
# $ virtualenv ~/venv-markdown/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import json | |
import yaml | |
if __name__ == "__main__": | |
data = sys.stdin.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install -y bind9utils libbind-dev libkrb5-dev libssl-dev libcap-dev libxml2-dev | |
curl ftp://ftp.nominum.com/pub/nominum/dnsperf/2.0.0.0/dnsperf-src-2.0.0.0-1.tar.gz -O | |
tar xfvz dnsperf-src-2.0.0.0-1.tar.gz | |
cd dnsperf-src-2.0.0.0-1 | |
./configure | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from collections import OrderedDict | |
import socket | |
import sys | |
def print_route_lookup(host, addrinfo): | |
endpoints = set() | |
for info in addrinfo: |