Skip to content

Instantly share code, notes, and snippets.

Curtis Doty dotysan

Block or report user

Report or block dotysan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dotysan
dotysan / ca-certgun-roster.sh
Last active Jan 3, 2019
California roster of handguns
View ca-certgun-roster.sh
#! /usr/bin/env bash
#
# fetches the California roster of handguns certified for sale
#
set -x
main() {
today=$(date +%F)
curl --verbose --output certguns-$today.html 'https://www.oag.ca.gov/firearms/certguns'
echo '"Manufacturer","Model","Gun Type","Barrel Length","Caliber","Expires"' >certguns-$today.csv
@dotysan
dotysan / java-buh-bye.sh
Created Sep 13, 2018
erradicate java on a Mac
View java-buh-bye.sh
sudo rm -rf \
/Library/Application\ Support/Oracle \
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin \
/Library/Java \
/Library/PreferencePanes/JavaControlPanel.prefPane \
/Library/Preferences/com.oracle.java.Helper-Tool.plist
rm -fr \
~/Library/Application\ Support/Java \
~/Library/Application\ Support/Oracle \
@dotysan
dotysan / nsec3prober.py
Last active Oct 12, 2016
Probe DNS TLDs for NSEC3 usage.
View nsec3prober.py
#!/usr/bin/env python3
# Copyright (C) 2012 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
View dmarc-peek.sh
#! /usr/bin/env bash
#! /bin/bash
set -e
# associative arrays requre bash v4; here's cute way to find it
if [ ${BASH_VERSINFO[0]} -lt 4 ]
# BEWARE! exec in a subshell doesn't. So we must use `for shell in
# $(which -a bash)` instead of `which -a bash |while read shell`.
then for shell in $(which -a bash)
do if [ $("$shell" -c 'echo ${BASH_VERSINFO[0]}') -ge 4 ]
@dotysan
dotysan / mkcrypt.sh
Created Jun 17, 2016
Cheap attempt to generate a random password and its crypt-pw using mostly bash.
View mkcrypt.sh
#! /bin/bash -e
#
# Cheap attempt to generate a random password and its crypt-pw using mostly bash.
#
SALT="./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
mkapass() {
local len=${1-8}
while [ ${n:=1} -le $len ]
View remote-headless-nx.sh
#! /bin/bash -ex
#
# reminder/notes on how to remotely install NX over ssh
#
#there=${1-bonehead@192.0.2.1}
#ssh $there
cd ~/Downloads
# assuming this the latest version?
@dotysan
dotysan / remote-headless-brew.md
Last active Apr 18, 2017
Remotely install Homebrew over ssh.
View remote-headless-brew.md
@dotysan
dotysan / lacp.tcl
Created Jun 30, 2015
snippet to lean LACP members
View lacp.tcl
# also fill an array with port-channel members so we can exclude them
set LACP [list]
if {$showLACP =="" && $tcl_platform(machine) =="Switch"} {
foreach word [split [exec "show etherc summ | begin ^\[0-9]"]] {
if [string is integer -strict $word] {
set portchannel $word
}
if [regexp {(.*)\(P\)$} $word -> lacp] {
lappend LACP $lacp
} } }
View gist:f955467436b1e530578d
#! /bin/bash -ex
#
# crib notes on how to bootstrap midnight commander single-user
#
lf=libffi-3.1
gl=glib-2.43.0
sl=slang-2.3.0
mc=mc-4.8.13
@dotysan
dotysan / get-github-user-info.js
Created Mar 29, 2014
newbie exercise with PhantomJS and web scraping
View get-github-user-info.js
#! /bin/env phantomjs
/*
Teaching myself:
- [hopefully] clean/readable JavaScript coding
- PhantomJS to render a page from command-line
- using CSS selector to scrape an element value from DOM
*/
var SYS= require('system');
if(SYS.args.length <2) {
You can’t perform that action at this time.