From 081e33143c2a5c1c09c43de439fb42c09178ffaa Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Sat, 22 Feb 2020 16:31:41 +0100 Subject: [PATCH] tuning my dev env with more tools --- Brewfile | 12 ++++++++++-- centos.sh | 9 ++++++++- dot_scripts/bootstrap.sh | 8 ++++++++ dot_scripts/version.sh | 1 + dot_zsh_aliases | 13 +++++++++---- dot_zsh_functions | 31 +++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 7 deletions(-) diff --git a/Brewfile b/Brewfile index c32c57d..e1055ca 100644 --- a/Brewfile +++ b/Brewfile @@ -11,8 +11,10 @@ tap "liamg/tfsec" tap "derailed/k9s" tap "github/gh" tap "derailed/popeye" # provides popeye, k8s sanity analysis - - +tap "instrumenta/instrumenta" # provides kubeval +tap "weaveworks/tap" # provides eksctl +tap "b4b4r07/tap" # provides gomi a replacement for rm command +tap "eddieantonio/eddieantonio" # provides imgcat, cat but for images cask "java" cask "iterm2" cask "zoomus" @@ -161,3 +163,9 @@ brew "popeye" # Kubernetes resources sanity analysis brew "pre-commit" # https://pre-commit.com/#install brew "terraform-docs" # https://github.com/segmentio/terraform-docs brew "shfmt" # format shell +brew "dive" # a tool to explore docker layers +brew "terraform_landscape" # pretty print of terraform plan output +brew "kubeval" # linter for kubernetes config files +brew "eksctl" +brew "gomi" # replacement for rm command +brew "imgcat" # cat for images diff --git a/centos.sh b/centos.sh index 6b1d009..8f96111 100644 --- a/centos.sh +++ b/centos.sh @@ -104,7 +104,10 @@ yum -y install nodejs sudo yum -y install fasd # Simplistic interactive filtering tool https://github.com/peco/peco -go get github.com/peco/peco/cmd/peco +go get -u -v github.com/peco/peco/cmd/peco +go get -u -v github.com/jessfraz/dockfmt +go get -u -v github.com/dmlittle/scenery +go get -u -v github.com/camptocamp/terraboard # Tig is an ncurses-based text-mode interface for git. yum -y install tig @@ -263,3 +266,7 @@ git clone https://github.com/fcambus/ansiweather.git git clone https://github.com/datawire/telepresence.git && cd telepresence env PREFIX=/usr/local ./install.sh + +wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz +tar xf kubeval-linux-amd64.tar.gz +sudo cp kubeval /usr/local/bin diff --git a/dot_scripts/bootstrap.sh b/dot_scripts/bootstrap.sh index 97d62e2..455a663 100755 --- a/dot_scripts/bootstrap.sh +++ b/dot_scripts/bootstrap.sh @@ -213,6 +213,14 @@ pre-commit init-templatedir ~/.git-template terraform-docs completion zsh >/usr/local/share/zsh/site-functions/_terraform-docs autoload -U compinit && compinit +go get -u -v github.com/jessfraz/dockfmt +go get -u -v github.com/dmlittle/scenery +go get -u -v github.com/camptocamp/terraboard + +sudo curl -L git.io/scope -o /usr/local/bin/scope +sudo chmod a+x /usr/local/bin/scope +#scope launch + # Upgrade echo "Upgrading apps" ~/.scripts/upgrade.sh diff --git a/dot_scripts/version.sh b/dot_scripts/version.sh index b03c53a..f2dc99b 100755 --- a/dot_scripts/version.sh +++ b/dot_scripts/version.sh @@ -34,3 +34,4 @@ terragrunt --version pre-commit --version terraform-docs --version tflint --version +eksctl version diff --git a/dot_zsh_aliases b/dot_zsh_aliases index 6437adf..ba20f18 100644 --- a/dot_zsh_aliases +++ b/dot_zsh_aliases @@ -14,9 +14,10 @@ alias jirasearch='issues' alias cicdlist="jira issue jql \"project = 'CICD' AND resolution = Unresolved\"" alias backlogs="jira issue jql \"status = New AND project IN (CICD) AND Created > -2w ORDER BY Priority DESC\"" alias bakclogs='backlogs' -alias support="jira issue jql \"project in (CICD) AND Created > -2w AND resolution = Unresolved AND (type = 'Engineering Incident' AND status not in ('In Progress') OR type IN ('Engineering Request', 'Task', 'User Story') AND status in ('New', 'To be picked next')) ORDER BY key DESC\"" +alias support="jira issue jql \"project in (CICD) AND (Created > -2w AND resolution = Unresolved AND (type = 'Engineering Incident' AND status not in ('Waiting for external information') OR type IN ('Engineering Request', 'Task', 'User Story') AND status in ('New', 'To be picked next')) OR resolution != Unresolved AND status = 'In Progress') ORDER BY key DESC\"" +alias guardian="support" alias lastissues='jira issue jql "project IN (CICD) AND Created > -2w ORDER BY Created DESC, Priority DESC"' -alias workingon="jira issue jql \"assignee = currentUser() AND resolution = Unresolved AND status not in ('In Review', 'Done', 'In Testing', 'Waiting For Build') OR QA = currentUser() AND status = 'In Testing' ORDER BY updated DESC\"" +alias workingon="jira issue jql \"assignee = currentUser() AND resolution = Unresolved AND status not in ('In Review', 'Done', 'In Testing', 'Waiting For Build') OR QA = currentUser() AND status = 'In Testing' ORDER BY updated DESC, priority DESC\"" alias newissues="jira issue jql \"project IN (CICD) AND Created > -2w AND resolution = Unresolved AND status not in ('In Progress') ORDER BY Created DESC, Priority DESC\"" alias n='newissues' alias backlog=cicdlist @@ -35,6 +36,7 @@ alias crypto='curl rate.sx' # Twitter alias twitter='\t' alias tsearch='twitter search all' +alias tweets='tsearch' alias tsearchfav='twitter search favorites' alias tsearchtimeline='twitter search timeline' @@ -53,7 +55,8 @@ alias mailpro="gmail" # Viewing files alias cat='bat --style=plain --color "always"' alias preview="fzf --preview 'bat --color \"always\" --style=plain {}' --cycle " -alias markdown='pandoc README.md | lynx -stdin -dump' +alias markdown2='pandoc README.md | lynx -stdin -dump' +alias markdown='glow' # To do / Done #alias done='task_done' @@ -72,9 +75,10 @@ alias ipinfo='curl "ipinfo.io/"$(ip)' # Misc alias h='cd $HOME' alias bash="/usr/local/bin/bash" -alias diff='colordiff' +alias diff='colordiff --side-by-side --ignore-space-change --width=200 --suppress-common-lines --recursive' alias cp='cp -i' # confirmation before overwrite # alias mv='mv -i' # confirmation before overwrite +alias rm='gomi' alias df='df -H' alias du='ncdu --color dark -rr -x --exclude .git --exclude node_modules' #alias du='du -ch' @@ -114,6 +118,7 @@ alias usernames="python3 $HOME/Code/sherlock/sherlock.py --rank --print-found" alias checken="aspell check -d en" alias checkfr="aspell check -d fr" alias gw='./gradlew' +alias terraform_landscape='landscape' # Show/hide hidden files in Finder alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" diff --git a/dot_zsh_functions b/dot_zsh_functions index 40c781c..99b8346 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -226,8 +226,39 @@ function gcrb { } function terraform-compliance { docker run --rm -v "$(pwd):/target" -i -t eerkunt/terraform-compliance "$@"; } function checkov { docker run -i --rm -v "$(pwd):/tf" bridgecrew/checkov -d /tf "$@" ; } +function vimat { + vim +/$1 $2 +} function copyhooks { cp -f ~/.git-template/.pre-commit-config.yaml ./ pre-commit install --install-hooks --overwrite pre-commit run -a } +function httperr { + curl -s "https://http.cat/$1" | imgcat +} +function terragrunt_color { + BOLD=$(tput bold) + BLACK=$(tput setaf 0) + RED=$(tput setaf 1) + GREEN=$(tput setaf 2) + YELLOW=$(tput setaf 3) + BLUE=$(tput setaf 4) + CYAN=$(tput setaf 6) + RESET=$(tput sgr0) + REDBOLD=${RED}${BOLD} + REDRESET=${RESET}${RED} + BLUEBOLD=${BLUE}${BOLD} + BLUERESET=${RESET}${BLUE} + + terragrunt ${*} 2>&1 | sed \ + -e "s/\(\\[terragrunt\\] \\[.*\\]\)\( [0-9\\/]* [0-9:]*\) /${BLUEBOLD}\1${BLUERESET}\2${RESET} /" \ + -e "s/\(\\[terragrunt\\]\)\( [0-9\\/]* [0-9:]*\) /${BLUEBOLD}\1${BLUERESET}\2${RESET} /" \ + -e "s/\(Error: \)\(.*\)/${REDBOLD}\1${REDRESET}\2${RESET}/" \ + -e "s/\(Hit multiple errors:\)/${REDBOLD}\1${RESET}/" \ + -e "s/\(exit status 1\)/${RED}\1${RESET}/" \ + -e "s/\( WARNING: \)\(.*\)/${YELLOW}${BOLD}\1${RESET}${YELLOW}\2${RESET}/" \ + -e "s/\( Running command: \)\(.*\)/\1${CYAN}\2${RESET}/" \ + -e "s/\( *.*: *\)\(\".*\"\)\( => \)\(\".*\"\)/${YELLOW}\1${RED}\2${BLACK}\3${GREEN}\4${RESET}/" \ + -e "s/\( *.*: *\".*\"\)/${GREEN}\1${RESET}/" +}