Skip to content

Instantly share code, notes, and snippets.

Avatar

John Place UnixSage

View GitHub Profile
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:

@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
@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 / 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 / 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 / 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 / CertBotDuckDNS-AuthHook.sh
Last active Nov 13, 2019
Script to use with CertBot's --manual-auth-hook switch
View CertBotDuckDNS-AuthHook.sh
#!/bin/sh
TOKEN="Your-Duck-DNS-Token"
BASEDOMAIN=`echo ${CERTBOT_DOMAIN} | awk -F. '{OFS="."; print $(NF-1),$(NF)}'`
echo $CERTBOT_DOMAIN
curl "https://www.duckdns.org/update?domains=${CERTBOT_DOMAIN}&token=${TOKEN}&txt=${CERTBOT_VALIDATION}"
@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 / GetBitBucketRepos.sh
Created Apr 7, 2020
Simple Script to get a list of BitBucket repos for a given team
View GetBitBucketRepos.sh
#!/bin/bash
USER="##USER_NAME_NOT_EMAIL"
SECRET="##SECRET##"
TEAM="##TEAMNAME##"
CACHE="/tmp/repolist.$$"
REPOFILE="/tmp/repolist.txt"
URL="https://api.bitbucket.org/2.0/repositories/${TEAM}?pagelen=100"
@UnixSage
UnixSage / CertBotManualAuthHook.sh
Last active May 5, 2020
Manual Script for CertBot for manual DNS Changes...
View CertBotManualAuthHook.sh
#!/bin/sh
echo "Domain: _acme-challenge.${CERTBOT_DOMAIN}" > /tmp/Manual.log
echo "Secret: ${CERTBOT_VALIDATION}" >> /tmp/Manual.log
echo "Looking for /tmp/done.$$" >> /tmp/Manual.log
while [ ! -f /tmp/done.$$ ]
do
sleep 2