I hereby claim:
- I am brwyatt on github.
- I am brwyatt (https://keybase.io/brwyatt) on keybase.
- I have a public key whose fingerprint is 7139 4C8E CA4A B1BE B85E B202 B83E E2D5 5C50 C6B2
To claim this, I am signing this object:
#!/bin/bash | |
models=( | |
"switch-enterprise-8-poe" | |
"usw-enterprise-24-poe" | |
"usw-enterprise-48-poe" | |
"usp-rps" | |
) | |
do_check () { |
#!/bin/bash | |
file="/tmp/count.csv" | |
echo "datetime,commit,lines" > "${file}" | |
for i in $(git log --pretty='%ct:%H'); do | |
d=$(echo "${i}"|cut -f1 -d':') | |
c=$(echo "${i}"|cut -f2 -d':') |
#!/bin/bash | |
# Put the following in the `~/.ssh/config` for each host to | |
# conditionally proxy: | |
# ProxyCommand ssh_proxy.sh %h %p bastion.example.net | |
if [ $# -ne 3 ]; then | |
echo "USAGE: $0 HOST PORT PROXYHOST" >&2 | |
exit 99 | |
fi |
#!/bin/bash | |
servers=() | |
unset input | |
read -p "Server ${#servers[@]}: " input | |
while [ ${#servers[@]} -eq 0 ] || [[ "x${input}" != "x" ]]; do | |
if [[ "x${input}" != "x" ]]; then | |
servers=("${servers[@]}" $input) | |
fi | |
unset input |
#!/bin/bash | |
osds=($(systemctl list-units | grep -iE 'ceph-osd@[[:digit:]]+\.service' | tr -s ' ' | cut -f2 -d' ' | cut -f2 -d'@' | cut -f1 -d'.')) | |
for i in "${osds[@]}"; do | |
echo "***Outing OSD $i" | |
ceph osd out $i | |
done | |
read -p "***Pausing for replication/recovery. Press [ENTER] when done..." $DONE |
#!/bin/bash | |
if [[ "x${1}" == "x" ]]; then | |
dir="." | |
else | |
dir="${1}" | |
fi | |
# Based on https://stackoverflow.com/questions/10575665/linux-find-command-find-10-latest-files-recursively-regardless-of-time-span | |
# with additions to return only the date of the newest file |
I hereby claim:
To claim this, I am signing this object:
# Update all repositories under ~/repos. | |
# Works for SVN and GIT (very simplistic) | |
alias update-repos="ls ~/repos | xargs -I% bash -c 'echo -e \"\e[0;34mUpdating %\e[0m\"; cd ~/repos/% ; if [ -d .svn ]; then svn update; elif [ -d .git ]; then git fetch -v; else echo -e \"\e[0;31mNot a repo\e[0m\"; fi'" | |
# Calls `svn diff` and adds some color to the output to make changes stand out | |
alias colordiff="svn diff | sed -E 's/^(@@.*@@)$/\x1b[0;34m\1\x1b[0m/' | sed -E 's/^(Index: .*|=*)$/\x1b[0;33m\1\x1b[0m/' | sed -E 's/^(\+.*)$/\x1b[0;32m\1\x1b[0m/' | sed -E 's/^(\-.*)$/\x1b[0;31m\1\x1b[0m/' | less -R" |
#!/usr/bin/env bash | |
# based on http://chiu01.blogspot.com/2012/04/git-tip-using-graphviz-to-display.html | |
# Use: ./GraphGit.sh [FromCommitish] [ToCommitish] | |
echo 'digraph "git" {' > graph.dot | |
git log --pretty='format: %h [label="%h\n%an <%ae>\n%ai\n%s" shape=box]' $1..$2 | perl -p -e 's/([0-9a-f]{7})/"\1"/' >> graph.dot | |
git log --pretty='format: %h -> { %p }' $1..$2 | perl -p -e 's/([0-9a-f]{7})/"\1"/g' >> graph.dot | |
echo '}' >> graph.dot | |
dot -Tpng graph.dot -o graph.png |
#!/bin/bash | |
cat /dev/urandom|tr -dc 'a-zA-Z0-9_-'|fold -w$(echo "($RANDOM%10)+15"|bc)|head -n1 |