Parcourir la source

Minor updates from AFS

Fred Damstra [afs macbook] il y a 3 ans
Parent
commit
857f612355
3 fichiers modifiés avec 86 ajouts et 6 suppressions
  1. 82 2
      .bash_aliases
  2. 1 0
      .bashrc
  3. 3 4
      .vimrc

+ 82 - 2
.bash_aliases

@@ -1,5 +1,5 @@
 # Systems
-alias io="ssh fdamstra@192.168.1.100"
+alias io="ssh fdamstra@io.home.monkeybox.org"
 alias salt-master="ssh fdamstra@salt-master.home.monkeybox.org"
 alias centosplay="ssh fdamstra@centosplay.home.monkeybox.org"
 
@@ -24,4 +24,84 @@ alias fetch='git fetch --all --prune'
 
 alias govcloud='saml2aws --skip-prompt -a govcloud login'
 alias commercial='saml2aws --skip-prompt -a commercial login'
-alias saml='saml2aws --skip-prompt -a commercial login && saml2aws --skip-prompt -a govcloud login && sft list-servers'
+#alias saml='saml2aws --skip-prompt -a commercial login && saml2aws --skip-prompt -a govcloud login && tsh --proxy=teleport.xdrtest.accenturefederalcyber.com login && tsh --proxy=teleport.xdr.accenturefederalcyber.com login'
+alias saml='saml2aws --skip-prompt -a commercial login && saml2aws --skip-prompt -a govcloud login'
+alias samlpw='saml2aws -a commercial login && saml2aws -a govcloud login'
+
+# Teleport
+function tshd(){
+    AUTH="mdr-multipass-okta"
+    #AUTH="rhsso-test-saml"
+    host=$1
+    if [[ "$host" == "ls" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com ls
+    elif [[ "$host" == "scp" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com $*
+    elif [[ "$host" =~ \. ]]; then
+      # fqdn was specified
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com ssh $1
+    else
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com ssh $1.pvt.xdrtest.accenturefederalcyber.com
+    fi
+}
+
+function tshp(){
+    AUTH="mdr-multipass-okta"
+    #AUTH="rhsso-saml"
+    host=$1
+    if [[ "$host" == "ls" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com ls
+    elif [[ "$host" == "scp" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com $*
+    elif [[ "$host" =~ \. ]]; then
+      # fqdn was specified
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com ssh $1
+    else
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com ssh $1.pvt.xdr.accenturefederalcyber.com
+    fi
+}
+
+function tshlcp(){
+    AUTH="mdr-multipass-okta"
+    #AUTH="rhsso-saml"
+    host=$1
+    if [[ "$host" == "ls" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com ls
+    elif [[ "$host" == "scp" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com $*
+    elif [[ "$host" =~ \. ]]; then
+      # fqdn was specified
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com ssh $1
+    else
+      tsh --auth ${AUTH} --proxy=teleport.xdr.accenturefederalcyber.com ssh $1
+    fi
+}
+
+function tshcaasp(){
+    AUTH="mdr-multipass-okta"
+    #AUTH="rhsso-saml"
+    host=$1
+    if [[ "$host" == "ls" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com ls | grep -i caasp
+    elif [[ "$host" == "scp" ]]; then
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com $*
+    elif [[ "$host" =~ \. ]]; then
+      # fqdn was specified
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com ssh $1
+    else
+      tsh --auth ${AUTH} --proxy=teleport.xdrtest.accenturefederalcyber.com ssh $1
+    fi
+}
+
+#alias tshd="tsh --proxy=teleport.xdrtest.accenturefederalcyber.com ssh"
+#alias tshp="tsh --proxy=teleport.xdr.accenturefederalcyber.com ssh"
+alias sft="/bin/echo Dont use sft\!"
+
+alias killfp='while [[ 1 ]]; do sudo killall -9 fpdcd; done'
+
+# For 'granted' which lets you assume roles easily:
+#  https://docs.commonfate.io/granted-cli/shell-alias/
+# * BREAKS OUR AWS STUFF *
+alias assume="source assume"
+alias dassume="source dassume"
+alias clearaws='unset AWS_PROFILE AWS_ACCESS_KEY_ID AWS_REGION AWS_SECRET_ACCESS_KEY AWS_SESSION_EXPIRATION AWS_SESSION_TOKEN'

+ 1 - 0
.bashrc

@@ -251,6 +251,7 @@ if [[ -x `which microk8s` ]]; then
   alias kubectl='microk8s kubectl'
 fi
 
+# May be incompatible with tf14+
 export TF_PLUGIN_CACHE_DIR=~/.terraform.d/plugin-cache
 [[ -d "$TF_PLUGIN_CACHE_DIR" ]] || mkdir -p $TF_PLUGIN_CACHE_DIR
 

+ 3 - 4
.vimrc

@@ -18,7 +18,7 @@ call plug#begin('~/.vim/plugged')
 " (Optinal) for Tag Sidebar
 " Plug 'majutsushi/tagbar'
 
-Plug 'hashivim/vim-terraform'
+"Plug 'hashivim/vim-terraform'
 "Plug 'vim-syntastic/syntastic'
 "Plug 'juliosueiras/vim-terraform-completion'
 call plug#end()
@@ -126,6 +126,7 @@ au BufNewFile,BufRead *.sls
     \ set filetype=sls
 
 au FileType gitcommit setlocal nowrap
+au FileType go set expandtab!
 
 "au BufNewFile,BufRead *.hcl, *.tf
 "    \ set filetype=terraform
@@ -140,10 +141,8 @@ au FileType gitcommit setlocal nowrap
 
 let g:terraform_fold_sections=1
 let g:terraform_align=1
-let g:terraform_fmt_on_save=0
+let g:terraform_fmt_on_save=1
 let g:syntastic_python_python_exec = 'python3'
 let g:syntastic_python_checkers = ['python']
 
 au BufRead * normal zR
-
-