big refactor
j3s j3s@c3f.net
Fri, 06 Mar 2020 11:16:14 -0600
12 files changed,
54 insertions(+),
111 deletions(-)
D
.config/fish/MACC02VK5ECHTD7.fish
@@ -1,18 +0,0 @@
-set -x PATH ~/.rvm/bin $PATH - -# env vars -export CHEFUSER="jolson" -export SSHUSER="jolson" -export SSHKEY="~/.ssh/id_rsa" - -# aliases -alias cdr='cd (find ~/git/chef/cloud-roles ~/git/chef/site-cookbooks ~/git/chef/app-cookbooks -type d -maxdepth 1 | selecta)' -alias ls='gls --color' -alias tar=gtar -alias sed=gsed -alias be='bundle exec' -alias brm='rm -rf ~/.berkshelf/cookbooks/ && rm -f Berksfile.lock && be berks install' -alias tr=gtr - -# load rvm -rvm default
D
.config/fish/config.fish
@@ -1,19 +0,0 @@
-#!/usr/bin/env fish -set fish_greeting - -set -gx EDITOR vim -set -gx LANG en_US.UTF-8 -set -gx LD_LIBRARY_PATH /usr/local/lib/:/usr/lib/ - -set -gx PATH ~/bin/(hostname) ~/bin /usr/local/bin /usr/bin /bin /sbin /usr/sbin -set -gx PATH $PATH ~/.local/share/go/bin - -set -gx GOPATH ~/.local/share/go/ - -function fish_prompt - printf (~/bin/short-pwd) - echo '$ ' -end - -alias vi=vim -source ~/.config/fish/(hostname).fish
D
.config/fish/functions/rvm.fish
@@ -1,40 +0,0 @@
-function rvm --description='Ruby enVironment Manager' - # run RVM and capture the resulting environment - set --local env_file (mktemp -t rvm.fish.XXXXXXXXXX) - # This finds where RVM's root directory is and sources scripts/rvm from within it. Then loads RVM in a clean environment and dumps the environment variables it generates out for us to use. - bash -c 'PATH=$GEM_HOME/bin:$PATH;RVMA='~/.rvm/bin/rvm';source $(echo $RVMA | sed "s/\/bin\//\/scripts\//"); rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv - - # apply rvm_* and *PATH variables from the captured environment - and eval (grep -E '^rvm|^PATH|^GEM_PATH|^GEM_HOME' $env_file | grep -v '_clr=' | sed '/^[^=]*PATH/s/:/" "/g; s/^/set -xg /; s/=/ "/; s/$/" ;/; s/(//; s/)//') - # needed under fish >= 2.2.0 - and set -xg GEM_PATH (echo $GEM_PATH | sed 's/ /:/g') - - # clean up - rm -f $env_file -end - -function __handle_rvmrc_stuff --on-variable PWD - # Source a .rvmrc file in a directory after changing to it, if it exists. - # To disable this feature, set rvm_project_rvmrc=0 in $HOME/.rvmrc - if test "$rvm_project_rvmrc" != 0 - set -l cwd $PWD - while true - if contains $cwd "" $HOME "/" - if test "$rvm_project_rvmrc_default" = 1 - rvm default 1>/dev/null 2>&1 - end - break - else - if test -e .rvmrc -o -e .ruby-version -o -e .ruby-gemset -o -e Gemfile - eval "rvm reload" > /dev/null - eval "rvm rvmrc load" >/dev/null - break - else - set cwd (dirname "$cwd") - end - end - end - - set -e cwd - end -end
A
.profile
@@ -0,0 +1,8 @@
+export ENV=~/.shinit + +if [ "$(uname -s)" != "Darwin" ]; then + read -rp "start X?" && [ -z "$DISPLAY" ] && { + export DISPLAY=:0 + x + } +fi
A
.shinit
@@ -0,0 +1,24 @@
+export PS1='$(short-pwd)$ ' +export PATH="$HOME/bin/$(hostname -s):$HOME/bin:$PATH" +export HISTFILE="$HOME/.mksh-history" +export HISTFILESIZE=10000 + +export PASH_KEYID=j3s@c3f.net +export PASH_DIR="$HOME/.password-store" + +# general +alias startx='ssh-agent startx' +alias vi=nvim +alias ls='CLICOLOR=1 ls' +bind '^L=clear-screen' + +# bby +if [ "$(uname -s)" == "Darwin" ]; then + alias cdr='cd $(find ~/git/chef/cloud-roles ~/git/chef/site-cookbooks ~/git/chef/app-cookbooks ~/git/chef/dc-roles -type d -maxdepth 1 | selecta)' + export CHEFUSER="jolson" + export SSHUSER="jolson" + export SSHKEY="~/.ssh/id_rsa" + export PASH_CLIP="pbcopy" + source /usr/local/share/chruby/chruby.sh + chruby ruby-2.6.2 +fi
A
bin/MACC02VK5ECHTD7/brm
@@ -0,0 +1,5 @@
+#!/bin/sh -e +# +# Remove entire berks cache & start over + +rm -f Berksfile.lock && bundle exec berks install || rm -rf ~/.berkshelf/cookbooks/ && rm -f Berksfile.lock && bundle exec berks install
M
bin/MACC02VK5ECHTD7/jws-ssh
→
bin/MACC02VK5ECHTD7/jws-ssh
@@ -1,25 +1,26 @@
#!/bin/sh +# # input: us-east-1a 172.29.71.236 i-0a7eb3896d61b4d22 Krakencld-app-ASG-A running m5.large None browse_test -# ssh's to hosts listed from jws-grep output +# if > 1 argument: run the given command on each remote system and stream the output if ! [ -z "$1" ]; then - echo "This script cannot be used interactively" - exit 1 + echo "establishing connections..." + while IFS='$\n' read -r i; do + echo $i + ip=$(echo "$i" | awk '{print $2}') + ssh "$ip" "$1" + done + exit 0 fi - +# if no arguments: opens tmux panes to every remote host in list via ssh, sync panes tmux set default-shell "/bin/sh" -# tmux new-window 'sleep 0.1' +tmux new-window 'sleep 0.1' while IFS='$\n' read -r i; do ip=$(echo "$i" | awk '{print $2}') tmux split-window "ssh $ip" tmux select-layout tiled done tmux set -u default-shell -# tmux select-layout tiled -# tmux setw synchronize-panes on - -# todo? -# if one result, directly ssh -# if more than one result, do new window tmux madness - +tmux select-layout tiled +tmux setw synchronize-panes on
D
bin/nostromo/pastesrv
@@ -1,4 +0,0 @@
-#!/bin/sh - -ssh c3f.net "cat > /usr/share/nginx/paste/$1" -echo "https://p.c3f.net/$1"
D
bin/nostromo/taste
@@ -1,15 +0,0 @@
-#!/bin/bash - -for fgbg in $(seq 38 48) ; do # Foreground / Background - for color in $(seq 238 255) ; do # Colors - # Display the color - printf "\e[${fgbg};5;%sm %3s \e[0m" $color $color - # Display 6 colors per lines - if [ $((($color + 1) % 6)) == 4 ] ; then - echo # New line - fi - done - echo # New line -done - -exit 0
M
bin/short-pwd
→
bin/short-pwd
@@ -1,5 +1,6 @@
-#!/bin/sh +#!/bin/sh -e +# +# make a lil pink prompt term=$(printf "$PWD" | sed -E 's|(\.?[^/])([^/]+)\/|\1/|g') - -printf "\033[01;90m$term\e[0m" +printf "\033[38;5;162m$term\e[0m"