This file contains hidden or 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 | |
mkdir -p ~/var/lib/mc | |
MC_VERSIONS_CACHE="$HOME/var/lib/mc/version_manifest.json" | |
RELEASE_JSON="$HOME/var/lib/mc/_release.json" | |
SNAPSHOT_JSON="$HOME/var/lib/mc/_snapshot.json" | |
curl -sS https://launchermeta.mojang.com/mc/game/version_manifest.json > $MC_VERSIONS_CACHE | |
# cat $MC_VERSIONS_CACHE | jq | |
LATEST_SNAPSHOT=$(cat $MC_VERSIONS_CACHE | jq -r '{latest: .latest.snapshot} | .[]') |
This file contains hidden or 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: |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder