Skip to content

Instantly share code, notes, and snippets.

View stickystyle's full-sized avatar

Ryan Parrish stickystyle

  • nXT Software Solutions
  • Winston-Salem, NC
View GitHub Profile
@stickystyle
stickystyle / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@stickystyle
stickystyle / Example Dockerfile
Last active January 13, 2021 03:52
Simple script to configure apt to use a squid-deb-proxy server configured at the _apt-proxy._tcp SRV record for the configured search domain
#just put this in your Dockerfile prior to doing any apt-get operations and your build will use the proxy
FROM ubuntu:14.04
RUN apt-get install -y --no-install-recommends dnsutils
ADD squid-deb-proxy-discover-setup.sh /root/
RUN /root/squid-deb-proxy-discover-setup.sh
@stickystyle
stickystyle / aptproxy.sh
Created March 31, 2015 20:47
lookup the apt-proxy server by its zeroconf srv record
#!/bin/sh
dig +nocmd +noall +answer @224.0.0.251 -p 5353 -t ptr _apt_proxy._tcp.local > /tmp/aptproxy
APTPROXY_HOST=$(grep "IN\sA\s" /tmp/aptproxy | awk '{print $5}')
APTPROXY_PORT=$(grep "IN\sSRV" /tmp/aptproxy | awk '{print $7}')
echo "Acquire::http::Proxy \"http://$APTPROXY_HOST:$APTPROXY_PORT\";" > /etc/apt/apt.conf.d/30proxy
@stickystyle
stickystyle / MySQL network benchmark
Created April 13, 2015 16:07
Simple script to monitor the network latencey between app servers and DB servers
#!/bin/env python
import timeit
loops = 1000
setup = """
import MySQLdb
db = MySQLdb.connect(host="remotedb.example.com",
read_default_file="/root/.my.cnf",
#!/bin/sh
datestr=`date +'%Y-%m-%d'`
filename="$datestr.json"
pouchdb-dump http://couchdb:5984/tenants-103 -o www/appdata/$filename
@stickystyle
stickystyle / backup_packages.sh
Last active March 19, 2018 17:27
Auto-backup installed packages
#!/bin/bash
UPDATED="#Updated: $(date)"
PATH=/usr/local/bin:/usr/local/sbin:$PATH
echo $UPDATED > ~/Dropbox/home/python/requirements.txt
pip3 freeze >> ~/Dropbox/home/python/requirements.txt
echo $UPDATED > ~/Dropbox/home/homebrew/leaves.txt
brew leaves >> ~/Dropbox/home/homebrew/leaves.txt
echo $UPDATED > ~/Dropbox/home/homebrew/casks.txt
brew cask list >> ~/Dropbox/home/homebrew/casks.txt
; See comskip.txt in the distribution zip file for many settable parameters, read manual.html, tuning.html and debugwindow.html for how to tune and debug comskip
detect_method=43 ; 1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all
validate_silence=1 ; Default, set to 0 to force using this clues if selected above.
validate_uniform=1 ; Default, set to 0 to force using this clues (like pure white frames) if blackframe is selected above.
validate_scenechange=1 ; Default, set to 0 to force using this clues if selected above.
verbose=10 ; show a lot of extra info, level 5 is also OK, set to 0 to disable
max_brightness=60 ; frame not black if any pixels checked are greater than this (scale 0 to 255)
test_brightness=40 ; frame not pure black if any pixels checked are greater than this, will
import sys
from random import randint
"""
*Snail Racing Rules*
Every snail needs a jockey, and any saddles not filled by characters are filled by other attendees
(use the commoner stat block to represent these NPCs). All the snails and their riders begin at the start line;
fireworks signal the start of the race, after which the riders race their snails to the finish line.
On a whiteboard or notepad, jot down the giant snails, their numbers, and their riders. Next to the names,