tuning my dev env with more tools

This commit is contained in:
MorganGeek 2020-02-22 16:31:41 +01:00
parent 1732ed5cd2
commit 081e33143c
6 changed files with 67 additions and 7 deletions

View File

@ -11,8 +11,10 @@ tap "liamg/tfsec"
tap "derailed/k9s" tap "derailed/k9s"
tap "github/gh" tap "github/gh"
tap "derailed/popeye" # provides popeye, k8s sanity analysis 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 "java"
cask "iterm2" cask "iterm2"
cask "zoomus" cask "zoomus"
@ -161,3 +163,9 @@ brew "popeye" # Kubernetes resources sanity analysis
brew "pre-commit" # https://pre-commit.com/#install brew "pre-commit" # https://pre-commit.com/#install
brew "terraform-docs" # https://github.com/segmentio/terraform-docs brew "terraform-docs" # https://github.com/segmentio/terraform-docs
brew "shfmt" # format shell 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

View File

@ -104,7 +104,10 @@ yum -y install nodejs
sudo yum -y install fasd sudo yum -y install fasd
# Simplistic interactive filtering tool https://github.com/peco/peco # 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. # Tig is an ncurses-based text-mode interface for git.
yum -y install tig 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 git clone https://github.com/datawire/telepresence.git && cd telepresence
env PREFIX=/usr/local ./install.sh 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

View File

@ -213,6 +213,14 @@ pre-commit init-templatedir ~/.git-template
terraform-docs completion zsh >/usr/local/share/zsh/site-functions/_terraform-docs terraform-docs completion zsh >/usr/local/share/zsh/site-functions/_terraform-docs
autoload -U compinit && compinit 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 # Upgrade
echo "Upgrading apps" echo "Upgrading apps"
~/.scripts/upgrade.sh ~/.scripts/upgrade.sh

View File

@ -34,3 +34,4 @@ terragrunt --version
pre-commit --version pre-commit --version
terraform-docs --version terraform-docs --version
tflint --version tflint --version
eksctl version

View File

@ -14,9 +14,10 @@ alias jirasearch='issues'
alias cicdlist="jira issue jql \"project = 'CICD' AND resolution = Unresolved\"" 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 backlogs="jira issue jql \"status = New AND project IN (CICD) AND Created > -2w ORDER BY Priority DESC\""
alias bakclogs='backlogs' 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 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 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 n='newissues'
alias backlog=cicdlist alias backlog=cicdlist
@ -35,6 +36,7 @@ alias crypto='curl rate.sx'
# Twitter # Twitter
alias twitter='\t' alias twitter='\t'
alias tsearch='twitter search all' alias tsearch='twitter search all'
alias tweets='tsearch'
alias tsearchfav='twitter search favorites' alias tsearchfav='twitter search favorites'
alias tsearchtimeline='twitter search timeline' alias tsearchtimeline='twitter search timeline'
@ -53,7 +55,8 @@ alias mailpro="gmail"
# Viewing files # Viewing files
alias cat='bat --style=plain --color "always"' alias cat='bat --style=plain --color "always"'
alias preview="fzf --preview 'bat --color \"always\" --style=plain {}' --cycle " 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 # To do / Done
#alias done='task_done' #alias done='task_done'
@ -72,9 +75,10 @@ alias ipinfo='curl "ipinfo.io/"$(ip)'
# Misc # Misc
alias h='cd $HOME' alias h='cd $HOME'
alias bash="/usr/local/bin/bash" 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 cp='cp -i' # confirmation before overwrite #
alias mv='mv -i' # confirmation before overwrite alias mv='mv -i' # confirmation before overwrite
alias rm='gomi'
alias df='df -H' alias df='df -H'
alias du='ncdu --color dark -rr -x --exclude .git --exclude node_modules' alias du='ncdu --color dark -rr -x --exclude .git --exclude node_modules'
#alias du='du -ch' #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 checken="aspell check -d en"
alias checkfr="aspell check -d fr" alias checkfr="aspell check -d fr"
alias gw='./gradlew' alias gw='./gradlew'
alias terraform_landscape='landscape'
# Show/hide hidden files in Finder # Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"

View File

@ -226,8 +226,39 @@ function gcrb {
} }
function terraform-compliance { docker run --rm -v "$(pwd):/target" -i -t eerkunt/terraform-compliance "$@"; } 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 checkov { docker run -i --rm -v "$(pwd):/tf" bridgecrew/checkov -d /tf "$@" ; }
function vimat {
vim +/$1 $2
}
function copyhooks { function copyhooks {
cp -f ~/.git-template/.pre-commit-config.yaml ./ cp -f ~/.git-template/.pre-commit-config.yaml ./
pre-commit install --install-hooks --overwrite pre-commit install --install-hooks --overwrite
pre-commit run -a 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}/"
}