From 7d67835bfcdff20c3144c55701519514d4df8adf Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Fri, 3 May 2019 15:29:24 -0400 Subject: [PATCH] Pushing local updates centered around ruby and aws --- .gitignore | 3 +++ link/nix/zshrc | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6f6197f..d33dff4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,13 @@ # Config files that are not suitable to add to version control: link/nix/config/configstore/update-notifier-npm.json +link/nix/config/configstore/update-notifier-yo.json link/nix/config/filezilla +link/nix/config/fluidkeys/ link/nix/config/grv/ link/nix/config/gtk-2.0/ link/nix/config/hub link/nix/config/NuGet/nuget.config link/nix/config/powershell/powershellget/ link/nix/config/QtProject/ +link/nix/config/tmuxinator/ diff --git a/link/nix/zshrc b/link/nix/zshrc index 8187d8b..1de43bb 100644 --- a/link/nix/zshrc +++ b/link/nix/zshrc @@ -54,7 +54,7 @@ COMPLETION_WAITING_DOTS="false" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(brew bundler gem git git-flow github history osx pip python terraform vagrant) +plugins=(aws brew bundler gem git git-flow github history kubectl osx pip python terraform vagrant) source $ZSH/oh-my-zsh.sh @@ -96,6 +96,13 @@ function otpoff() { osascript -e 'tell application "yubiswitch" to KeyOff' } +# helper for aws and assume-role +function awsrole() { + echo "Enter MFA token:" + read mfatoken + eval $(assume-role $1 $AWS_HELPER_USERNAME $mfatoken) +} + export EDITOR='vim' export POWERLINE_CONFIG_COMMAND='/usr/local/bin/powerline-config' export VAGRANT_DEFAULT_PROVIDER='virtualbox' @@ -111,7 +118,7 @@ if [[ `uname` == 'Darwin' ]]; then [ -d /usr/local/opt/qt/bin ] && export PATH=$PATH:/usr/local/opt/qt/bin # use homebrew's ruby - #export PATH="/usr/local/opt/ruby/bin:$PATH" + [ -d /usr/local/opt/ruby/bin ] && export PATH=/usr/local/opt/ruby/bin:$PATH if [[ -f '/Applications/google-cloud-sdk' ]]; then source /Applications/google-cloud-sdk/completion.zsh.inc @@ -122,3 +129,8 @@ if [[ `uname` == 'Darwin' ]]; then [ -f ~/.travis/travis.sh ] && source ~/.travis/travis.sh || echo 'The travis gem is missing. After installing it run "echo y|travis" to create ~/.travis' fi +function aws_account_info { +[ "$AWS_ACCOUNT_NAME" ] && [ "$AWS_ACCOUNT_ROLE" ] && echo "%{$reset_color%}%{$fg[blue]%}aws:(%{$reset_color%}%{$fg[red]%}$AWS_ACCOUNT_NAME:$AWS_ACCOUNT_ROLE%{$fg[blue]%})%{$reset_color%}" +} +# )ofni_tnuocca_swa($ is $(aws_account_info) backwards +#PROMPT=`echo $PROMPT | rev | sed 's/ / )ofni_tnuocca_swa($ /'| rev`