Skip to content

Instantly share code, notes, and snippets.

View bng44270's full-sized avatar

Andy Carlson bng44270

View GitHub Profile
@bng44270
bng44270 / genssh.applescript
Created April 10, 2020 12:33
Generate SSH Key Pairs with AppleScript
set appname to ""
set keypass to ""
repeat
set appname to text returned of (display dialog "Enter application name" default answer "")
if (length of appname) > 0 then exit repeat
end repeat
repeat
set keypass to text returned of (display dialog "Enter key password" default answer "" with hidden answer)
@bng44270
bng44270 / deftype.c
Created April 10, 2020 12:41
Custom Type Definitions in C
/*
Data type specific memory allocation
Types:
uInt(unsigned int)
sInt(signed int)
uChar(unsigned char)
sChar(signed char)
uShort(unsigned short)
sShort(signed short)
@bng44270
bng44270 / ddwrt.conf
Created April 10, 2020 12:48
Reverse Proxy DD-WRT through Apache
##################################
# ddwrt.conf
#
# Reverse Proxy DD-wrt through Apache
#
# Usage:
#
# Use DDwrtProxyHTTP /ddwrt 192.168.1.1 www.andydoestech.com
#
# ^---Makes dd-wrt accessble via http://www.andydoestech.com/ddwrt/
@bng44270
bng44270 / monit.conf
Created April 10, 2020 12:48
Reverse Proxy Monit through Apache
#####################################
#
# For use with Monit: https://mmonit.com/monit/
#
# New: added search box to top of page
#
# Usage:
# Use MonitProxy /monit 127.0.0.1 2812
# ^--- Make Monit server running on 127.0.0.1:2812 available
# through the parent VirtualHost
@bng44270
bng44270 / jserial.js
Created April 10, 2020 12:52
Serialize Functions in JavaScript
/*
Define/Run serialized functions in JavaScript
Define serialized function:
var serialF = SerDef(function(a,b) {
return {
sum : a + b,
avg : (a + b)/2
@bng44270
bng44270 / slideomatic.js
Created April 10, 2020 12:53
Create custom slideshows with JavaScript
/***********************************************
slideomatic.js
Creates slideshows of sequentially named image files (ex: 1.jpg, 2.jpg, 3.jpg, etc.)
Required jquery
Arguments:
|-------------|-----------------------------------------------|
| slideid | ID of DOM object containing slideshow |
@bng44270
bng44270 / fundraiser-thermometer.js
Created April 10, 2020 12:54
Create a dynamic thermometer in JavaScript
/*
Required jquery
Installation Steps:
1) Add tag to <head> of your page.
<script type="text/javascript" src="https://bng44270.github.io/f6a914479e3c99351d8d43a603f84124/fundraiser-thermometer.js"></script>
2) Add a the following tag on your page. This tag will contain the thermometer. (you can change the "id" value)
<div id="mythermometer"></div>
@bng44270
bng44270 / arin.py
Created April 10, 2020 16:16
Search ARIN for IP address or ASN
import requests
from arguments import Arguments
from sys import argv as command_arguments
arinjson = lambda x : requests.get("http://whois.arin.net/ui/query.do?queryinput={}".format(x),headers={"Accept":"application/json"},verify=False).json()
# print indented outline-style representation of dictionary object
def dictol(this_dictionary):
try:
prefix = this_dictionary['pf']
@bng44270
bng44270 / asn2ip.py
Created April 10, 2020 16:17
Use ARIN to translate ASN to IP address
import requests
from arguments import Arguments
from sys import argv as command_args
arinjson = lambda x : requests.get("http://whois.arin.net/ui/query.do?queryinput={}".format(x),headers={"Accept":"application/json"},verify=False).json()
ARGS = Arguments(command_args)
if not ARGS.Get('a'):
print "usage: asn2ip.py -a <ASN>"
@bng44270
bng44270 / clamav_json_dump.py
Created April 10, 2020 16:23
Dump ClamAV HDB file to JSON
#Requires Python 3.6
from arguments import Arguments
import requests
import tarfile
import io
import re
import sys
def usage():