Skip to content

Commit

Permalink
Merge pull request #1 from dwhite-cleerly/vscode
Browse files Browse the repository at this point in the history
Vscode
  • Loading branch information
dwhite-cleerly authored Dec 24, 2021
2 parents af09af1 + 8e6ee78 commit 84fe618
Showing 11 changed files with 256 additions and 34 deletions.
39 changes: 30 additions & 9 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,62 +1,83 @@
tap "adoptopenjdk/openjdk"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
tap "osx-cross/arm"
tap "osx-cross/avr"
tap "qmk/qmk"
brew "openssl@1.1"
brew "autoconf"
brew "python@3.9"
brew "awscli"
brew "awslogs"
brew "bat"
brew "cmake"
brew "cowsay"
brew "diff-so-fancy"
brew "docker"
brew "docker-compose"
brew "docker", link: false
brew "docker-compose", link: false
brew "exa"
brew "fd"
brew "ncurses"
brew "fish"
brew "fortune"
brew "fzf"
brew "gcc"
brew "git"
brew "git-lfs"
brew "glib"
brew "gnu-sed"
brew "guile"
brew "unbound"
brew "gnutls"
brew "gnupg"
brew "gotop"
brew "grep"
brew "htop"
brew "imagemagick"
brew "jq"
brew "libmagic"
brew "libssh"
brew "libssh2"
brew "lolcat"
brew "make"
brew "neofetch"
brew "neovim"
brew "nghttp2"
brew "nmap"
brew "node"
brew "nvm"
brew "postgresql"
brew "pup"
brew "pwgen"
brew "pyenv"
brew "python@3.7"
brew "python@3.8"
brew "redis"
brew "ripgrep"
brew "rust"
brew "socat"
brew "subversion"
brew "telnet"
brew "terraform", link: false
brew "tfenv"
brew "the_silver_searcher"
brew "ripgrep"
brew "trash"
brew "tree"
brew "watch"
brew "wget"
brew "yarn"
cask "adoptopenjdk14"
cask "font-code-new-roman-nerd-font"
cask "font-fira-code"
cask "font-fira-mono-for-powerline"
cask "font-fontawesome"
cask "font-hack"
cask "font-meslo-lg-nerd-font"
cask "joplin"
cask "kitty"
cask "font-monoid"
cask "horos"
cask "rectangle"
cask "typora"
cask "visual-studio-code"
cask "rectangle"

12 changes: 7 additions & 5 deletions fish/.aliases
Original file line number Diff line number Diff line change
@@ -7,19 +7,19 @@ alias h='history'
alias wtr='curl http://wttr.in/Grand_Junction'

alias cat='bat --theme=ansi'
# alias cd=z
alias dk='docker'
alias less='bat --theme=ansi'
alias grep='ag -i --color'
alias ag='/usr/local/bin/ag -i --color --hidden --ignore={node_modules,build,package-lock.json}'
alias rg='/usr/local/bin/rg -i --color=auto --colors=path:fg:yellow --colors=match:fg:green --hidden --no-ignore'
alias grep='ag'
alias ag='ag -i --color --hidden --ignore={node_modules,build,package-lock.json}'
alias rg='rg -i --color=auto --colors=path:fg:yellow --colors=match:fg:green --hidden --no-ignore'
alias lr='fd -aH -t f'
alias lc='lolcat'
alias md5='openssl md5'
alias pe='printenv'
alias sha1='openssl sha1'
alias sha256='openssl sha256'
alias gwd='cd ~/src'
alias gdd='cd ~/data'
alias gwdd='cd ~/src/dotfiles'
alias gwf='cd ~/src/qmk/qmk_firmware'
alias rm='trash -v'
@@ -29,12 +29,14 @@ alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
alias n='npm'

# git aliases
alias g='git'
alias ga='git add .'
alias gcl='git clone'
alias gd="git diff HEAD -- ':!package-lock.json'"
alias gst='git status'
alias gbr='git branch'
alias gps='git push'
alias diff='git diff --no-index'

2 changes: 1 addition & 1 deletion fish/.aliasesDarwin
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ alias gdu="open $MAC_APP_PATH/Utilities/Disk\ Utility.app"
alias prefs="open $MAC_APP_PATH/System\ Preferences.app"

