commit 88010132813af444a616a44851af6349f557009d
parent 65ab528cb3858fb656d9ba7d22385c6efaaa9b9e
Author: Mark Feller <mark@getsunday.com>
Date: Thu, 5 Nov 2020 20:21:12 -0700
resync work laptop config
Diffstat:
9 files changed, 70 insertions(+), 30 deletions(-)
diff --git a/dots/.config/emacs/core/core-macos.el b/dots/.config/emacs/core/core-macos.el
@@ -16,6 +16,7 @@
;; You should have received a copy of the GNU General Public License
;; along with this file. If not, see <http://www.gnu.org/licenses/>.
+
;;; Commentary:
;;; Code:
diff --git a/dots/.config/emacs/core/core-packages.el b/dots/.config/emacs/core/core-packages.el
@@ -16,6 +16,7 @@
;; You should have received a copy of the GNU General Public License
;; along with this file. If not, see <http://www.gnu.org/licenses/>.
+
;;; Commentary:
;;; Code:
diff --git a/dots/.config/emacs/core/core-paths.el b/dots/.config/emacs/core/core-paths.el
@@ -16,6 +16,7 @@
;; You should have received a copy of the GNU General Public License
;; along with this file. If not, see <http://www.gnu.org/licenses/>.
+
;;; Commentary:
;; move all the misc files created by emacs into a seperate directory to
diff --git a/dots/.config/zsh/.zshrc b/dots/.config/zsh/.zshrc
@@ -18,8 +18,9 @@ git_prompt() {
[ -z "$ref" ] || echo "%F{cyan}$ref%f "
}
kube_prompt() {
- ctx=$(kubectl config current-context 2> /dev/null)
- [ -z "$ctx" ] || echo "%F{green}$ctx%f "
+ ctx=$([ -z "$KUBECTX" ] && kubectl config current-context 2> /dev/null || echo "$KUBECTX" )
+ [ -z "$ctx" ] || echo -n "%F{green}$ctx%f "
+ [ -z "$KUBENS" ] || echo -n "%F{blue}$KUBENS%f "
}
PROMPT='%F{241}λ %2~%f $(kube_prompt)$(git_prompt)%B%F{241}»%b%f '
diff --git a/dots/.config/zsh/gcloud.zsh b/dots/.config/zsh/gcloud.zsh
@@ -1,19 +1,26 @@
-export GCLOUD_SDK="$HOME/prog/google-cloud-sdk"
+# Important shit to remember
+# gcloud auth login
+# gcloud auth applicaiton-default login
+
+# Commonly used gcloud commands
+alias g="gcloud"
-[ -f "$GCLOUD_SDK/path.zsh.inc" ] && source "$GCLOUD_SDK/path.zsh.inc"
-[ -f "$GCLOUD_SDK/completion.zsh.inc" ] && source "$GCLOUD_SDK/completion.zsh.inc"
gac() {
- cfg=$(gcloud config configurations list | awk 'NR!=-1 { print $1 }' | fzf -e)
- [ -z "$cfg" ] || gcloud config configurations activate $cfg
+ # Switch between google cloud configurations.
+ cfg=$(gcloud config configurations list | awk 'NR!=-1 { print $1 }' | fzf -e)
+ [ -z "$cfg" ] || gcloud config configurations activate $cfg
}
gssh() {
- instance=$(gcloud compute instances list | awk '/^gke/ { print $1 }' | sort | fzf)
- [ -z "$instance" ] || gcloud compute ssh $instance
+ # List out compute instances and ssh into a selected virtual
+ # machine.
+ instance=$(gcloud compute instances list | awk '/^gke/ { print $1 }' | sort | fzf)
+ [ -z "$instance" ] || gcloud compute ssh $instance
}
gsp() {
- project=$(gcloud projects list | awk 'NR!=1 { print $1 }' | sort | fzf)
- [ -z "$project" ] || gcloud config set project $project
+ # Switch which google cloud project is currently configured.
+ project=$(gcloud projects list | awk 'NR!=1 { print $1 }' | sort | fzf)
+ [ -z "$project" ] || gcloud config set project $project
}
diff --git a/dots/.config/zsh/kubernetes.zsh b/dots/.config/zsh/kubernetes.zsh
@@ -1,22 +1,39 @@
+# Load in zsh completions if they are available
+[ -f "$HOME.kube/completion.zsh.inc" ] && source "$HOME.kube/completion.zsh.inc"
+
+# Commonly used kubectl commands
alias k="kubectl"
alias kd="kubectl describe"
-alias kpw="kubectl get pods --watch"
-
-[ -f "$HOME.kube/completion.zsh.inc" ] && source "$HOME.kube/completion.zsh.inc"
+alias kpw="watch kubectl get pods"
+alias i="istioctl"
+alias ia="istioctl analyze"
+alias h="helm"
-pod() {
- kubectl get pods -l app.kubernetes.io/name=$1 -o json | jq -r '.items[0].metadata.name'
-}
kcc() {
- ctx=`kubectl config get-contexts -o name | fzf`
- kubectl config use-context $ctx
+ # Switch current kube context to $1 if provided or prompt caller to
+ # select from the available contexts in the current kube config.
+ ctx=$([ -z "$1" ] && kubectl config get-contexts -o name | fzf || printf "$1")
+ [ -z "$ctx" ] || kubectl config use-context $ctx
}
-authn() {
- istioctl authn -n qa5 tls-check $(pod recurly-app-web) | rg "HOST|qa5" --color=never
+kc() {
+ # Automatically apply the --context=$1 to each kubectl command. When
+ # no $1 is passed the env var is unset.
+ [ -z "$1" ] && unset KUBECTX || export KUBECTX="$1"
}
kn() {
- alias kubectl="kubectl -n $1"
+ # Automatically apply the --namespace=$1 to each kubectl
+ # command. When no $1 is passed the env var is unset.
+ [ -z "$1" ] && unset KUBENS || export KUBENS=$1
+}
+
+kubectl() {
+ # Override the kubectl command to automatically apply flags based on
+ # environment variables.
+ command kubectl \
+ $([ -z "$KUBENS" ] || printf "--namespace=$KUBENS") \
+ $([ -z "$KUBECTX" ] || printf "--context=$KUBECTX") \
+ $@
}
diff --git a/dots/.ssh/config b/dots/.ssh/config
@@ -1,14 +1,15 @@
Host work
- HostName 192.168.1.143
+ HostName work.margar.org
User mjf
- Port 22
Host laptop
- HostName 192.168.1.134
+ HostName laptop.margar.org
User mjf
- Port 22
Host desktop
- HostName 192.168.1.102
+ HostName desktop.margar.org
User mjf
- Port 22
+
+Host server
+ HostName mfeller.io
+ User root+
\ No newline at end of file
diff --git a/dots/.zprofile b/dots/.zprofile
@@ -9,11 +9,11 @@ export XDG_CACHE_HOME=$HOME/.cache
export PATH=$PATH:$HOME/.local/bin/
export PATH=$PATH:/usr/local/bin
-export EDITOR=nvim
-export READER=zathura
+export EDITOR=vim
export SHELL=zsh
export TERMINAL=st
export PAGER=less
+export READER=zathura
export MANWIDTH=80
export LESSHISTFILE=-
@@ -31,3 +31,12 @@ export PATH=$PATH:$HOME/.cargo/bin
export LS_COLORS="rs=0:di=36;36:ln=36;51:mh=00:pi=40;36;11:so=36;13:do=36;5:bd=48;236;36;11:cd=48;236;36;3:or=48;236;36;9:mi=01;36;41:su=48;196;36;15:sg=48;11;36;16:ca=48;196;36;226:tw=48;10;36;16:ow=48;10;36;21:st=48;21;36;15:ex=1:*.tar=36;9:*.tgz=36;9:*.arc=36;9:*.arj=36;9:*.taz=36;9:*.lha=36;9:*.lz4=36;9:*.lzh=36;9:*.lzma=36;9:*.tlz=36;9:*.txz=36;9:*.tzo=36;9:*.t7z=36;9:*.zip=36;9:*.z=36;9:*.dz=36;9:*.gz=36;9:*.lrz=36;9:*.lz=36;9:*.lzo=36;9:*.xz=36;9:*.zst=36;9:*.tzst=36;9:*.bz2=36;9:*.bz=36;9:*.tbz=36;9:*.tbz2=36;9:*.tz=36;9:*.deb=36;9:*.rpm=36;9:*.jar=36;9:*.war=36;9:*.ear=36;9:*.sar=36;9:*.rar=36;9:*.alz=36;9:*.ace=36;9:*.zoo=36;9:*.cpio=36;9:*.7z=36;9:*.rz=36;9:*.cab=36;9:*.wim=36;9:*.swm=36;9:*.dwm=36;9:*.esd=36;9:*.jpg=36;13:*.jpeg=36;13:*.mjpg=36;13:*.mjpeg=36;13:*.gif=36;13:*.bmp=36;13:*.pbm=36;13:*.pgm=36;13:*.ppm=36;13:*.tga=36;13:*.xbm=36;13:*.xpm=36;13:*.tif=36;13:*.tiff=36;13:*.png=36;13:*.svg=36;13:*.svgz=36;13:*.mng=36;13:*.pcx=36;13:*.mov=36;13:*.mpg=36;13:*.mpeg=36;13:*.m2v=36;13:*.mkv=36;13:*.webm=36;13:*.ogm=36;13:*.mp4=36;13:*.m4v=36;13:*.mp4v=36;13:*.vob=36;13:*.qt=36;13:*.nuv=36;13:*.wmv=36;13:*.asf=36;13:*.rm=36;13:*.rmvb=36;13:*.flc=36;13:*.avi=36;13:*.fli=36;13:*.flv=36;13:*.gl=36;13:*.dl=36;13:*.xcf=36;13:*.xwd=36;13:*.yuv=36;13:*.cgm=36;13:*.emf=36;13:*.ogv=36;13:*.ogx=36;13:*.aac=36;45:*.au=36;45:*.flac=36;45:*.m4a=36;45:*.mid=36;45:*.midi=36;45:*.mka=36;45:*.mp3=36;45:*.mpc=36;45:*.ogg=36;45:*.ra=36;45:*.wav=36;45:*.oga=36;45:*.opus=36;45:*.spx=36;45:*.xspf=36;45:"
export LC_ALL=C
+
+export PASH_CLIP=xclip
+export PASH_TIMEOUT=off
+
+export GNUPGHOME=$HOME/.local/share/gnupg
+
+export NOTMUCH_CONFIG=$HOME/.config/notmuch/config
+
+export BOTO_CONFIG=$HOME/.config/gcloud/boto
diff --git a/dots/.zshenv b/dots/.zshenv
@@ -14,6 +14,7 @@ export SHELL=zsh
export TERMINAL=alacritty
export PAGER=less
+
export MANWIDTH=80
export LESSHISTFILE=-
export HISTFILE=$XDG_CACHE_HOME/bash_history