Remove unused and refactor
This commit is contained in:
parent
19e9411404
commit
28d2b84e32
@ -1,15 +1,20 @@
|
||||
{{- $development := promptBoolOnce . "development" "is this a development environment [false]" -}}
|
||||
{{- $hellotech := promptBoolOnce . "hellotech" "include work tools [false]" -}}
|
||||
{{- $personal_dev := promptBoolOnce . "personal_dev" "is this a personal development environment [false]" -}}
|
||||
{{- $git_email := promptStringOnce . "git_email" "email to use in git config" -}}
|
||||
{{- $git_name := promptStringOnce . "git_name" "name to use in git config" -}}
|
||||
{{- $include_legacy := promptBoolOnce . "include_legacy" "include old scripts [false]" -}}
|
||||
{{- $bws_token := promptStringOnce . "bws_token" "BitWarden Secrets Manager Access Token" -}}
|
||||
{{- $work := promptBoolOnce . "work" "include work tools [false]" -}}
|
||||
|
||||
encryption = "age"
|
||||
|
||||
[age]
|
||||
identity = "{{ .chezmoi.homeDir }}/.config/chezmoi/key.txt"
|
||||
recipient = "age166qk8xkvd5cx2mqfxenw0mvmg4ghv7jzg8ffr0f0dave5lwzm38qswha8c"
|
||||
|
||||
[data]
|
||||
bws_token = {{ $bws_token | quote }}
|
||||
development = {{ $development }}
|
||||
hellotech = {{ $hellotech }}
|
||||
git_email = "{{ $git_email }}"
|
||||
git_name = "{{ $git_name }}"
|
||||
personal_dev = {{ $personal_dev }}
|
||||
include_legacy = {{ $include_legacy }}
|
||||
work = {{ $work }}
|
||||
|
||||
@ -5,8 +5,7 @@
|
||||
{{- if not .include_legacy }}
|
||||
/.local/share/duck-encoder
|
||||
{{- end }}
|
||||
{{- if not .hellotech }}
|
||||
{{- if not .work }}
|
||||
/.config/profile/env.d/hellotech.env
|
||||
/.config/profile/profile.d/trubka.sh
|
||||
/.config/profile/profile.d/hellotech.sh
|
||||
{{- end }}
|
||||
|
||||
6
dot_config/git/config.d/buddy.wtf.tmpl
Normal file
6
dot_config/git/config.d/buddy.wtf.tmpl
Normal file
@ -0,0 +1,6 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: set filetype=gitconfig: */ -}}
|
||||
#{{ if and .personal_dev (lookPath "git") -}}
|
||||
[url "ssh://git@git.buddy.wtf"]
|
||||
insteadOf = https://git.buddy.wtf
|
||||
#{{- end }}
|
||||
6
dot_config/git/config.d/local.tmpl
Normal file
6
dot_config/git/config.d/local.tmpl
Normal file
@ -0,0 +1,6 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: set filetype=gitconfig: */ -}}
|
||||
#{{ if and .personal_dev (lookPath "git") -}}
|
||||
[url "ssh://git@git.xbudex.com:2022"]
|
||||
insteadOf = https://git.xbudex.com
|
||||
#{{- end }}
|
||||
11
dot_config/git/config.d/work.tmpl
Normal file
11
dot_config/git/config.d/work.tmpl
Normal file
@ -0,0 +1,11 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: set filetype=gitconfig: */ -}}
|
||||
#{{ if and .work (lookPath "git") -}}
|
||||
[url "git@github.com:HelloTech"]
|
||||
insteadOf = https://github.com/HelloTech
|
||||
|
||||
#{{ if lookPath "node" -}}
|
||||
[init]
|
||||
templateDir = #{{ .chezmoi.homeDir }}/.config/git/template
|
||||
#{{- end }}
|
||||
#{{- end }}
|
||||
@ -1,14 +1,13 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
# chezmoi:template:right-delimiter=}}#
|
||||
#{{- /* vim: set filetype=gitconfig: */ -}}#
|
||||
#{{ if lookPath "git" -}}#
|
||||
#{{- /* vim: set filetype=gitconfig: */ -}}
|
||||
#{{ if lookPath "git" -}}
|
||||
[core]
|
||||
editor = vim
|
||||
excludesfile = #{{ .chezmoi.homeDir }}#/.config/git/ignore
|
||||
excludesfile = #{{ .chezmoi.homeDir }}/.config/git/ignore
|
||||
quotepath = false
|
||||
commitGraph = true
|
||||
logallrefupdates = true
|
||||
#{{- if lookPath "delta" }}#
|
||||
#{{- if lookPath "delta" }}
|
||||
pager = delta
|
||||
|
||||
[interactive]
|
||||
@ -21,7 +20,7 @@
|
||||
|
||||
[merge]
|
||||
conflictstyle = diff3
|
||||
#{{- end }}#
|
||||
#{{- end }}
|
||||
|
||||
[color]
|
||||
branch = auto
|
||||
@ -31,12 +30,10 @@
|
||||
ui = auto
|
||||
|
||||
[user]
|
||||
name = Buddy Sandidge
|
||||
email = git@buddy.wtf
|
||||
name = #{{ .git_name }}
|
||||
email = #{{ .git_email }}
|
||||
|
||||
[alias]
|
||||
br = branch
|
||||
ci = commit
|
||||
co = checkout
|
||||
cp = cherry-pick
|
||||
cw = diff --color-words
|
||||
@ -45,22 +42,12 @@
|
||||
dfw = diff --ignore-space-change --color-words
|
||||
dfc = diff --ignore-space-change --cached
|
||||
dfcw = diff --ignore-space-change --color-words --cached
|
||||
dmw = diff --ignore-space-change --color-words master
|
||||
dmn = diff master --name-only
|
||||
st = status -sb
|
||||
dm = diff master
|
||||
dmcw = diff master --color-words
|
||||
p = !git fetch --all
|
||||
sup = submodule update
|
||||
com = "!bash -c 'if [[ $(git rev-parse --verify main 2>/dev/null) ]] ; then git checkout main ; else git checkout master ; fi'"
|
||||
file = show --pretty="format:" --name-only
|
||||
glog = !git log --pretty=oneline | grep
|
||||
dpull = !git svn fetch && git svn rebase
|
||||
dcommit = svn dcommit
|
||||
lg = log --graph --pretty=format:'%Cred%h%Creset %s%Cred%d%Creset %Cgreen(%cr by %cN)%Creset'
|
||||
fix-last-commit = commit --amend
|
||||
flc = fix-last-commit
|
||||
rmbr = push origin --delete
|
||||
# http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
|
||||
list = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
|
||||
ls = list
|
||||
@ -92,9 +79,9 @@
|
||||
|
||||
[diff]
|
||||
algorithm = histogram
|
||||
#{{- if lookPath "delta" }}#
|
||||
#{{- if lookPath "delta" }}
|
||||
colorMoved = default
|
||||
#{{- end }}#
|
||||
#{{- end }}
|
||||
|
||||
[safe]
|
||||
directory = *
|
||||
@ -103,22 +90,8 @@
|
||||
allowfilter = true
|
||||
allowAnySHA1InWant = true
|
||||
|
||||
#{{ if .development -}}#
|
||||
[url "ssh://git@git.buddy.wtf"]
|
||||
insteadOf = https://git.buddy.wtf
|
||||
|
||||
[url "ssh://git@git.xbudex.com:2022"]
|
||||
insteadOf = https://git.xbudex.com
|
||||
#{{- end }}#
|
||||
|
||||
#{{ if .hellotech -}}#
|
||||
[url "git@github.com:HelloTech"]
|
||||
insteadOf = https://github.com/HelloTech
|
||||
email = buddy@hellotech.com
|
||||
|
||||
#{{ if lookPath "node" -}}#
|
||||
[init]
|
||||
templateDir = #{{ .chezmoi.homeDir }}#/.config/git/template
|
||||
#{{- end }}#
|
||||
#{{- end }}#
|
||||
#{{- end }}#
|
||||
#{{- range $file := (glob (joinPath .chezmoi.homeDir ".config" "git" "config.d" "*")) }}
|
||||
[include]
|
||||
path = #{{ $file }}
|
||||
#{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// chezmoi:template:left-delimiter="/*{{"
|
||||
// chezmoi:template:right-delimiter="}}*/"
|
||||
/*{{- /* vim: set filetype=javascript: */ -}}*/
|
||||
/*{{ if and .hellotech (lookPath "node") -}}*/
|
||||
/*{{ if and .work (lookPath "node") -}}*/
|
||||
#!/usr/bin/env node
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
@ -26,7 +26,7 @@ MANPAGER="sh -c 'col -bx | bat --language man --plain'"
|
||||
CLICOLOR=1
|
||||
#{{ end -}}#
|
||||
|
||||
#{{ if .hellotech -}}#
|
||||
#{{ if .work -}}#
|
||||
GOPRIVATE=github.com/HelloTech
|
||||
PULUMI_SKIP_UPDATE_CHECK=true
|
||||
#{{ end -}}#
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: set filetype=sh: */ -}}
|
||||
#{{- if .bws_token -}}
|
||||
BWS_ACCESS_TOKEN=#{{ .bws_token }}
|
||||
#{{- end }}
|
||||
@ -12,6 +12,19 @@ if [ -d "${HOME}/go/bin" ] && ! echo "$PATH" | grep -q "${HOME}/go/bin" ; then
|
||||
fi
|
||||
#{{- end }}
|
||||
|
||||
#{{- if stat "/usr/local/opt/mysql-client/bin" }}
|
||||
#{{- /* if mysql client is installed from homebrew */ -}}
|
||||
if [ -d /usr/local/opt/mysql-client/bin ] ; then
|
||||
PATH="/usr/local/opt/mysql-client/bin:${PATH}"
|
||||
fi
|
||||
#{{ end -}}
|
||||
|
||||
#{{- if stat "{{ .chezmoi.homeDir }}/google-cloud-sdk/bin" }}
|
||||
if [ -d "{{ .chezmoi.homeDir }}/google-cloud-sdk/bin" ] ; then
|
||||
PATH="${PATH}:{{ .chezmoi.homeDir }}/google-cloud-sdk/bin"
|
||||
fi
|
||||
#{{ end -}}
|
||||
|
||||
#{{- if lookPath "cargo" }}
|
||||
if [ -f "${HOME}/.cargo/env" ]; then
|
||||
. "${HOME}/.cargo/env"
|
||||
|
||||
@ -74,6 +74,10 @@ yaml_to_json () (
|
||||
_run_require yaml_to_json "$@"
|
||||
)
|
||||
|
||||
k8s_last_config () (
|
||||
_run_require k8s_last_config "$@"
|
||||
)
|
||||
|
||||
make_script () (
|
||||
_run_require make_script "$@"
|
||||
)
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
k8s_last_config () (
|
||||
dasel --read yaml --write json \
|
||||
| jq --raw-output '.metadata.annotations["kubectl.kubernetes.io/last-applied-configuration"]' \
|
||||
| dasel --read json --write yaml \
|
||||
| bat --language yaml
|
||||
)
|
||||
|
||||
_append_path () {
|
||||
if [ ! -d "$1" ]; then
|
||||
return
|
||||
fi
|
||||
case "${PATH}" in
|
||||
*"$1"*) return ;;
|
||||
*) ;;
|
||||
esac
|
||||
PATH="${PATH}:${1}"
|
||||
}
|
||||
|
||||
_append_path /usr/local/opt/mysql-client/bin
|
||||
_append_path "${HOME}/google-cloud-sdk/bin"
|
||||
|
||||
unset _append_path
|
||||
@ -1,81 +0,0 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: set filetype=jq: */ -}}
|
||||
#{{- if and .hellotech (lookPath "jq") -}}
|
||||
import "colors" as colors;
|
||||
|
||||
def clean_multierror:
|
||||
if . == null then empty
|
||||
else sub("1 error occurred:\n\t\\* "; ""; "mg")
|
||||
| sub("\n+$"; ""; "gm") | sub("\t\\*"; " →"; "g")
|
||||
end;
|
||||
|
||||
def _local_time:
|
||||
sub("\\.\\d+Z$"; "Z"; "g")
|
||||
| fromdate
|
||||
| strflocaltime("%b %m %I:%M:%S %Z");
|
||||
|
||||
def gcp_clean_log:
|
||||
map(
|
||||
(.severity | ascii_downcase) as $level
|
||||
| .timestamp as $ts
|
||||
| .jsonPayload
|
||||
| setpath(["level"]; $level)
|
||||
| setpath(["timestamp"]; $ts | _local_time)
|
||||
| .error?.Error |= clean_multierror
|
||||
);
|
||||
|
||||
def lift_payload: map(.jsonPayload);
|
||||
def lift_error: lift_payload | .[]?.error?.Error |= clean_multierror;
|
||||
|
||||
def level_color: {
|
||||
debug: colors::black,
|
||||
info: colors::blue,
|
||||
warning: colors::yellow,
|
||||
error: colors::red,
|
||||
};
|
||||
|
||||
def _show_op: "[" +.Package + " " + .Op + "]";
|
||||
def _show_stack: .Stack | map(" → " + _show_op + "\t" + .Message) | join("\n");
|
||||
def _show_error:
|
||||
.error
|
||||
| if .Error
|
||||
then _show_op + " " + .Error + "\n" + _show_stack
|
||||
else . end;
|
||||
|
||||
def _show_level:
|
||||
( if .level == "debug" then level_color.debug
|
||||
elif .level == "info" then level_color.info
|
||||
elif .level == "warning" then level_color.warning
|
||||
elif .level == "error" then level_color.error
|
||||
else colors::reset end
|
||||
) as $color
|
||||
| colors::reset + "[" + $color + (.level | ascii_upcase) + colors::reset + "]";
|
||||
|
||||
def _show_props($ignore):
|
||||
( ["timestamp", "message", "level", "error", "admin_id", "client_id",
|
||||
"service", "source", $ignore]
|
||||
| flatten(1)
|
||||
| join("|")
|
||||
) as $regex
|
||||
| to_entries
|
||||
| sort_by(.key)
|
||||
| [.[]
|
||||
| select(false == (.key | test("(" + $regex + ")")))
|
||||
| select(.value)
|
||||
| select(.value != 0)
|
||||
| colors::blue + "\(.key)" + colors::black + "=" + colors::yellow + "\(.value)" + colors::reset
|
||||
]
|
||||
| join(" ");
|
||||
|
||||
def show:
|
||||
["githash", "request_id", "path", "package"] as $ignore
|
||||
| gcp_clean_log
|
||||
| .[]
|
||||
| colors::magenta + .timestamp + colors::reset +
|
||||
" [" + _show_props($ignore) + "]\n" +
|
||||
_show_level + " " + colors::white + .message + (
|
||||
if .error then
|
||||
"\n" + colors::red + "ERROR" + colors::reset + ": " + _show_error
|
||||
else "" end
|
||||
) + colors::reset;
|
||||
#{{- end }}
|
||||
10
dot_local/share/buddy/lib/k8s_last_config.sh
Normal file
10
dot_local/share/buddy/lib/k8s_last_config.sh
Normal file
@ -0,0 +1,10 @@
|
||||
require assert/command
|
||||
|
||||
assert_command bat dasel jq
|
||||
|
||||
k8s_last_config() (
|
||||
dasel --read yaml --write json |
|
||||
jq --raw-output '.metadata.annotations["kubectl.kubernetes.io/last-applied-configuration"]' |
|
||||
dasel --read json --write yaml |
|
||||
bat --language yaml
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user