# alias firefox="open /Applications/firefox.app"
# alias ij="open -a /Applications/IntelliJ\ IDEA.app"
alias ij="open -a /Applications/IntelliJ\ IDEA.app"
alias pup='pup -c'
# alias pych="open /Applications/PyCharm.app"
# alias rmine="open /Applications/RubyMine.app"
2 changes: 2 additions & 0 deletions fish/.exports
Original file line number Diff line number Diff line change
@@ -6,3 +6,5 @@ set --universal fish_user_paths $fish_user_paths "$HOME/src/bin" "$HOME/.cargo/b
bind --user \cb backward-word
bind --user \cf forward-word

set -gx AWS_PAGER 'bat --style=plain -l json'

5 changes: 4 additions & 1 deletion fish/.exportsDarwin
Original file line number Diff line number Diff line change
@@ -5,11 +5,14 @@
# set -gx JAVA_HOME (/usr/libexec/java_home)
# set -gx JAVA_HOME (/usr/libexec/java_home -v11.0.8)
# set -gx LIQUIBASE_HOME /usr/local/opt/liquibase/libexec
if test (uname -m) = "arm64"
eval (/opt/homebrew/bin/brew shellenv)
end

set -gx NVM_DIR "$HOME/.nvm"

# if the current system is running macos catalina or higher, use new path
if test (sw_vers -productVersion | grep -E '^(11|10.15)')
if test (sw_vers -productVersion | grep -E '^(12|11|10.15)')
set -gx MAC_APP_PATH '/System/Applications'
else
set -gx MAC_APP_PATH '/Applications'
158 changes: 140 additions & 18 deletions fish/.functionsDarwin
Original file line number Diff line number Diff line change
@@ -7,23 +7,6 @@ function o --description='Open a given command as OS-native, or open the current
end
end

# if test "$status" -ne "0"
# set ARROW "CB0000"
# else
# set ARROW 58a82f
# end
#
# echo (set_color 3399FF)(whoami)(set_color $ARROW)@(set_color FF9933)(date -u '+%a %d %H:%M:%S UTC') (set_color 6B6FFF)(pretty_path)(set_color 03A9F4)(get_branch)
# set_color 03A9F4
# echo "\$ "
#
# echo $history[1] | grep -Ev '(^hh$|^sd|^l.$)' >> ~/.local/share/fish/hh.history
# # also echo fish commands to the bash history
# # BASH keep this file in memory so it doesn't work quite like you might want it to,
# # also potential corruption issues (last one appears to win)
# # echo $history[1] | grep -Ev '(^hh$|^sd|^l.$)' >> ~/.bash_history
# end

# fish-friendly wrapper around bass/nvm
function nvm
bass source (brew --prefix nvm)/nvm.sh --no-use ';' nvm $argv
@@ -43,25 +26,66 @@ function __check_cwd --on-event cwd --description="Inject directory specific beh
go-py
end

function gwtds
echo (set_color green)"NOTE: Don't forget to base your current branch off of ml"(set_color normal)
go-tf ds
end

function gwtdev
go-tf dev2
end

function gwtdev-usw2
go-tf dev2-usw2
end

function gwtqa
go-tf qa
end

function gwtqa-usw2
go-tf qa-usw2
end

function gwts1
echo (set_color green)"NOTE: Don't forget to base your current branch off of staging"(set_color normal)
go-tf staging
end

function gwts2
echo (set_color green)"NOTE: Don't forget to base your current branch off of staging2"(set_color normal)
go-tf staging2
end

function gwts2-usw2
echo (set_color green)"NOTE: Don't forget to base your current branch off of staging2"(set_color normal)
go-tf staging2-usw2
end

function gwtprod
echo (set_color green)"NOTE: Don't forget to base your current branch off of prod"(set_color normal)
go-tf prod
end

function gwtprod-usw2
echo (set_color green)"NOTE: Don't forget to base your current branch off of prod"(set_color normal)
go-tf prod-usw2
end

function gwts3
echo (set_color green)"NOTE: Don't forget to base your current branch off of staging3"(set_color normal)
go-tf staging3
end

