my dotz
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add select bin scripts

j3s 7482308e 9d9217a0

+126
+63
bin/MACC02VK5ECHTD7/how
··· 1 + #!/bin/sh 2 + 3 + clone_url="ssh://git@git.bestbuy.com/~jesse.olson/howdocs-test.git" 4 + 5 + if [ ! "$#" -gt 0 ]; then 6 + echo "Need a string to search for!" 7 + exit 1 8 + fi 9 + 10 + # check for fzf & ripgrep-all, install if unfound 11 + if ! fzf --version > /dev/null 2>&1; then 12 + echo "fzf required. Install fzf via brew y/n? " 13 + read -r 14 + if [ "$REPLY" = "y" ]; then 15 + brew install fzf 16 + else 17 + exit 1 18 + fi 19 + fi 20 + 21 + if ! rg --version > /dev/null 2>&1; then 22 + echo "ripgrep required. Install ripgrep via brew y/n? " 23 + read -r 24 + if [ "$REPLY" = "y" ]; then 25 + brew install ripgrep 26 + else 27 + exit 1 28 + fi 29 + fi 30 + 31 + # maybe todo: if there are staged changes, ask user to push them? 32 + 33 + # clone/update repository 34 + if [ -d ~/howdocs ]; then 35 + (cd ~/howdocs && git pull) 36 + else 37 + echo 'First run detected. Cloning repo...' 38 + git clone "$clone_url" ~/howdocs 39 + fi 40 + 41 + # fzf the directory 42 + result=$(rg -S --files-with-matches --no-messages "$1" ~/howdocs \ 43 + | fzf --preview "highlight -O ansi -l {} 2> /dev/null \ 44 + | rg --colors 'match:bg:yellow' --ignore-case --pretty --context 10 '$1' \ 45 + || rg --ignore-case --pretty --context 10 '$1' {}") 46 + 47 + if [ "$result" = "" ]; then 48 + echo 'no documents found' 49 + exit 1 50 + fi 51 + 52 + # open up relevant file in vim for copy+pasting 53 + if [ "$EDITOR" ]; then 54 + "$EDITOR" "$result" 55 + else 56 + vim "$result" 57 + fi 58 + 59 + # if file changed, save & commit changes & push 60 + if ! (cd ~/howdocs && git diff-index --quiet HEAD --); then 61 + echo "detected howdoc changes; pushing them:" 62 + (cd ~/howdocs && git add --all && git commit -m '[Automated Commit]' && git push) 63 + fi
+6
bin/MACC02VK5ECHTD7/j
··· 1 + #!/bin/sh 2 + 3 + local query="$1" 4 + shift 2> /dev/null 5 + local ip=$(awless list instances --filter state=running,name="$query" "$@" --format json | jq -r '.[] | [.PrivateIP] | .[]' | head -n1) 6 + /usr/local/bin/ssh "$ip"
+12
bin/MACC02VK5ECHTD7/jmass
··· 1 + #!/bin/bash 2 + query="$1" 3 + shift 2> /dev/null 4 + ips=$(awless list instances --filter state=running,name="$query" "$@" --format json | jq -r '.[] | [.PrivateIP] | .[]') 5 + tmux new-window 'ssh-trash-test' 6 + 7 + while IFS= read -r i 8 + do tmux split-window "ssh $i" 9 + tmux select-layout tiled 10 + done <<< "$ips" 11 + 12 + tmux setw synchronize-panes on
+33
bin/darkdepths/make-vm
··· 1 + #!/bin/bash 2 + 3 + if [[ $1 == "" || $1 == "--help" || $1 == "-h" ]]; then 4 + echo "Usage: make-vm [vm-name] [options]" 5 + echo "some options:" 6 + echo " mem=<number-in-megabytes>" 7 + echo " cpu=<cores>" 8 + echo " disk=<gbytes>" 9 + echo " env=<public|private>" 10 + exit 1 11 + fi 12 + 13 + name="$1" 14 + env="private" 15 + disk="8" # in gb 16 + mem="512" # in mb 17 + cpu="1" # in cores 18 + 19 + if [[ -e /vm/$name.xml || -e /dev/vg0/$name.disk ]]; then 20 + echo 'vm/disk already exists' 21 + exit 1 22 + fi 23 + 24 + echo "Carving $disk GB lv in /dev/vg0/$name.disk" 25 + lvcreate -n "$name.disk" --size 8G vg0 26 + 27 + echo "createing writing /vm/$name.xml" 28 + touch "/vm/$name.xml" 29 + virt-install -n $name -r 8192 \ 30 + $name $cpus $type $variant $disk $location $graphics $bus $network 31 + 32 + qemu-system-x86_64 -hda /vm/vdisk.img -m 1024 -enable-kvm -netdev user,id=user.0 -device e1000,netdev=user.0 -soundhw ac97 -no-acpi -daemonize -usb -usbdevice tablet 33 +
+7
bin/n
··· 1 + #!/bin/sh 2 + 3 + notefile="$HOME/sync/notes.md" 4 + printf '\n' >> "$notefile" 5 + date +"%Y-%m-%d %H:%M" >> "$notefile" 6 + printf -- "----------------" >> "$notefile" 7 + vim "+normal Go" +startinsert "$notefile"
+5
bin/short-pwd
··· 1 + #!/bin/sh 2 + 3 + term=$(printf "$PWD" | sed -E 's|(\.?[^/])([^/]+)\/|\1/|g') 4 + 5 + printf "\033[01;90m$term\e[0m"