I hereby claim:
- I am jcpetrucci on github.
- I am petrucci (https://keybase.io/petrucci) on keybase.
- I have a public key whose fingerprint is 1DD7 F96E C6B0 35B0 602C AFF7 9DD9 C5E7 3EDB 622E
To claim this, I am signing this object:
| function pingplot { | |
| local destination="$1" | |
| [[ -n $destination ]] || read -rp 'Ping host: ' destination; | |
| results="$(mktemp)"; | |
| ping "$destination" | sed -ur 's/^PING.*//;s/.*seq=([0-9]+)/\1/;s/ttl.*time=([0-9]+).*/\1/' > "$results" & | |
| sleep 1 && pidof ping || { echo Something went wrong with the ping.; return 1; } | |
| watch "tail -100 "$results" | gnuplot -e \"set key off; set title 'Pinging: $destination'; set terminal dumb size $((COLUMNS - 5)) 25; plot '/dev/stdin' w lp;\""; | |
| kill %ping | |
| rm "$results" | |
| } |
| #!/bin/sh | |
| # Generates a syslog message w/ prio=emerg for any DHCP client we haven't seen since last reboot. | |
| # Note: Syslog server is configured to send SMTP on any event >= emerg. This script alone does not send the mail. | |
| echo '#!/bin/sh | |
| op="${1:-op}" | |
| mac="${2:-mac}" | |
| ip="${3:-ip}" | |
| hostname="${4}" | |
| grep "$mac" /tmp/dnsmasq-leases.log || { export priority=emerg; echo "$mac" "$hostname" >> /tmp/dnsmasq-leases.log; } |
| #!/bin/bash | |
| # Creates PAN-OS CLI configuration syntax out of large groups of IP/NETMASK data. | |
| [[ "$#" == 1 && -f "$1" ]] || { printf "First argument should be filename containing networks in form of '#.#.#.#/#'.\n" >&2; exit 1; } | |
| OUTFILE="$(mktemp)" | |
| exec 3<> "$OUTFILE" | |
| read -r -p "Address description value (e.g. CHG number): " DESCRIPTION | |
| while FS='' read -r line; do | |
| grep -Eq "([0-9]+\.){3}[0-9]+/[0-9]+" <<<"$line" || { | |
| printf "Line does not match expected format. Line: %s\n" "$line" >&2; | |
| exit 1; |
| DetectHiddenWindows on | |
| DetectHiddenText on | |
| ;SetTitleMatchMode 2 | |
| ;SetTitleMatchMode Slow | |
| #z:: | |
| SetKeyDelay 100 | |
| Loop, read, D:\wordlist.txt | |
| { | |
| TrayTip Now trying:, %A_LoopReadLine%, 1 ;Creates tooltip so we can monitor the progress through wordlist. | |
| SendRaw %A_LoopReadLine% ;Type the current line into box |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # Original: https://github.com/keybase/keybase-issues/issues/1126#issuecomment-58430029 | |
| gpg --dearmor | \ | |
| sha256sum | \ | |
| awk ' { print "0:", $1 } ' | \ | |
| xxd -g0 -r -c256 | \ | |
| base64 | \ | |
| head -c 43 |
| #!/bin/bash | |
| charset=abcdefghijklmnopqrstuvwxyz # Tweak $charset as needed for your alphabet | |
| input=${1,,} #strtolower; greatly simplifies conversion | |
| for char in $(seq 1 ${#charset}); do # Count characters in charset, and for each... | |
| temp=${charset#?} # Strip the first character, save rest to $temp | |
| charset=${temp}${charset%"$temp"} # Move the first character of charset behind the rest (abcde becomes bcdea) | |
| echo $input | tr a-z $charset | |
| done |
| #!/bin/bash | |
| # Creates dbedit CLI configuration syntax out of large groups of IP address data. | |
| [[ "$#" == 1 && -f "$1" ]] || { printf "First argument should be filename containing IP addresses in form of '#.#.#.#'.\n" >&2; exit 1; } | |
| OUTFILE="$(mktemp)" | |
| exec 3<> "$OUTFILE" | |
| # Make group of objects just created | |
| read -r -p "Group name (e.g. 'blacklist'): " GROUPNAME | |
| #read -r -p "Host prefix (e.g. 'badip'): " PREFIX # Don't feel like sanitizing this at the moment. I'll just hardcode a prefix on the next line. | |
| PREFIX="host_" |
| until((${#c}>8));do | |
| a=$b | |
| b=${c-1} | |
| c=$((b+a)) | |
| echo $c | |
| done |
| #!/bin/bash | |
| which tmux >/dev/null || { printf '%s\n' 'Error: could not locate tmux.' >&2; exit 1; } | |
| # Create session, window, pane | |
| readonly SESSION_NAME="$(head -c 30 <(tr -d -c [:alnum:] </dev/urandom))" | |
| tmux start-server | |
| tmux new-session -d -s $SESSION_NAME | |
| tmux split-window -d -v -p 10 | |
| # Configure timer: |