Skip to content

Instantly share code, notes, and snippets.

(require '[clj-yaml.core :as yaml])
(require '[clojure.string :as str])
(defn heading? [line]
(re-matches #"[A-Z][A-Z0-9()\s]*[A-Z0-9)]" (str/trim line)))
(defn parse-man-page [lines]
(:data
(reduce (fn [acc line]
(if (heading? line)
@aaronbronow
aaronbronow / docker history by parent
Last active June 29, 2018 21:25
find linked docker parent and child images
for i in $(docker images -q)
do
docker history $i | grep -q $IMG && echo $i
done | sort -u
@aaronbronow
aaronbronow / 2-passwords.sh
Created December 8, 2017 03:05
get a short password-type string
### Thanks, ingy.net for this one that has no special package requirements
cat /dev/urandom | LC_CTYPE=C tr -cd a-zA-Z0-9+/ | fold -w12 | head -1
# or
openssl rand -base64 12
Folders:
~/.vagrant.d/
~/Dropbox*
~/Google\ Drive*
~/Library/Containers/com.docker.docker/data/database/
~/Library/Ethereum/
~/megasync/
Extensions:
wab~,vmc,vhd,vhdx,vdi,vo1,vo2,vsv,vud,iso,dmg,sparseimage,sys,cab,exe,msi,dll,dl_,wim,ost,o,qtch,log,ithmb,vmdk,vmem,vmsd,vmsn,vmss,vmx,vmxf,menudata,appicon,appinfo,pva,pvs,pvi,pvm,fdd,hds,drk,mem,nvram,hdd,qcow2,swapfile,sav,box
@aaronbronow
aaronbronow / regex-up-to-last-slash
Created October 4, 2016 20:41
regex match URL up to last slash
.*\\(?=[^\\]*$)
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND pg_stat_activity.datname = 'TARGET_DB';
@aaronbronow
aaronbronow / .bashrc
Last active August 2, 2016 17:52
Chromebook Ubuntu bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@aaronbronow
aaronbronow / gist:b9f89b796c6c9dd1623f
Last active August 28, 2015 20:22
vagrant timezone
timezone = 'US/Pacific'
config.vm.provision "shell", :inline =>
"echo #{timezone} | sudo tee /etc/timezone && sudo dpkg-reconfigure --frontend noninteractive tzdata"