Skip to content

Instantly share code, notes, and snippets.

Avatar

John Place UnixSage

View GitHub Profile
@UnixSage
UnixSage / MonitorIP.py
Last active Jul 5, 2020
Simple script that will monitor a list of names and make sure the IPs match. Useful if you not using CNAMES for APEX domains. Output can be put on a web server and monitored for status.
View MonitorIP.py
#!/usr/bin/env python3
import socket
import datetime
domainlist = {
'home.mydomain.com': 'user.myisp.net',
'mydomain.com': 'account.myhosting.com'
}
@UnixSage
UnixSage / DataDogExtract.py
Last active Sep 12, 2019
Get a filtered Hostlist and Tags from DataDog
View DataDogExtract.py
#!/usr/bin/env python3
import json
import requests
import os,sys,time,getopt
import configparser
helpinfo="""
Usage:
-s IncludeList
@UnixSage
UnixSage / genpass.py
Last active Mar 3, 2021
SysAdmin Password Tool
View genpass.py
#!/usr/bin/env python3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@UnixSage
UnixSage / MemorablePassword.py
Last active Dec 31, 2019
Generate random word password that are "Datacenter Compatable" meaning realistically typable into a console.
View MemorablePassword.py
#!/usr/bin/env python3
from random import choice,shuffle
import string
password=[]
words=[]
shortwords=[]
wordfile=open("/usr/share/dict/words")
@UnixSage
UnixSage / 6to4haproxy.cfg
Last active Sep 21, 2018
IPv6 to IPv4 Proxy
View 6to4haproxy.cfg
frontend localnodes
bind :::443 v4v6
mode tcp
default_backend nodes
timeout client 1m
backend nodes
mode tcp
balance roundrobin
server W.X.Y.Z:443
@UnixSage
UnixSage / CertBotGoDaddyAuthHook.sh
Last active May 8, 2021
Script to use with CertBot's --manual-auth-hook switch
View CertBotGoDaddyAuthHook.sh
#!/bin/sh
KEY="GoDaddyAuthKey"
SECRET="GoDaddySecret"
APISITE="api.godaddy.com"
BASEDOMAIN=`echo ${CERTBOT_DOMAIN} | awk -F. '{OFS="."; print $(NF-1),$(NF)}'`
SUBDOMAIN=`echo ${CERTBOT_DOMAIN} | sed -e 's/'${BASEDOMAIN}'//' -e 's/\.$//'`
@UnixSage
UnixSage / rock-bottom-calc.pl
Last active Mar 17, 2018
Rock Bottom Table Generator
View rock-bottom-calc.pl
#!/usr/bin/perl
# mod-ead-calc
# By: John C. Place
# http://www.unixsage.com
print <<EOT
Assumptions:
<ul>
<li>Stressed diver SAC rate 1cf/min
<li>1 min to sort out problem at depth
@UnixSage
UnixSage / mod-ead-calc.pl
Last active Mar 17, 2018
Generate EAD (Equivalent Air Depth) tables For SCUBA Diving
View mod-ead-calc.pl
#!/bin/perl
# mod-ead-calc
# By: John C. Place
# http://www.unixsage.com
print "<title>Maximim Operating Depth and Eqivlant Air Depth Table</title>\n";
print "<table border cellpadding=\"3\">\n";
print "<caption>Maximim Operating Depth and Eqivlant Air Depth Table (fsw)</caption>";
for($x=20; $x <= 100; $x+=2) {
@UnixSage
UnixSage / haproxy.cfg
Last active Mar 17, 2018
Using haproxy as a shim between a SSLv3 Interface and a modern browser
View haproxy.cfg
global
daemon
maxconn 1028
tune.ssl.default-dh-param 1024
user haproxy
group haproxy
log 127.0.0.1 local0
defaults
timeout connect 5000ms
View keybase.md

Keybase proof

I hereby claim:

  • I am unixsage on github.
  • I am unixsage (https://keybase.io/unixsage) on keybase.
  • I have a public key whose fingerprint is 8ED3 5054 68A8 86AF 537B AD5B 2CFD B395 BE67 3984

To claim this, I am signing this object: