From 15c860b0fed72bd093b654810b1e5237fa1b962d Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Thu, 17 Sep 2020 02:17:36 +0000 Subject: [PATCH 01/25] Add '.k9s/config.yml' From 387deecb80ac17b803f5c86357f1b259856e9260 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Thu, 17 Sep 2020 02:17:53 +0000 Subject: [PATCH 02/25] Add '.k9s/skin.yml' --- .k9s/skin.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .k9s/skin.yml diff --git a/.k9s/skin.yml b/.k9s/skin.yml new file mode 100644 index 0000000..504c222 --- /dev/null +++ b/.k9s/skin.yml @@ -0,0 +1,66 @@ +k9s: + body: + fgColor: "#97979b" + bgColor: "#414446" + logoColor: "#5af78e" + info: + fgColor: white + sectionColor: "#5af78e" + frame: + border: + fgColor: "#5af78e" + focusColor: "#5af78e" + menu: + fgColor: white + keyColor: "#57c7ff" + numKeyColor: "#ff6ac1" + crumbs: + fgColor: "#414446" + bgColor: white + activeColor: "#f3f99d" + status: + newColor: "#eff0eb" + modifyColor: "#5af78e" + addColor: "#57c7ff" + errorColor: "#ff5c57" + highlightcolor: "#f3f99d" + killColor: mediumpurple + completedColor: gray + title: + fgColor: "#5af78e" + bgColor: "#414446" + highlightColor: white + counterColor: white + filterColor: "#57c7ff" + views: + # Charts skins... + charts: + bgColor: default + defaultDialColors: + - "#57c7ff" + - "#ff5c57" + defaultChartColors: + - "#57c7ff" + - "#ff5c57" + table: + fgColor: "#57c7ff" + bgColor: "#414446" + cursorColor: "#5af78e" + markColor: darkgoldenrod + header: + fgColor: white + bgColor: "#414446" + sorterColor: orange + xray: + fgColor: "#57c7ff" + bgColor: "#414446" + cursorColor: "#5af78e" + graphicColor: darkgoldenrod + showIcons: false + yaml: + keyColor: "#ff5c57" + colonColor: white + valueColor: "#f3f99d" + logs: + fgColor: white + bgColor: "#414446" From cfed6832ad182a2497914d7b355712aa69f9f538 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sun, 27 Sep 2020 19:58:44 +0100 Subject: [PATCH 03/25] Update dotfiles --- .config/starship.toml | 2 +- .dotfiles/aliases | 9 +++------ .dotfiles/environment | 8 +++++--- .zshrc | 24 ------------------------ Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 34 deletions(-) create mode 100644 Makefile diff --git a/.config/starship.toml b/.config/starship.toml index 7403e14..b64837e 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,7 +1,7 @@ prompt_order=["directory","git_branch","git_commit","git_state","git_status","package","golang","nodejs","terraform","memory_usage","aws","kubernetes","cmd_duration","custom","line_break","jobs","battery","time","character"] [character] -symbol = "⚡️ " +symbol = "✨ " error_symbol = "✗ " use_symbol_for_status = true style_success = "yellow" diff --git a/.dotfiles/aliases b/.dotfiles/aliases index 6685966..68b9953 100644 --- a/.dotfiles/aliases +++ b/.dotfiles/aliases @@ -4,18 +4,15 @@ alias watch='watch ' alias cat=' bat ' alias curl='curlie' alias tmp='cd $(mktemp -d)' -alias ls=' exa --group-directories-first --header --git' +alias ls=' exa --group-directories-first --icons --header --git --ignore-glob=.git' lt() { DEPTH=$(echo $1 | grep "^[0-9]*$") - - if [ "$DEPTH" = "" ] - then + if [ "$DEPTH" = "" ]; then DEPTH=2 else shift fi - - ls --tree -L $DEPTH -I "cache|log|logs|node_modules|vendor" $@ + ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@ } alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION amazon/aws-cli' diff --git a/.dotfiles/environment b/.dotfiles/environment index 618ddde..fc7e3a7 100644 --- a/.dotfiles/environment +++ b/.dotfiles/environment @@ -3,9 +3,11 @@ export EDITOR='vim' export VISUAL='code' # AWS -export AWS_PROFILE=$(cat ~/.aws/profile) -export AWS_DEFAULT_REGION=eu-west-1 -export AWS_REGION=eu-west-1 +if [ -f ~/.aws/profile ]; then + export AWS_PROFILE=$(cat ~/.aws/profile) + export AWS_DEFAULT_REGION=eu-west-1 + export AWS_REGION=eu-west-1 +fi # Node export NODE_ENV=localhost diff --git a/.zshrc b/.zshrc index a803a90..656ba8f 100644 --- a/.zshrc +++ b/.zshrc @@ -1,27 +1,3 @@ -# pre-reqs -if [ ! -f ~/.shell-prereqs-installed ]; -then - echo "Installing prereqs" - which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" - [ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - which fzf > /dev/null || brew install fzf - which bat > /dev/null || brew install bat - which curlie > /dev/null | brew install rs/tap/curlie - which exa > /dev/null || brew install exa - which kubectl > /dev/null || brew install kubectl - which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli - which k9s > /dev/null || brew install k9s - which helm > /dev/null || brew install helm - which go > /dev/null || brew install go - which jq > /dev/null || brew install jq - which kind > /dev/null || brew install kind - which kubectx > /dev/null || brew install kubectx - brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font - which starship > /dev/null || brew install starship - - touch ~/.shell-prereqs-installed -fi - for filename in ~/.dotfiles/*; do source $filename done diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ad33563 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +SHELL := bash + +.PHONY: Install +install: pre-reqs dotfiles ## Installs all dotfiles and associated. + +.PHONY: pre-reqs +pre-reqs: ## Install all required binaries. + which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; \ + [ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \ + brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ + which fzf > /dev/null || brew install fzf; \ + which bat > /dev/null || brew install bat; \ + which curlie > /dev/null | brew install rs/tap/curlie; \ + which exa > /dev/null || brew install exa; \ + which kubectl > /dev/null || brew install kubectl; \ + which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli; \ + which k9s > /dev/null || brew install k9s; \ + which helm > /dev/null || brew install helm; \ + which go > /dev/null || brew install go; \ + which jq > /dev/null || brew install jq; \ + which kind > /dev/null || brew install kind; \ + which kubectx > /dev/null || brew install kubectx; \ + which tldr > /dev/null || brew install tldr; \ + which progress > /dev/null || brew install progress; \ + which htop > /dev/null || brew install htop; \ + which starship > /dev/null || brew install starship + +.PHONY: dotfiles +dotfiles: ## Installs the dotfiles. + for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \ + f=$$(basename $$file); \ + ln -sfn $$file $(HOME)/$$f; \ + done; \ + mkdir -p $(HOME)/.config + for file in $(shell find $(CURDIR)/.config -type f); do \ + f=$$(basename $$file); \ + ln -sfn $$file $(HOME)/.config/$$f; \ + done; + +.PHONY: help +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' From 7b57da7ac90d65bf2a10d2477a637ad1169379c8 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sat, 3 Oct 2020 08:27:31 +0100 Subject: [PATCH 04/25] Support additional dotfiles --- .gitconfig | 2 +- .zshrc | 4 ++++ Makefile | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitconfig b/.gitconfig index 53ff7d8..64bca0b 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,6 +1,6 @@ [user] name = Marcus Noble - email = git@marcusnoble.co.uk + email = github@marcusnoble.co.uk [core] editor = /usr/bin/vim diff --git a/.zshrc b/.zshrc index 656ba8f..863f96e 100644 --- a/.zshrc +++ b/.zshrc @@ -2,4 +2,8 @@ for filename in ~/.dotfiles/*; do source $filename done +for filename in ~/.additional_dotfiles/*; do + source $filename +done + eval "$(starship init zsh)" diff --git a/Makefile b/Makefile index ad33563..01806ce 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,8 @@ dotfiles: ## Installs the dotfiles. f=$$(basename $$file); \ ln -sfn $$file $(HOME)/$$f; \ done; \ - mkdir -p $(HOME)/.config + mkdir -p $(HOME)/.additional_dotfiles; touch $(HOME)/.additional_dotfiles/credentials; \ + mkdir -p $(HOME)/.config; \ for file in $(shell find $(CURDIR)/.config -type f); do \ f=$$(basename $$file); \ ln -sfn $$file $(HOME)/.config/$$f; \ From 7fd182569be0da1327b3276453aa86248391f162 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Tue, 13 Oct 2020 10:18:20 +0100 Subject: [PATCH 05/25] Added aws-specific helpers --- .dotfiles/aliases | 2 -- .dotfiles/aws | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .dotfiles/aws diff --git a/.dotfiles/aliases b/.dotfiles/aliases index 68b9953..ef14e43 100644 --- a/.dotfiles/aliases +++ b/.dotfiles/aliases @@ -14,5 +14,3 @@ lt() { fi ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@ } - -alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION amazon/aws-cli' diff --git a/.dotfiles/aws b/.dotfiles/aws new file mode 100644 index 0000000..58797b3 --- /dev/null +++ b/.dotfiles/aws @@ -0,0 +1,24 @@ +alias aws='docker pull -q amazon/aws-cli:latest 1> /dev/null && docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws -e NO_COLOR=true -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN amazon/aws-cli' + +assume-role() { + ROLE=$1 + + if [[ -z "$ROLE" ]]; then + export AWS_ACCESS_KEY_ID= + export AWS_SECRET_ACCESS_KEY= + export AWS_SESSION_TOKEN= + else + OUTPUT=$(aws sts assume-role --role-arn $ROLE --role-session-name assumed-role-session --query Credentials --color off --output json) + + export AWS_ACCESS_KEY_ID=$(echo $OUTPUT | jq -r .Credentials.AccessKeyId) + export AWS_SECRET_ACCESS_KEY=$(echo $OUTPUT | jq -r .Credentials.SecretAccessKey) + export AWS_SESSION_TOKEN=$(echo $OUTPUT | jq -r .Credentials.SessionToken) + fi + + aws sts get-caller-identity +} + +aws-decode-message() { + ENCODED=$1 + aws sts decode-authorization-message --query DecodedMessage --output text --encoded-message $ENCODED | jq -r '.context.action, .context.resource' +} From b8e7fffb40369148c051332aea84dcb40045a398 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Tue, 13 Oct 2020 10:44:32 +0100 Subject: [PATCH 06/25] fix assume role --- .dotfiles/aws | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.dotfiles/aws b/.dotfiles/aws index 58797b3..3417b6d 100644 --- a/.dotfiles/aws +++ b/.dotfiles/aws @@ -8,11 +8,11 @@ assume-role() { export AWS_SECRET_ACCESS_KEY= export AWS_SESSION_TOKEN= else - OUTPUT=$(aws sts assume-role --role-arn $ROLE --role-session-name assumed-role-session --query Credentials --color off --output json) + OUTPUT=$(aws sts assume-role --role-arn $ROLE --role-session-name assumed-role-session --query Credentials --output json) - export AWS_ACCESS_KEY_ID=$(echo $OUTPUT | jq -r .Credentials.AccessKeyId) - export AWS_SECRET_ACCESS_KEY=$(echo $OUTPUT | jq -r .Credentials.SecretAccessKey) - export AWS_SESSION_TOKEN=$(echo $OUTPUT | jq -r .Credentials.SessionToken) + export AWS_ACCESS_KEY_ID=$(echo $OUTPUT | jq -r .AccessKeyId) + export AWS_SECRET_ACCESS_KEY=$(echo $OUTPUT | jq -r .SecretAccessKey) + export AWS_SESSION_TOKEN=$(echo $OUTPUT | jq -r .SessionToken) fi aws sts get-caller-identity From cffe261765399f51776480ec9e0d002e227d76f4 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Tue, 13 Oct 2020 14:18:12 +0100 Subject: [PATCH 07/25] Fix typo in pre-req task --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 01806ce..626efd3 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ pre-reqs: ## Install all required binaries. brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ which fzf > /dev/null || brew install fzf; \ which bat > /dev/null || brew install bat; \ - which curlie > /dev/null | brew install rs/tap/curlie; \ + which curlie > /dev/null || brew install rs/tap/curlie; \ which exa > /dev/null || brew install exa; \ which kubectl > /dev/null || brew install kubectl; \ which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli; \ From 0132d1b125d12790fb088006325c761ff97d282f Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 20 Nov 2020 08:02:29 +0000 Subject: [PATCH 08/25] Update '.config/starship.toml' --- .config/starship.toml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.config/starship.toml b/.config/starship.toml index b64837e..eeae74c 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,10 +1,29 @@ -prompt_order=["directory","git_branch","git_commit","git_state","git_status","package","golang","nodejs","terraform","memory_usage","aws","kubernetes","cmd_duration","custom","line_break","jobs","battery","time","character"] +format = """\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $package\ + $golang\ + $nodejs\ + $terraform\ + $memory_usage\ + $aws\ + $kubernetes\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ [character] -symbol = "✨ " -error_symbol = "✗ " +success_symbol = "[✨](yellow)" +error_symbol = "[✗](red)" use_symbol_for_status = true -style_success = "yellow" [aws] symbol = " " From 17c24459cd64c021567055360b8926a88da00ade Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Wed, 25 Nov 2020 17:24:10 +0000 Subject: [PATCH 09/25] Avoid using exa my mistake --- .dotfiles/kubernetes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dotfiles/kubernetes b/.dotfiles/kubernetes index bd5d5be..401262e 100644 --- a/.dotfiles/kubernetes +++ b/.dotfiles/kubernetes @@ -73,7 +73,7 @@ source <(kubectl completion zsh) ## Merge multiple kubeconfigs function join_by { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; } KUBECONFIG="$HOME/.kube/config" -OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(ls $HOME/.kube/clusters)))" +OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(/bin/ls $HOME/.kube/clusters)))" export KUBECONFIG=$KUBECONFIG:$OTHER_CLUSTERS ## Kubectl exec From 67de5ca34733c7b5d5ce0a9974f5d1e7dec820ca Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Wed, 25 Nov 2020 17:24:16 +0000 Subject: [PATCH 10/25] Fix AWS --- .dotfiles/aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dotfiles/aliases b/.dotfiles/aliases index 68b9953..4cc4b55 100644 --- a/.dotfiles/aliases +++ b/.dotfiles/aliases @@ -15,4 +15,4 @@ lt() { ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@ } -alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION amazon/aws-cli' +alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli' From 97580de535c42e9868751ce7a26719d4b78916cb Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sun, 6 Dec 2020 13:20:26 +0000 Subject: [PATCH 11/25] Remove prefix --- .config/starship.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/starship.toml b/.config/starship.toml index eeae74c..26d7b9a 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -34,7 +34,6 @@ symbol = " " [git_commit] only_detached = true -prefix = "(#" [golang] symbol = " " From 91f4909c0dde8d238f4ef3b3ccfeb5f2555e22a2 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 7 Dec 2020 06:39:16 +0000 Subject: [PATCH 12/25] Always use ssh for GitHub --- .gitconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitconfig b/.gitconfig index 64bca0b..298a0d4 100644 --- a/.gitconfig +++ b/.gitconfig @@ -39,3 +39,7 @@ [diff] compactionHeuristic = true + + +[url "ssh://git@github.com"] + insteadOf = https://github.com From 5315d952989e9fe4cb06422a19cbe6797c770b8b Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 7 Dec 2020 06:39:28 +0000 Subject: [PATCH 13/25] Added make task to upgrade deps --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index 626efd3..5d422d9 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,26 @@ pre-reqs: ## Install all required binaries. which htop > /dev/null || brew install htop; \ which starship > /dev/null || brew install starship +.PHONY: upgrade +upgrade: ## Upgrade all required binaries. + brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null && brew upgrade homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ + which fzf > /dev/null && brew upgrade fzf; \ + which bat > /dev/null && brew upgrade bat; \ + which curlie > /dev/null && brew upgrade rs/tap/curlie; \ + which exa > /dev/null && brew upgrade exa; \ + which kubectl > /dev/null && brew upgrade kubectl; \ + which tkn > /dev/null && brew upgrade tektoncd/tools/tektoncd-cli; \ + which k9s > /dev/null && brew upgrade k9s; \ + which helm > /dev/null && brew upgrade helm; \ + which go > /dev/null && brew upgrade go; \ + which jq > /dev/null && brew upgrade jq; \ + which kind > /dev/null && brew upgrade kind; \ + which kubectx > /dev/null && brew upgrade kubectx; \ + which tldr > /dev/null && brew upgrade tldr; \ + which progress > /dev/null && brew upgrade progress; \ + which htop > /dev/null && brew upgrade htop; \ + which starship > /dev/null && brew upgrade starship + .PHONY: dotfiles dotfiles: ## Installs the dotfiles. for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \ From c0751c5633fd4d2fa615251d2c11438d569bcffb Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 7 Dec 2020 07:07:54 +0000 Subject: [PATCH 14/25] Handle git email --- .gitconfig | 1 - Makefile | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index 298a0d4..eba1e12 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,6 +1,5 @@ [user] name = Marcus Noble - email = github@marcusnoble.co.uk [core] editor = /usr/bin/vim diff --git a/Makefile b/Makefile index 5d422d9..ef68596 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,12 @@ upgrade: ## Upgrade all required binaries. .PHONY: dotfiles dotfiles: ## Installs the dotfiles. + GITEMAIL=$$(git config --get user.email); \ for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \ f=$$(basename $$file); \ ln -sfn $$file $(HOME)/$$f; \ done; \ + git config --system --add user.email $$GITEMAIL; \ mkdir -p $(HOME)/.additional_dotfiles; touch $(HOME)/.additional_dotfiles/credentials; \ mkdir -p $(HOME)/.config; \ for file in $(shell find $(CURDIR)/.config -type f); do \ From f67e206fc9d1eb9b791c30db30df65dfc335ae5a Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 10 May 2021 11:21:26 +0100 Subject: [PATCH 15/25] Updated starship config --- .config/starship.toml | 44 +++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/.config/starship.toml b/.config/starship.toml index 26d7b9a..d035c10 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,50 +1,70 @@ format = """\ + $status\ + $cmd_duration\ + $line_break\ $directory\ $git_branch\ $git_commit\ $git_state\ $git_status\ - $package\ + $aws\ + $kubernetes\ + $helm\ $golang\ $nodejs\ $terraform\ - $memory_usage\ - $aws\ - $kubernetes\ - $cmd_duration\ + $package\ $custom\ $line_break\ $jobs\ - $battery\ $time\ $character\ """ +command_timeout = 1000 +add_newline = false + [character] success_symbol = "[✨](yellow)" error_symbol = "[✗](red)" -use_symbol_for_status = true [aws] symbol = " " -displayed_items = "profile" - -[docker] -symbol = " " +format = "[$symbol$profile]($style) " [git_commit] only_detached = true [golang] symbol = " " +format = "[$symbol$version]($style) " [kubernetes] +format = '[$symbol$context \($namespace\)]($style) ' symbol = "ﴱ " style = "bold blue" disabled = false [terraform] -show_version = true +format = "[$symbol$version]($style) " [nodejs] symbol = " " + +[status] +style = "red" +symbol = "✗" +format = '[↪ \[$symbol $common_meaning$signal_name$maybe_int\]]($style)' +map_symbol = true +disabled = false + +[helm] +format = "[$symbol$version]($style) " +symbol = " " + +[cmd_duration] +format = " took [$duration]($style) " + +[package] +symbol = "📦" +format = "[$symbol$version]($style) " From 4f3b5b18d15a84b6a87ebd6327b5fcdec688f1f2 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Thu, 13 May 2021 14:18:57 +0100 Subject: [PATCH 16/25] Updated some starship and added doggo alias --- .config/starship.toml | 2 +- .dotfiles/aliases | 1 + .dotfiles/environment | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/starship.toml b/.config/starship.toml index d035c10..8e6ef4b 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -22,7 +22,7 @@ format = """\ """ command_timeout = 1000 -add_newline = false +add_newline = true [character] success_symbol = "[✨](yellow)" diff --git a/.dotfiles/aliases b/.dotfiles/aliases index db0b544..04b5373 100644 --- a/.dotfiles/aliases +++ b/.dotfiles/aliases @@ -15,3 +15,4 @@ lt() { ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@ } alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli' +alias doggo='docker run --rm -it ghcr.io/mr-karan/doggo:latest' diff --git a/.dotfiles/environment b/.dotfiles/environment index fc7e3a7..d883fde 100644 --- a/.dotfiles/environment +++ b/.dotfiles/environment @@ -19,3 +19,6 @@ export GO111MODULE=on # Krew export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + +# Starship +export STARSHIP_LOG=error From fe445a48f16bba706c8222c9d5c5c525eb38c271 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 14 May 2021 05:38:41 +0100 Subject: [PATCH 17/25] Fixed k9s linking --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ef68596..4251bfd 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ upgrade: ## Upgrade all required binaries. .PHONY: dotfiles dotfiles: ## Installs the dotfiles. GITEMAIL=$$(git config --get user.email); \ - for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \ + for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".k9s" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \ f=$$(basename $$file); \ ln -sfn $$file $(HOME)/$$f; \ done; \ @@ -58,7 +58,12 @@ dotfiles: ## Installs the dotfiles. for file in $(shell find $(CURDIR)/.config -type f); do \ f=$$(basename $$file); \ ln -sfn $$file $(HOME)/.config/$$f; \ - done; + done; \ + mkdir -p $(HOME)/.k9s; \ + for file in $(shell find $(CURDIR)/.k9s -type f); do \ + f=$$(basename $$file); \ + ln -sfn $$file $(HOME)/.k9s/$$f; \ + done; \ .PHONY: help help: From a1b136155bc4496ee97d229f1e20f6d381379949 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 14 May 2021 05:50:31 +0100 Subject: [PATCH 18/25] Updated k9s config / skin --- .k9s/skin.yml | 113 +++++++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 52 deletions(-) diff --git a/.k9s/skin.yml b/.k9s/skin.yml index 504c222..df790ac 100644 --- a/.k9s/skin.yml +++ b/.k9s/skin.yml @@ -1,66 +1,75 @@ +# Base16 Material - k9s color config +# Scheme author: Nate Peterson +# Template author: Jef LeCompte (https://jef.buzz) k9s: + # General K9s styles body: - fgColor: "#97979b" - bgColor: "#414446" - logoColor: "#5af78e" + fgColor: '#eeffff' + bgColor: '#263238' + logoColor: '#89ddff' + + # ClusterInfoView styles info: - fgColor: white - sectionColor: "#5af78e" + fgColor: '#c3e88d' + sectionColor: '#eeffff' + + # Frame styles frame: + # Borders styles border: - fgColor: "#5af78e" - focusColor: "#5af78e" + fgColor: '#82aaff' + focusColor: '#89ddff' + + # MenuView attributes and styles menu: - fgColor: white - keyColor: "#57c7ff" - numKeyColor: "#ff6ac1" + fgColor: '#eeffff' + keyColor: '#c3e88d' + # Used for favorite namespaces + numKeyColor: '#c3e88d' + + # CrumbView attributes for history navigation. crumbs: - fgColor: "#414446" - bgColor: white - activeColor: "#f3f99d" + fgColor: '#89ddff' + bgColor: '#263238' + activeColor: '#263238' + + # Resource status and update styles status: - newColor: "#eff0eb" - modifyColor: "#5af78e" - addColor: "#57c7ff" - errorColor: "#ff5c57" - highlightcolor: "#f3f99d" - killColor: mediumpurple - completedColor: gray + newColor: '#eeffff' + modifyColor: '#ffcb6b' + addColor: '#c3e88d' + errorColor: '#f07178' + highlightcolor: '#89ddff' + killColor: '#f07178' + completedColor: '#c3e88d' + + # Border title styles. title: - fgColor: "#5af78e" - bgColor: "#414446" - highlightColor: white - counterColor: white - filterColor: "#57c7ff" + fgColor: '#eeffff' + bgColor: '#263238' + highlightColor: '#c792ea' + counterColor: '#c792ea' + filterColor: '#c792ea' + # Specific views styles views: - # Charts skins... - charts: - bgColor: default - defaultDialColors: - - "#57c7ff" - - "#ff5c57" - defaultChartColors: - - "#57c7ff" - - "#ff5c57" + # TableView attributes. table: - fgColor: "#57c7ff" - bgColor: "#414446" - cursorColor: "#5af78e" - markColor: darkgoldenrod + fgColor: '#82aaff' + bgColor: '#263238' + cursorColor: '#89ddff' + # Header row styles. header: - fgColor: white - bgColor: "#414446" - sorterColor: orange - xray: - fgColor: "#57c7ff" - bgColor: "#414446" - cursorColor: "#5af78e" - graphicColor: darkgoldenrod - showIcons: false + fgColor: '#82aaff' + bgColor: '#263238' + sorterColor: '#c792ea' + + # YAML info styles. yaml: - keyColor: "#ff5c57" - colonColor: white - valueColor: "#f3f99d" + keyColor: '#f07178' + colonColor: '#89ddff' + valueColor: '#eeffff' + + # Logs styles. logs: - fgColor: white - bgColor: "#414446" + fgColor: '#eeffff' + bgColor: '#263238' From 17e691cf963c30d9802401c0572918a47144b368 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sun, 16 May 2021 12:01:32 +0100 Subject: [PATCH 19/25] added git-clone alias --- .dotfiles/aliases | 5 +++++ .gitconfig | 1 - Makefile | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.dotfiles/aliases b/.dotfiles/aliases index 04b5373..26ee17a 100644 --- a/.dotfiles/aliases +++ b/.dotfiles/aliases @@ -16,3 +16,8 @@ lt() { } alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli' alias doggo='docker run --rm -it ghcr.io/mr-karan/doggo:latest' + +git-clone() { + git clone $1 + cd "$(basename "$1" .git)" +} diff --git a/.gitconfig b/.gitconfig index eba1e12..5b44193 100644 --- a/.gitconfig +++ b/.gitconfig @@ -39,6 +39,5 @@ [diff] compactionHeuristic = true - [url "ssh://git@github.com"] insteadOf = https://github.com diff --git a/Makefile b/Makefile index 4251bfd..00c9c94 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ upgrade: ## Upgrade all required binaries. .PHONY: dotfiles dotfiles: ## Installs the dotfiles. - GITEMAIL=$$(git config --get user.email); \ + @GITEMAIL=$$(git config --get user.email); \ for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".k9s" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \ f=$$(basename $$file); \ ln -sfn $$file $(HOME)/$$f; \ From e1a40415c67b9a0f68e9311c98b74ce12ee3ea50 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 7 Jun 2021 15:11:10 +0100 Subject: [PATCH 20/25] Fixed changelog-changed for non-master --- .gitconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index 5b44193..47ebe1c 100644 --- a/.gitconfig +++ b/.gitconfig @@ -21,7 +21,7 @@ basename = "!git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\\///' | sed 's/\\.git//'" org-name = "!git remote -v | grep -m 1 -o ':.*/' | sed 's:^.\\(.*\\).$:\\1:'" branch-name = "!git rev-parse --abbrev-ref HEAD" - changelog-changed = "!test $(git diff --name-only HEAD origin/master | grep CHANGELOG.md | wc -l | xargs) = 1" + changelog-changed = "!test $(git diff --name-only HEAD origin/$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') | grep CHANGELOG.md | wc -l | xargs) = 1" main = "!git remote set-head origin --auto && git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') && git pull" publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u origin $(git branch-name) && (git changelog-changed || echo '\n\n⚠️ Dont forget to update changelog ⚠️ ') ; else echo "Wat?!"; fi; }; func" @@ -41,3 +41,5 @@ [url "ssh://git@github.com"] insteadOf = https://github.com +[url "ssh://git@gitlab.et-scm.com/"] + insteadOf = https://gitlab.et-scm.com From a867f65a7aa743442d6ca01f0de205beb81c6f16 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Tue, 8 Jun 2021 08:53:38 +0100 Subject: [PATCH 21/25] Changed default git branch --- .gitconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitconfig b/.gitconfig index 47ebe1c..3ad20ae 100644 --- a/.gitconfig +++ b/.gitconfig @@ -8,6 +8,9 @@ [push] default = simple +[init] + defaultBranch = main + [credential] helper = store From 5cf171a14ec780fe92055a1af8c39565a23c32b3 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Tue, 8 Jun 2021 08:55:29 +0100 Subject: [PATCH 22/25] Updated --- .hyper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.hyper.js b/.hyper.js index 1798a6c..4308658 100644 --- a/.hyper.js +++ b/.hyper.js @@ -8,7 +8,7 @@ module.exports = { // or `'canary'` for less polished but more frequent updates updateChannel: 'stable', - scrollback: 100000, + scrollback: 10000000, // default font size in pixels for all tabs fontSize: 13, From 4a0c4647049fbda9d43d78a3370aad723f54b4bf Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sun, 27 Jun 2021 17:27:40 +0100 Subject: [PATCH 23/25] Updated installed cli tools and aliases --- .dotfiles/aliases | 30 ++++++++++++++++++++++++++---- .dotfiles/environment | 2 +- .gitconfig | 15 +++++++++++++++ Makefile | 26 ++++++++++++++++++++++++-- 4 files changed, 66 insertions(+), 7 deletions(-) diff --git a/.dotfiles/aliases b/.dotfiles/aliases index 26ee17a..c625b19 100644 --- a/.dotfiles/aliases +++ b/.dotfiles/aliases @@ -1,10 +1,33 @@ +# Rename existing tools +alias _cat=`which cat` +alias _curl=`which curl` +alias _ls="/bin/ls" +alias _grep="/bin/grep" +alias _diff=`which diff` +alias _du=`which du` +alias _df=`which df` +alias _find=`which find` +alias _top=`which top` +alias _ps="/bin/ps" +alias _dig=`which dig` + # Aliases -alias grep='grep --color=auto' -alias watch='watch ' alias cat=' bat ' alias curl='curlie' -alias tmp='cd $(mktemp -d)' alias ls=' exa --group-directories-first --icons --header --git --ignore-glob=.git' +alias grep='rg' +alias diff='delta' +alias du='dust' +alias df='duf -hide special' +alias find='fd' +alias bandwhich='sudo bandwhich' +alias top='btm' +alias ps='procs' +alias dig='dog' + +alias machine-info='macchina -t Boron --bar' +alias watch='watch ' +alias tmp='cd $(mktemp -d)' lt() { DEPTH=$(echo $1 | grep "^[0-9]*$") if [ "$DEPTH" = "" ]; then @@ -15,7 +38,6 @@ lt() { ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@ } alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli' -alias doggo='docker run --rm -it ghcr.io/mr-karan/doggo:latest' git-clone() { git clone $1 diff --git a/.dotfiles/environment b/.dotfiles/environment index d883fde..9fe7437 100644 --- a/.dotfiles/environment +++ b/.dotfiles/environment @@ -1,4 +1,4 @@ -export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/goworkspace/bin" +export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/goworkspace/bin:$HOME/.cargo/bin" export EDITOR='vim' export VISUAL='code' diff --git a/.gitconfig b/.gitconfig index 3ad20ae..7c48055 100644 --- a/.gitconfig +++ b/.gitconfig @@ -42,6 +42,21 @@ [diff] compactionHeuristic = true +[pager] + diff = delta + log = delta + reflog = delta + show = delta + +[delta] + plus-style = "syntax #012800" + minus-style = "syntax #340001" + syntax-theme = Monokai Extended + navigate = true + +[interactive] + diffFilter = delta --color-only + [url "ssh://git@github.com"] insteadOf = https://github.com [url "ssh://git@gitlab.et-scm.com/"] diff --git a/Makefile b/Makefile index 00c9c94..a30d051 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ pre-reqs: ## Install all required binaries. which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; \ [ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \ brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ + brew list rust > /dev/null || brew install rust; \ which fzf > /dev/null || brew install fzf; \ which bat > /dev/null || brew install bat; \ which curlie > /dev/null || brew install rs/tap/curlie; \ @@ -23,11 +24,22 @@ pre-reqs: ## Install all required binaries. which tldr > /dev/null || brew install tldr; \ which progress > /dev/null || brew install progress; \ which htop > /dev/null || brew install htop; \ - which starship > /dev/null || brew install starship + which starship > /dev/null || brew install starship; \ + which macchina > /dev/null || cargo install macchina; \ + which rg > /dev/null || brew install ripgrep; \ + which delta > /dev/null || brew install git-delta; \ + which dust > /dev/null || brew install dust; \ + which duf > /dev/null || brew install duf; \ + which fd > /dev/null || brew install fd; \ + which bandwhich > /dev/null || brew install bandwhich; \ + which btm > /dev/null || cargo install bottom; \ + which procs > /dev/null || brew install procs; \ + which dog > /dev/null || brew install dog .PHONY: upgrade upgrade: ## Upgrade all required binaries. brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null && brew upgrade homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ + brew list rust > /dev/null || brew upgrade rust; \ which fzf > /dev/null && brew upgrade fzf; \ which bat > /dev/null && brew upgrade bat; \ which curlie > /dev/null && brew upgrade rs/tap/curlie; \ @@ -43,7 +55,17 @@ upgrade: ## Upgrade all required binaries. which tldr > /dev/null && brew upgrade tldr; \ which progress > /dev/null && brew upgrade progress; \ which htop > /dev/null && brew upgrade htop; \ - which starship > /dev/null && brew upgrade starship + which starship > /dev/null && brew upgrade starship; \ + which macchina > /dev/null && cargo install macchina; \ + which rg > /dev/null && brew upgrade ripgrep; \ + which delta > /dev/null && brew upgrade git-delta; \ + which dust > /dev/null && brew upgrade dust; \ + which duf > /dev/null && brew upgrade duf; \ + which fd > /dev/null && brew upgrade fd; \ + which bandwhich > /dev/null && brew upgrade bandwhich; \ + which btm > /dev/null && cargo install bottom; \ + which procs > /dev/null && brew upgrade procs; \ + which dog > /dev/null && brew upgrade dog .PHONY: dotfiles dotfiles: ## Installs the dotfiles. From 7c5f0aba601eeb8a8c05710ac3c04ae3a739cba8 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Thu, 1 Jul 2021 07:14:11 +0100 Subject: [PATCH 24/25] Added rustup --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a30d051..619f774 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ pre-reqs: ## Install all required binaries. which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; \ [ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \ brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ - brew list rust > /dev/null || brew install rust; \ + which rustup > /dev/null || curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path; \ which fzf > /dev/null || brew install fzf; \ which bat > /dev/null || brew install bat; \ which curlie > /dev/null || brew install rs/tap/curlie; \ @@ -39,7 +39,7 @@ pre-reqs: ## Install all required binaries. .PHONY: upgrade upgrade: ## Upgrade all required binaries. brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null && brew upgrade homebrew/cask-fonts/font-open-dyslexic-nerd-font; \ - brew list rust > /dev/null || brew upgrade rust; \ + which rustup > /dev/null || rustup update; \ which fzf > /dev/null && brew upgrade fzf; \ which bat > /dev/null && brew upgrade bat; \ which curlie > /dev/null && brew upgrade rs/tap/curlie; \ From 61545c7939330a7c24f49c2fda8a600c1d0c0cf9 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 2 Jul 2021 06:31:56 +0100 Subject: [PATCH 25/25] Removed k9s cluster details --- .k9s/config.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .k9s/config.yml diff --git a/.k9s/config.yml b/.k9s/config.yml new file mode 100644 index 0000000..1b77366 --- /dev/null +++ b/.k9s/config.yml @@ -0,0 +1,26 @@ +k9s: + refreshRate: 2 + maxConnRetry: 5 + enableMouse: false + headless: false + logoless: false + crumbsless: false + readOnly: false + noIcons: false + logger: + tail: 100 + buffer: 5000 + sinceSeconds: 60 + fullScreenLogs: false + textWrap: false + showTime: false + currentContext: + currentCluster: + clusters: [] + thresholds: + cpu: + critical: 90 + warn: 70 + memory: + critical: 90 + warn: 70