function gwts3-usw2
echo (set_color green)"NOTE: Don't forget to base your current branch off of staging3"(set_color normal)
go-tf staging3-usw2
end

function gwtdata
go-tf data account
end

function gwtmgmt
go-tf mgmt account
end
@@ -133,7 +157,10 @@ end
function reformat-json --description="Reformats all of your jason"
for file in (fd '\.json$')
echo "About to reformat json: $file"
jq . $file > $file
jq . $file
if test "$status" -eq 0
jq . $file | tee $file
end
end
end

@@ -146,3 +173,98 @@ function gen-key --description="Generates a random 256-bit seed value and prints
node -e "console.log(Buffer.from(crypto.randomBytes($numbytes)).toString('hex'))"
end

function ssh-mgmt
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-mgmt-bastion -i ~/.ssh/certificates/cleerly-mgmt-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-ds
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-ds-bastion -i ~/.ssh/certificates/cleerly-ds-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-dev
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-dev2-bastion -i ~/.ssh/certificates/cleerly-dev2-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-devusw2
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-dev2-usw2-bastion -i ~/.ssh/certificates/cleerly-dev2-usw2-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-s1
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-staging1-bastion -i ~/.ssh/certificates/cleerly-staging-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-s2
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-staging2-bastion -i ~/.ssh/certificates/cleerly-staging2-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-s2usw2
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-staging2-usw2-bastion -i ~/.ssh/certificates/cleerly-staging2-usw2-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-s3
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-staging3-bastion -i ~/.ssh/certificates/cleerly-staging3-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-s3usw2
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-staging3-usw2-bastion -i ~/.ssh/certificates/cleerly-staging3-usw2-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-prd
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-prod-bastion -i ~/.ssh/certificates/cleerly-prod-key.pem ec2-user@$host $argv[2..-1]
end

function ssh-prdusw2
set host "$argv[1]"
ssh -o "StrictHostKeyChecking no" -J cleerly-prod-usw2-bastion -i ~/.ssh/certificates/cleerly-prod-usw2-key.pem ec2-user@$host $argv[2..-1]
end

function prod-rerun-task
invoke-lambda prod arn:aws:lambda:us-east-1:710542845480:function:hv-data-migration-prod-tool001RerunTasks $argv
end

function invoke-lambda --description="Invokes a lambda in a specific AWS environment"
set environ "$argv[1]"
set arn "$argv[2]"
set payload (echo "$argv[3]" | base64)
aws lambda invoke --function=$arn --payload=$payload --profile=$environ lambda-invoke-(iso-date).out
end

function moz-logs
ecs-logs moz-batch-job $argv
end

function delivery-logs
ecs-logs hv-delivery-manager-api $argv
end

function labs-logs
ecs-logs hv-visionlab-api $argv
end

function coronary-logs
ecs-logs hv-physician-portal-api $argv
end

function ecs-logs --description="tails the Mozart logs in the specific environment"
set proj "$argv[1]"
set environ "$argv[2]"
if test "$environ" = ""
echo (set_color red)"ERROR: you must specify an environment"(set_color normal)
end

echo $argv[3..-1]
if test "$proj" = ""
echo (set_color red)"ERROR: you must specify a project"(set_color normal)
end
aws logs tail --profile=$environ /cleerly-$environ/ecs/$proj $argv[3..-1]
end
3 changes: 3 additions & 0 deletions fish/config.fish
Original file line number Diff line number Diff line change
@@ -4,3 +4,6 @@ for file in ~/.config/fish/.{functions*,exports*,aliases*}
end
end


# test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish

18 changes: 18 additions & 0 deletions git_notes.MD
Original file line number Diff line number Diff line change
@@ -88,3 +88,21 @@ git push --force
## Other notes
Configure git to store GitHub creds in local OS store
`git config --global credential.helper store`

### GPG helpers
These are GPG commands that I rarely if ever need to run and therefore often forget.
In order to import a GPG key from one machine to the other, simply run:
```bash
gpg --import <path.to.private>.key
```
In order to change the passphrase of a private key:
```bash
gpg --edit-key <key-id>
passwd
# ...
save
```
In order to list the currently installed keys:
```bash
gpg --list-keys
```
Loading

0 comments on commit 84fe618

Please sign in to comment.