Compare commits
72 Commits
b5e1d7c411
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f89791d7ff | |||
| 4ee8c17fad | |||
| 0f6197f4e2 | |||
| c822db6021 | |||
| 9bc911a665 | |||
| edeb664f73 | |||
| 3b454065ae | |||
| dab4201158 | |||
| 906b218136 | |||
| e29003e594 | |||
| ed94e2047a | |||
| 0e9151390b | |||
| 59db8935ca | |||
| 2ee44c4120 | |||
| edd55b23fa | |||
| ff721a399e | |||
| 195b032b05 | |||
| 3c82eca615 | |||
| 7ce4beaa61 | |||
| 8f49df5fb1 | |||
| 1a0f8d5d0c | |||
| ad0ff1e15e | |||
| 743ea12eea | |||
| c02c6ef3c9 | |||
| 1697c94dd9 | |||
| cde4685bb0 | |||
| f5fae9ef1c | |||
| a1c2bcafac | |||
| c43b1467eb | |||
| 823adda10c | |||
| 127f07ae1f | |||
| aa9fb4548b | |||
| 4f94a072e3 | |||
| 41456ca499 | |||
| 15483e4e0f | |||
| 52e766899f | |||
| 918fc0c638 | |||
| a8eeedf9d5 | |||
| e04a92cfd0 | |||
| 4cec5bf337 | |||
| 6250dcfa89 | |||
| 444363d6ef | |||
| f20ce37c15 | |||
| 06c81ee085 | |||
| 758892595d | |||
| 785ea21020 | |||
| cc4cec8609 | |||
| b7a5f97bf7 | |||
| 220728d9ec | |||
| ad69f2d36f | |||
| 8d9a9066e2 | |||
| e9dd5e4a7c | |||
| 58d213c5f0 | |||
| 0a9ccb9a7f | |||
| 21132c2062 | |||
| 8e38e0c7dd | |||
| 1d4fc8d8aa | |||
| 4eef245d6b | |||
| 2464f92cfe | |||
| b5fb0add24 | |||
| e4f12c16b5 | |||
| 7be5292542 | |||
| c1763ba31e | |||
| 496a93080c | |||
| efa71ca473 | |||
| ccda8a92f9 | |||
| d23c310454 | |||
| 4ccfa0f8d5 | |||
| c725c67bbb | |||
| 7efa1984c2 | |||
| 48cca56e6c | |||
| 99999fbdc3 |
169
.bashrc
169
.bashrc
@ -1,50 +1,61 @@
|
||||
# ==============================================================================
|
||||
# Personal $HOME/.bashrc file by James Blair <mail@jamesblair.net>
|
||||
# ==============================================================================
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[ -z "$PS1" ] && return
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# Don't put duplicate lines or lines starting with space in the history.
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
# also ensure we write to history immediately instead of only on terminal close
|
||||
# Append to the history file, don't overwrite it
|
||||
# Also ensure we write to history immediately instead of only on terminal close
|
||||
shopt -s histappend
|
||||
export PROMPT_COMMAND="history -a; history -n"
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=10000
|
||||
HISTFILESIZE=20000
|
||||
# Retain infinite bash history
|
||||
HISTSIZE=-1
|
||||
HISTFILESIZE=-1
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# Check the window size after each command and, if necessary
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls -l --color=auto -h --group-directories-first'
|
||||
alias ll='ls -l --color=auto -h --group-directories-first'
|
||||
# Alias ls to eza
|
||||
if [ "$(command -v eza)" ]; then
|
||||
alias ll='eza -l --icons=auto --group-directories-first'
|
||||
alias ls='eza -l --icons=auto --group-directories-first'
|
||||
fi
|
||||
|
||||
# Alias cat to bat
|
||||
if [ "$(command -v bat)" ]; then
|
||||
alias cat='bat --style=plain --pager=never' 2>/dev/null
|
||||
fi
|
||||
|
||||
# Alias docker to podman
|
||||
alias docker=podman
|
||||
|
||||
# Custom git alias for pushing to all remotes at once
|
||||
alias gpa='git remote | xargs -L1 git push --all'
|
||||
# Alias df to dysk
|
||||
if [ "$(command -v bat)" ]; then
|
||||
alias df=dysk
|
||||
fi
|
||||
|
||||
# simplify bitwarden cli usage
|
||||
# Simplify bitwarden cli usage
|
||||
cpcmd="xclip -selection c"; if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then cpcmd="wl-copy"; fi
|
||||
alias bwu='export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)'
|
||||
|
||||
function bwgp () {
|
||||
local test=$(export BW_SESSION=~/.bw_session) && bw get password "$1" | $cpcmd;
|
||||
|
||||
# If the login has a totp associated we should leave a follow-up prompt for it
|
||||
if totp=$(bw get totp "$1"); then
|
||||
read -p "Press enter when ready for totp"
|
||||
echo "${totp}" | $cpcmd
|
||||
# Retrieve full json
|
||||
local test
|
||||
test=$(eval $(export BW_SESSION=~/.bw_session) && bw get item "${1}");
|
||||
|
||||
# Update clipboard with initial value
|
||||
echo ${test} | jq -r '.login.password' | "${cpcmd}"
|
||||
|
||||
# Check if a totp is associated
|
||||
if [ $(echo ${test} | jq -r .login.totp) != "null" ]; then
|
||||
|
||||
# Retrieve totp in background
|
||||
exec 3< <(echo $(bw get totp "${1}"))
|
||||
read -r -p "Press enter when ready for totp"
|
||||
read -r <&3 line && echo "${line}" | "${cpcmd}"
|
||||
fi
|
||||
}
|
||||
function bwgt () { local test=$(export BW_SESSION=~/.bw_session) && bw get totp "$1" | $cpcmd; }
|
||||
@ -79,57 +90,7 @@ function bwai () {
|
||||
bw encode | bw create item && bw sync
|
||||
}
|
||||
|
||||
# custom git credential cache implementation for bitwarden
|
||||
# https://github.com/bitwarden/cli/blob/master/examples/git-credential-bw.sh
|
||||
function bw_gitea () {
|
||||
declare -A params
|
||||
|
||||
if [[ "$1" == "get" ]]; then
|
||||
read -r line
|
||||
while [ -n "$line" ]; do
|
||||
key=${line%%=*}
|
||||
value=${line#*=}
|
||||
params[$key]=$value
|
||||
read -r line
|
||||
done
|
||||
|
||||
if [[ "${params['protocol']}" != "https" ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -z "${params["host"]}" ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if ! bw list items --search "asdf" > /dev/null 2>&1; then
|
||||
echo "Please login to Bitwarden to use git credential helper" > /dev/stderr
|
||||
exit
|
||||
fi
|
||||
|
||||
id=$(bw list items --search "${params["host"]}"|jq ".[] | select(.name == \"${params["host"]}\").id" -r)
|
||||
|
||||
if [[ -z "$id" ]]; then
|
||||
echo "Couldn't find item id in Bitwarden DB." > /dev/stderr
|
||||
echo "${params}"
|
||||
exit
|
||||
fi
|
||||
|
||||
user=$(bw get username "${id}")
|
||||
pass=$(bw get password "${id}")
|
||||
|
||||
if [[ -z "$user" ]] || [[ -z "$pass" ]]; then
|
||||
echo "Couldn't find host in Bitwarden DB." > /dev/stderr
|
||||
exit
|
||||
fi
|
||||
|
||||
echo username="$user"
|
||||
echo password="$pass"
|
||||
fi
|
||||
}
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
# Enable programmable completion features
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
@ -145,7 +106,6 @@ eval "$(fzf --bash)"
|
||||
# Configure emacs location and aliases
|
||||
export PATH=$PATH:/home/james/.config/emacs/bin/
|
||||
alias emacs="emacsclient -nw -a 'doom run --bg-daemon && emacsclient -nw'"
|
||||
alias nano="emacsclient -nw -a 'doom run --bg-daemon' && emacsclient -nw"
|
||||
|
||||
function e {
|
||||
|
||||
@ -161,26 +121,22 @@ function e {
|
||||
# Configure go location
|
||||
export PATH=$PATH:/var/home/james/go/bin
|
||||
|
||||
# Setup prompt
|
||||
function color_my_prompt {
|
||||
local __user_and_host="\[\033[01;32m\]\u@\h"
|
||||
local __cur_location="\[\032[01;34m\]\w"
|
||||
local __git_branch_color="\[\033[31m\]"
|
||||
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
|
||||
local __prompt_tail="\[\033[35m\]$"
|
||||
local __last_color="\[\033[00m\]"
|
||||
export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color "
|
||||
}
|
||||
|
||||
color_my_prompt
|
||||
|
||||
# Configure ssh-agent
|
||||
# If ssh-agent is not already running
|
||||
if [ -z "$(pgrep ssh-agent)" ]; then
|
||||
rm -rf /tmp/ssh-*
|
||||
|
||||
# Cleanup any old ssh directory from tmp
|
||||
if [ -d "/tmp/ssh" ]; then
|
||||
rm --recursive --force /tmp/ssh-*
|
||||
fi
|
||||
|
||||
# Start ssh-agent and set pid + auth sock
|
||||
eval $(ssh-agent -s) > /dev/null
|
||||
else
|
||||
# Set pid + auth sock to ensure existing ssh-agent will be re-used
|
||||
export SSH_AGENT_PID=$(pgrep ssh-agent)
|
||||
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
|
||||
if [ -d "/tmp/ssh" ]; then
|
||||
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
|
||||
fi
|
||||
fi
|
||||
|
||||
# If ssh-agent has no identities, add mine
|
||||
@ -188,25 +144,32 @@ ssh-add -l &>/dev/null
|
||||
if [ "$?" == 1 ]; then ssh-add ~/.ssh/$USER; fi
|
||||
|
||||
# Remove bitwarden sessions older than a day
|
||||
if [[ $(find ~/.bw_session -mtime +1 -print) ]]; then rm ~/.bw_session; fi
|
||||
if [ -f ~/.bw_session ] && [[ $(find ~/.bw_session -mtime +1 -print) ]]; then rm ~/.bw_session; fi
|
||||
|
||||
# If bitwarden session already set don't overwrite
|
||||
if [ -n "$BW_SESSION" ]; then echo "Bitwarden set";
|
||||
|
||||
# Else if there is a session file set from there
|
||||
elif [ -f ~/.bw_session ]; then export BW_SESSION=$(cat ~/.bw_session);
|
||||
# If we have a bitwarden session file available set from it
|
||||
if [ -f ~/.bw_session ]; then export BW_SESSION=$(cat ~/.bw_session);
|
||||
|
||||
# Otherwise unlock to start new session
|
||||
else bwu; fi
|
||||
elif [ -z "$BW_SESSION" ]; then bwu; fi
|
||||
|
||||
# Try connect to my default tmux socket
|
||||
if ! tmux -S /tmp/default.tmux attach; then
|
||||
tmux -S /tmp/default.tmux new-session -s default -n default -d
|
||||
tmux -S /tmp/default.tmux attach
|
||||
if [ -z "$TMUX" ]; then
|
||||
if ! tmux -S /tmp/default.tmux attach; then
|
||||
tmux -S /tmp/default.tmux new-session -s default -n default -d
|
||||
tmux -S /tmp/default.tmux attach
|
||||
fi
|
||||
fi
|
||||
|
||||
# Helper functions for bluetooth
|
||||
alias bthsc="bluetoothctl connect CC:98:8B:B6:F0:8E"
|
||||
alias bthsd="bluetoothctl disconnect CC:98:8B:B6:F0:8E"
|
||||
|
||||
# Add kubectl krew plugins to path
|
||||
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||
|
||||
# Enable simple bash prompt
|
||||
SBP_PATH=/home/james/Downloads/sbp
|
||||
source /home/james/Downloads/sbp/sbp.bash
|
||||
export NODE_OPTIONS="--no-deprecation"
|
||||
|
||||
# The next line updates PATH for the Google Cloud SDK.
|
||||
if [ -f '/var/home/james/.var/bin/google-cloud-sdk/path.bash.inc' ]; then . '/var/home/james/.var/bin/google-cloud-sdk/path.bash.inc'; fi
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[user]
|
||||
email = mail@jamesblair.net
|
||||
name = James Blair
|
||||
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC2t1GmNmhoV2WvrA5dKS9nhLlBExD949coqQnYnqvgQ7l+ODRXxifg8wcnp7PXTcs6CW3tlwA6W5LWMK5gtjNXfZH9jpMPD2m1p7koysoYmC2eMWREF+IN4dS1MsaL9VU1WrqolP3qbvI2WWmECrzA0xakDhAZXuIzl3HRng1YeQV8gi8YoG9Jm0ZXd+RMqxBGyUw1+O4o1NfFwQ9dIUNFRyUScl/yzQv0AfXqOi2IrdA5IpdtlpAZsD1cnB3kUFlluxaqCuXQKGO1wPo3wTh2Po+upCyMi2XXCakVXgRaIuBLvmZPYVMYlwbbDL0dMexhc+pccgJ3sE0JDzm1+oe2uY9pIIsnfrD6fzjN+JO0rbGtrWpERf0amIzJFj4i7zvPk4eY7OskYSInf7Qj5He8eLv0VBBxQc2ikDTPQtS/cIomLXA1tAsA1dqHNl438AHG4r4NaPNDAoRUql3BOYEZjyza5eV8b26Yw3s/x64g4oc0Zhoc6/UB7zmbou0a1w+oC1qXloJIYnYb6ntiaZKt5HLuUUP7V0WIMRco35Rt1NtaKKwqmo7z40VwvYPWTtaNwm3GFmMi9E603TudzuJB+katlfROXFOI/8Ks5S1juFAMcI+KVo0Ndl0G9iYRbZyrHB+HdxS1HVaWn4CTy9WCvQBHWB/cr1dnjVviqAZ0iw== james@james-ultrabook
|
||||
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsYhu2xE5cxq+sA7bNyHjZUk9IHKXHsd58ZCFLfCHbK5nnWLgJwxFnF1NzBylyOJviJ2v54VYQoXvsWLTbehlyH/kqJS8icmo0iu2mUFcp09n/3NcGw2BJefwMbK+mofxBBR78RRNI8DG3yk7Apa19BrLpFWaL/VljGidgR61WhPH7FbXjTh5NuQR494LG3yBRn16yIPNN+xZhf0TW7uoVCiSr77kFELgrTqjpPyoYiYLZZdKqJZ7PDgOEcLq5oDEZfYME8sGRPyufGByH7tnK9fgFaZ9wW747wTNN2naUIhCNzJLxKgr8fMMRBXuqeUjk+5/EzxGFXjxE+4a+dhD51OO5mSN1ctG/061HIQjJwZ2Zk6CACypBEv6nLVREaMqKQtcEPPooZ2SK4SdiMtwC8XLCZ6wRQDVskMentI1uy3bbCwV9AG0auiLA3sfbyKI8093p5NLsLEiR+BScu4/tLx7kzPetl89QOKzTI60GXzBaSnBXhAtQTijZZFrOGbQ1NQ1deWb6pT8foOPOs3P2F0a4Y/nY/xlomBuNqTI48Vi8MZJjhTvAe8BF+Y7C8HlSaCZeH1DrnymkbLhpXvVH7Tuir/DLOyhrwnXqNuxpMyWsfy5UrTfe67GP2+jzriFxteTMbvZjmgbF2UDMYs5U59NaYPdAYxjwdzH5nHoIWw== james@james-desktop
|
||||
|
||||
[pull]
|
||||
rebase = true
|
||||
@ -18,6 +18,10 @@
|
||||
[credential]
|
||||
helper = cache --timeout=21600
|
||||
|
||||
[credential "https://gitea.jamma.life"]
|
||||
username = "!f() { test \"$1\" = get && echo \"password=$(NODE_OPTIONS=\"--no-deprecation\" bw get username gitea)\"; }; f"
|
||||
helper = "!f() { test \"$1\" = get && echo \"password=$(NODE_OPTIONS=\"--no-deprecation\" bw get item gitea | jq '.fields[0].value' -r)\"; }; f"
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(evil-want-Y-yank-to-eol nil)
|
||||
'(package-selected-packages
|
||||
'(typescript-mode import-js grizzl add-node-modules-path simpleclip yasnippet-snippets yapfify yaml-mode xterm-color ws-butler writeroom-mode visual-fill-column winum web-mode web-beautify vterm volatile-highlights vi-tilde-fringe uuidgen unfill undo-tree treemacs-projectile treemacs-persp treemacs-magit treemacs-icons-dired treemacs-evil toc-org terminal-here tagedit symon symbol-overlay string-inflection sql-indent spaceline-all-the-icons memoize all-the-icons spaceline powerline smeargle slim-mode shell-pop seeing-is-believing scss-mode sass-mode rvm ruby-tools ruby-test-mode ruby-refactor ruby-hash-syntax rubocopfmt rubocop rspec-mode robe reveal-in-osx-finder restart-emacs rbenv rake rainbow-delimiters pytest pyenv-mode py-isort pug-mode prettier-js popwin pippel pipenv pyvenv pip-requirements persp-mode password-generator paradox ox-twbs ox-gfm ox-epub overseer osx-trash osx-clipboard orgit org-superstar org-re-reveal org-protocol-capture-html org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download org-cliplink org-brain open-junk-file ob-sql-mode ob-go ob-async nodejs-repl nameless mwim multi-term move-text mmm-mode minitest markdown-toc magit-svn magit-gitflow magit macrostep lsp-ui lsp-treemacs treemacs cfrs pfuture posframe lsp-python-ms lorem-ipsum livid-mode skewer-mode live-py-mode link-hint launchctl kubernetes-tramp kubernetes-evil kubernetes magit-popup magit-section json-reformat json-navigator hierarchy js2-refactor multiple-cursors js2-mode js-doc indent-guide importmagic epc ctable concurrent deferred impatient-mode simple-httpd hungry-delete htmlize hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-xref helm-themes helm-swoop helm-pydoc helm-purpose window-purpose imenu-list helm-projectile helm-org-rifle helm-org helm-mode-manager helm-make helm-lsp lsp-mode eldoc markdown-mode helm-ls-git helm-gitignore request helm-git-grep helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag haml-mode google-translate golden-ratio godoctor go-tag go-rename go-impl go-guru go-gen-test go-fill-struct go-eldoc gnuplot gitignore-templates git-timemachine git-messenger git-link git-commit with-editor gh-md fuzzy flycheck-pos-tip pos-tip flycheck-package package-lint let-alist flycheck-elsa flycheck pkg-info epl flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-org evil-numbers evil-nerd-commenter evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-cleverparens smartparens evil-args evil-anzu anzu eshell-z eshell-prompt-extras esh-help emr iedit clang-format projectile paredit list-utils emmet-mode elisp-slime-nav editorconfig nadvice dumb-jump dockerfile-mode docker transient tablist json-mode docker-tramp json-snatcher devdocs define-word cython-mode csv-mode company-web web-completion-data company-terraform terraform-mode hcl-mode company-lua lua-mode company-go go-mode company-anaconda company column-enforce-mode clojure-snippets clean-aindent-mode cider-eval-sexp-fu eval-sexp-fu cider sesman seq spinner queue parseedn clojure-mode map parseclj chruby centered-cursor-mode bundler inf-ruby blacken auto-yasnippet yasnippet auto-highlight-symbol ht auto-compile packed anaconda-mode pythonic f dash s aggressive-indent ace-window ace-link ace-jump-helm-line helm avy helm-core ac-ispell auto-complete popup which-key use-package pcre2el org-plus-contrib hydra lv hybrid-mode font-lock+ evil goto-chg dotenv-mode diminish bind-map bind-key async)))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(highlight-parentheses-highlight ((nil (:weight ultra-bold))) t))
|
||||
(set-face-background 'default "undefined")
|
||||
(add-hook 'text-mode-hook 'visual-line-mode)
|
||||
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||
|
||||
;; Prevent undo tree files from polluting your git repo
|
||||
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))
|
||||
|
||||
;; Fix annoying indentation with shell script src blocks in org-mode
|
||||
(setq org-edit-src-content-indentation 0)
|
||||
|
||||
;; Change indentation of org-mode headline tags to left
|
||||
(setq org-tags-column 0)
|
||||
|
||||
;; Custom keybind for yank because my 60% keyboard doesn't have an insert key
|
||||
(setq x-select-enable-clipboard t)
|
||||
(global-set-key (kbd "C-c w") 'clipboard-kill-ring-save)
|
||||
(global-set-key (kbd "C-c v") 'clipboard-yank)
|
||||
12
.kuberc
Normal file
12
.kuberc
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
apiVersion: kubectl.config.k8s.io/v1alpha1
|
||||
kind: Preference
|
||||
overrides:
|
||||
- command: apply
|
||||
flags:
|
||||
- name: server-side
|
||||
default: "true"
|
||||
- command: delete
|
||||
flags:
|
||||
- name: interactive
|
||||
default: "true"
|
||||
5
.markdownlintrc
Normal file
5
.markdownlintrc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"default": true,
|
||||
"MD013": false,
|
||||
"whitespace": false
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -collapse_br_tags -dump %s; nametemplate=%s.html; copiousoutput
|
||||
application/pdf; firefox %s
|
||||
application/pdf; xdg-open %s & sleep 4
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice %s
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice --nologo %s; nametemplate=%s.docx; test=test -n "$DISPLAY"
|
||||
# application/vnd.openxmlformats-officedocument.wordprocessingml.document; pandoc --from=docx --to=plain %s | cat --squeeze-blank; nametemplate=%s.docx; copiousoutput
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.template; libreoffice --nologo %s; nametemplate=%s.docm; test=test -n "$DISPLAY"
|
||||
image/jpeg; display '%s'; test=test -n "$DISPLAY"
|
||||
image/png; display '%s'; test=test -n "$DISPLAY"
|
||||
|
||||
52
.muttrc
52
.muttrc
@ -5,7 +5,7 @@ set imap_user=`bw get username hosted`
|
||||
set imap_pass=`bw get password hosted`
|
||||
|
||||
# This is the remote server and folder (optional)
|
||||
set folder=imaps://mail.jamesblair.net
|
||||
set folder=imaps://imap.dreamhost.com
|
||||
|
||||
# This is the folder your mail arrives into
|
||||
set spoolfile=+INBOX
|
||||
@ -24,12 +24,13 @@ set realname='James Blair'
|
||||
set header_cache="~/.mutt/cache/headers"
|
||||
set message_cachedir="~/.mutt/cache/bodies"
|
||||
set certificate_file="~/.mutt/certificates"
|
||||
set smtp_url="smtp://`bw get username hosted`@mail.jamesblair.net:587/"
|
||||
set smtp_url="smtp://`bw get username hosted`@smtp.dreamhost.com:587/"
|
||||
set smtp_pass=`bw get password hosted`
|
||||
set move=no
|
||||
set imap_keepalive=900
|
||||
set postponed="=INBOX.Drafts"
|
||||
set record="=INBOX.Sent"
|
||||
set sort=date-received
|
||||
unset imap_passive
|
||||
|
||||
macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
|
||||
@ -54,4 +55,49 @@ bind index,pager \Co sidebar-open
|
||||
# Configure html emails
|
||||
alternative_order text/plain text/html
|
||||
auto_view text/html
|
||||
set mailcap_path = ~/.mutt/mailcap
|
||||
set mailcap_path = ~/.muttmailcap
|
||||
|
||||
# Always include messages when replying
|
||||
set include
|
||||
|
||||
#================================================================
|
||||
# Dracula theme colors
|
||||
#================================================================
|
||||
# general ------------ foreground ---- background -----------------------------
|
||||
color error color231 color212
|
||||
color indicator color231 color241
|
||||
color markers color210 default
|
||||
color message default default
|
||||
color normal default default
|
||||
color prompt default default
|
||||
color search color84 default
|
||||
color status color141 color236
|
||||
color tilde color231 default
|
||||
color tree color141 default
|
||||
|
||||
# message index ------ foreground ---- background -----------------------------
|
||||
color index color210 default ~D # deleted messages
|
||||
color index color84 default ~F # flagged messages
|
||||
color index color117 default ~N # new messages
|
||||
color index color212 default ~Q # messages which have been replied to
|
||||
color index color215 default ~T # tagged messages
|
||||
color index color141 default ~v # messages part of a collapsed thread
|
||||
|
||||
# message headers ---- foreground ---- background -----------------------------
|
||||
color hdrdefault color117 default
|
||||
color header color231 default ^Subject:.*
|
||||
|
||||
# message body ------- foreground ---- background -----------------------------
|
||||
color attachment color228 default
|
||||
color body color231 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses
|
||||
color body color228 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs
|
||||
color body color231 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text
|
||||
color body color231 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text
|
||||
color body color231 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text
|
||||
color quoted color61 default
|
||||
color quoted1 color117 default
|
||||
color quoted2 color84 default
|
||||
color quoted3 color215 default
|
||||
color quoted4 color212 default
|
||||
color signature color212 default
|
||||
#================================================================
|
||||
|
||||
@ -13,7 +13,13 @@ set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'dracula/tmux'
|
||||
|
||||
# Make dracula theme more minimal
|
||||
set -g @dracula-plugins " "
|
||||
set -g @dracula-plugins "cpu-usage gpu-usage ram-usage"
|
||||
set -g @dracula-cpu-usage-colors "grey dark_gray"
|
||||
set -g @dracula-ram-usage-colors "grey dark_gray"
|
||||
set -g @dracula-gpu-usage-colors "grey dark_gray"
|
||||
|
||||
|
||||
set -g @dracula-show-powerline true
|
||||
|
||||
# Initialise tpm
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
30
Brewfile
30
Brewfile
@ -1,33 +1,57 @@
|
||||
tap "homebrew/bundle"
|
||||
brew "atuin"
|
||||
brew "awscli"
|
||||
brew "azure-cli"
|
||||
brew "bat"
|
||||
brew "node"
|
||||
brew "bitwarden-cli"
|
||||
brew "btop"
|
||||
brew "cekit"
|
||||
brew "cloudflared"
|
||||
brew "pcre2"
|
||||
brew "dict"
|
||||
brew "direnv"
|
||||
brew "dysk"
|
||||
brew "emacs"
|
||||
brew "eza"
|
||||
brew "fd"
|
||||
brew "fzf"
|
||||
brew "gcc"
|
||||
brew "gh"
|
||||
brew "git-absorb"
|
||||
brew "git-lfs"
|
||||
brew "glab"
|
||||
brew "pcre2"
|
||||
brew "go"
|
||||
brew "go@1.21", link: true
|
||||
brew "go@1.24"
|
||||
brew "golangci-lint"
|
||||
brew "goreman"
|
||||
brew "govulncheck"
|
||||
brew "gpgme"
|
||||
brew "helm"
|
||||
brew "kind"
|
||||
brew "kn"
|
||||
brew "kubernetes-cli"
|
||||
brew "krew"
|
||||
brew "kubetail"
|
||||
brew "kwok"
|
||||
brew "lynx"
|
||||
brew "markdownlint-cli"
|
||||
brew "markdownlint-cli2"
|
||||
brew "mutt"
|
||||
brew "nmap"
|
||||
brew "npm-check-updates"
|
||||
brew "ocm"
|
||||
brew "openshift-cli"
|
||||
brew "pcre"
|
||||
brew "podman-compose"
|
||||
brew "ripgrep"
|
||||
brew "rosa-cli"
|
||||
brew "roxctl"
|
||||
brew "screenfetch"
|
||||
brew "shellcheck"
|
||||
brew "sshfs"
|
||||
brew "ugrep"
|
||||
brew "urlscan"
|
||||
brew "virtctl"
|
||||
brew "yamlfmt"
|
||||
brew "yamllint"
|
||||
brew "yq"
|
||||
|
||||
17
Flatfile
Normal file
17
Flatfile
Normal file
@ -0,0 +1,17 @@
|
||||
flathub app.zen_browser.zen
|
||||
flathub com.calibre_ebook.calibre
|
||||
flathub com.transmissionbt.Transmission
|
||||
flathub com.valvesoftware.Steam
|
||||
flathub io.github.flattool.Warehouse
|
||||
flathub io.github.ungoogled_software.ungoogled_chromium
|
||||
flathub io.github.ungoogled_software.ungoogled_chromium.Codecs
|
||||
flathub io.podman_desktop.PodmanDesktop
|
||||
flathub org.gimp.GIMP
|
||||
flathub org.kde.kdenlive
|
||||
flathub com.obsproject.Studio
|
||||
flathub org.fedoraproject.MediaWriter
|
||||
flathub app.polychromatic.controller
|
||||
flathub org.videolan.VLC
|
||||
flathub com.thincast.client
|
||||
flathub org.raspberrypi.rpi-imager
|
||||
flathub one.flipperzero.qFlipper
|
||||
@ -1,14 +0,0 @@
|
||||
#+TITLE: Fairphone setup
|
||||
#+AUTHOR: James Blair
|
||||
#+EMAIL: mail@jamesblair.net
|
||||
#+DATE: <2023-11-03 Fri 16:45>
|
||||
|
||||
|
||||
Below are the steps I follow post standard installation of [[https://ubuntu-touch.io][ubuntu touch]] on my [[https://en.wikipedia.org/wiki/Fairphone_4][Fairphone 4]].
|
||||
|
||||
I've been using the fairphone 4 as a daily driver since April 2023, most recently with Ubuntu Touch.
|
||||
|
||||
|
||||
* Downgrade prior to installation
|
||||
|
||||
After initially purchasing the fairphone, while it was running android I had upgraded to android 12. Unfortunately the ubuntu touch installer is not fully working with Android 12 so I had to downgrade the phone to Android 11 by reinstalling a stock image before proceeding with the ubuntu touch installation.
|
||||
@ -1,142 +0,0 @@
|
||||
{
|
||||
"policy": {
|
||||
"DEFAULT": {
|
||||
"capabilities": [
|
||||
"frame",
|
||||
"fetch",
|
||||
"noscript",
|
||||
"other",
|
||||
"media"
|
||||
],
|
||||
"temp": false
|
||||
},
|
||||
"TRUSTED": {
|
||||
"capabilities": [
|
||||
"script",
|
||||
"object",
|
||||
"media",
|
||||
"frame",
|
||||
"font",
|
||||
"webgl",
|
||||
"fetch",
|
||||
"ping",
|
||||
"noscript",
|
||||
"unchecked_css",
|
||||
"lan",
|
||||
"other"
|
||||
],
|
||||
"temp": false
|
||||
},
|
||||
"UNTRUSTED": {
|
||||
"capabilities": [],
|
||||
"temp": false
|
||||
},
|
||||
"sites": {
|
||||
"trusted": [
|
||||
"§:addons.mozilla.org",
|
||||
"§:ajax.aspnetcdn.com",
|
||||
"§:ajax.googleapis.com",
|
||||
"§:bootstrapcdn.com",
|
||||
"§:code.jquery.com",
|
||||
"§:google.com",
|
||||
"§:googlevideo.com",
|
||||
"§:gstatic.com",
|
||||
"§:maps.googleapis.com",
|
||||
"§:mozilla.net",
|
||||
"§:noscript.net",
|
||||
"§:paypal.com",
|
||||
"§:paypalobjects.com",
|
||||
"§:yimg.com",
|
||||
"§:youtube.com",
|
||||
"§:ytimg.com",
|
||||
"§:jamma.life",
|
||||
"§:github.com",
|
||||
"§:githubassets.com",
|
||||
"§:dreamhost.com",
|
||||
"§:redhat.com",
|
||||
"§:statuspage.io",
|
||||
"§:southerncross.co.nz",
|
||||
"§:azure.com",
|
||||
"§:stripe.com",
|
||||
"§:b2clogin.com",
|
||||
"§:farmlands.co.nz",
|
||||
"§:dynamics365commerce.ms",
|
||||
"§:amazon.com",
|
||||
"§:awsstatic.com",
|
||||
"§:k8s.io",
|
||||
"§:googleusercontent.com",
|
||||
"§:windy.com",
|
||||
"§:sharesies.nz",
|
||||
"§:slack.com",
|
||||
"§:slack-edge.com",
|
||||
"§:tsbbank.co.nz",
|
||||
"§:kiwibank.co.nz",
|
||||
"§:linuxfoundation.org",
|
||||
"§:cvent.com",
|
||||
"§:cvent-assets.com",
|
||||
"§:airnewzealand.com",
|
||||
"§:airnewzealand.co.nz",
|
||||
"§:airpointsstore.co.nz",
|
||||
"§:reddit.com",
|
||||
"§:redditstatic.com",
|
||||
"§:cve.org",
|
||||
"§:aquasec.com",
|
||||
"§:nist.gov",
|
||||
"§:cvefeed.io",
|
||||
"§:mitre10.co.nz",
|
||||
"§:cloudflare.com",
|
||||
"§:jamma.dev",
|
||||
"§:powershop.co.nz",
|
||||
"§:flux.app",
|
||||
"§:nzfarmsource.co.nz",
|
||||
"§:primehort.co.nz",
|
||||
"§:myworkday.com",
|
||||
"§:opentlc.com",
|
||||
"§:openshift.net",
|
||||
"§:jmhbnz.github.io",
|
||||
"§:redhatworkshops.io",
|
||||
"§:bunnings.co.nz",
|
||||
"§:openshiftapps.com",
|
||||
"§:westpac.co.nz",
|
||||
"§:kapiticoast.govt.nz",
|
||||
"§:discord.com",
|
||||
"§:farmlandspro.co.nz",
|
||||
"§:hnry.io",
|
||||
"§:trademe.co.nz",
|
||||
"§:bitwarden.com",
|
||||
"§:one.nz",
|
||||
"§:vodafone.co.nz",
|
||||
"§:cncf.io",
|
||||
"§:openshift.com",
|
||||
"§:force.com"
|
||||
],
|
||||
"untrusted": [],
|
||||
"custom": {}
|
||||
},
|
||||
"enforced": true,
|
||||
"autoAllowTop": false
|
||||
},
|
||||
"local": {
|
||||
"debug": false,
|
||||
"showCtxMenuItem": true,
|
||||
"showCountBadge": true,
|
||||
"showFullAddresses": false,
|
||||
"showProbePlaceholders": true,
|
||||
"amnesticUpdates": false,
|
||||
"storage": "local",
|
||||
},
|
||||
"sync": {
|
||||
"global": false,
|
||||
"xss": true,
|
||||
"TabGuardMode": "incognito",
|
||||
"TabGuardPrompt": "post",
|
||||
"cascadeRestrictions": false,
|
||||
"overrideTorBrowserPolicy": false,
|
||||
"storage": "sync"
|
||||
},
|
||||
"xssUserChoices": {
|
||||
"https://mail.google.com>https://www.youtube.com": "allow",
|
||||
"https://drive.google.com>https://youtube.googleapis.com": "allow",
|
||||
"https://auth.redhat.com>https://sso.online.tableau.com": "allow"
|
||||
}
|
||||
}
|
||||
10
readme.org
10
readme.org
@ -8,7 +8,7 @@ This document captures my standard tooling for future replication and aims to ma
|
||||
|
||||
For the purposes of this repository I broadly refer to tooling as the "standard" way my devices are configured and which things are installed that are non-standard to the operating system.
|
||||
|
||||
The environment is based on [[https://pop.system76.com/][Pop!_OS]] ~22.04 LTS~ for my primary work device which is a 2021 Razer Blade 14". Additionally a subdirectory is included for my smartphone which is a [[https://en.wikipedia.org/wiki/Fairphone_4][Fairphone 4]] running [[https://en.wikipedia.org/wiki/Ubuntu_Touch][Ubuntu Touch]].
|
||||
The environment is based on [[https://projectbluefin.io/][Bluefin]] for my primary work device which is a 2021 Razer Blade 14".
|
||||
|
||||
|
||||
* How I get things done
|
||||
@ -18,14 +18,14 @@ Before diving into the technical details, below is a brief summary of how I get
|
||||
|
||||
** Code editing
|
||||
|
||||
For an editor I primarily rely on [[https://www.gnu.org/software/emacs/][emacs]], specifically [[https://github.com/doomemacs/doomemacs][doom emacs]].
|
||||
For an editor I primarily rely on [[https://www.gnu.org/software/emacs/][emacs]], specifically [[https://github.com/doomemacs/doomemacs][doom emacs]], running within a terminal.
|
||||
|
||||
The main feature that I rely on in emacs is [[https://orgmode.org/][org-mode]]. This allows me to do literate programming, writing my documenation with embedded code blocks that are actually executable or exportable via [[https://orgmode.org/worg/org-contrib/babel/intro.html][babel]].
|
||||
The main feature that I rely on in emacs is [[https://orgmode.org/][org-mode]]. This allows me to do literate programming, writing my documentation with embedded code blocks that are actually executable or exportable via [[https://orgmode.org/worg/org-contrib/babel/intro.html][babel]].
|
||||
|
||||
|
||||
** Browsing the web
|
||||
|
||||
My primary browser is [[https://www.mozilla.org/en-GB/firefox/new/][firefox]]. Over the years various extensions have come and gone but [[https://github.com/gorhill/uBlock][u-block origin]] has remained a constant and something I use everywhere. Currently I also have [[https://addons.mozilla.org/en-US/firefox/addon/darkreader/][dark reader]] installed to make working in low light situations less harsh.
|
||||
My primary browser is [[https://zen-browser.app][zen]], a fork of firefox. Over the years various extensions have come and gone but [[https://github.com/gorhill/uBlock][u-block origin]] has remained a constant and something I use everywhere. Currently I also have [[https://addons.mozilla.org/en-US/firefox/addon/darkreader/][dark reader]] installed to make working in low light situations less harsh.
|
||||
|
||||
For monitoring traffic, blocking connections, enforcing secure dns and routing connections through other servers vpn style I rely on [[https://safing.io/portmaster/][portmaster]] + [[https://safing.io/spn/][spn]].
|
||||
|
||||
@ -43,6 +43,6 @@ The thing I like most about mutt is the caching which means I can traverse or sc
|
||||
|
||||
[[https://bitwarden.com/][Bitwarden]] is my secrets manager of choice. Primarily due to the emphasis they place on open source and excellent ~bw~ cli utility. Use of the bitwarden cli is incorporated into many of my workflows.
|
||||
|
||||
One of the things I really like and use daily is leveraging bitwarden for my one time passwords. I can run something like ~bw get totp <thing> | xclip~ in a terminal and have a two factor auth code copied straight onto my clipboard ready to paste where it is required.
|
||||
One of the things I really like and use daily is leveraging bitwarden for my one time passwords. I can run something like ~bw get totp <thing> | wl-copy~ in a terminal and have a two factor auth code copied straight onto my clipboard ready to paste where it is required.
|
||||
|
||||
The [[./.bashrc][.bashrc]] file in this repository includes helper functions to make bitwarden workflows even faster, including an implementation of a custom git credential cache to dynamically retrieve git https credentials from bitwarden.
|
||||
|
||||
249
setup.org
249
setup.org
@ -4,95 +4,46 @@
|
||||
#+DATE: <2022-11-15 Tue 09:15>
|
||||
|
||||
|
||||
This guide will walk through how I setup fresh installations of [[https://pop.system76.com/][POP!_OS]]. Pop!_OS is a free and open-source Linux distribution, based upon Ubuntu, and featuring a customized GNOME desktop environment known as COSMIC. The distribution is developed by American Linux computer manufacturer System76. Pop!_OS is primarily built to be bundled with the computers built by System76, but can also be downloaded and installed on most computers.
|
||||
This guide will walk through how I setup fresh installations of [[https://projectbluefin.io][Bluefin]]. For end users Bluefin provides a system as reliable as a Chromebook with near-zero maintainance, with the power of homebrew, flathub, and a container runtime to give you access to all the best software Open Source has to offer.
|
||||
|
||||
Pop!_OS provides full out-of-the-box support for both AMD and Nvidia GPUs. It is regarded as an easy distribution to set up for gaming, mainly due to its built-in GPU support. Pop!_OS provides default disk encryption, streamlined window and workspace management, keyboard shortcuts for navigation as well as built-in power management profiles.
|
||||
|
||||
I use POP!_OS as my daily driver operating system on a variety of different machines. The intent of this guide is to make it easy for me to get back up and running quickly whenver I do a fresh installation.
|
||||
I use Bluefin as my daily driver operating system on a variety of different machines. The intent of this guide is to make it easy for me to get back up and running quickly whenver I do a fresh installation.
|
||||
|
||||
|
||||
* Setup home directory structure
|
||||
* Install brew packages
|
||||
|
||||
After installing the distribution I ensure the following directories are present in my home folder as they are relied on by other automated steps in this setup process:
|
||||
|
||||
#+NAME: Setup home folder strucuture
|
||||
#+begin_src shell
|
||||
# Ensure we are in our home folder and create required directories
|
||||
cd ~/ && mkdir Documents Downloads
|
||||
#+end_src
|
||||
|
||||
|
||||
* Install base packages
|
||||
|
||||
Now that we have our home directory done let's install the standard packages we use.
|
||||
Additional packages are ideally sourced from [[https://docs.brew.sh/Homebrew-on-Linux][Homebrew for Linux]], with [[https://flathub.org/][Flathub]] for anything I can't find in brew. Included in this repository is my ~Brewfile~ of packages.
|
||||
|
||||
#+begin_src tmux
|
||||
sudo apt install --yes btop nvtop screenfetch git curl wget xclip wl-clipboard xsel emacs xterm xtermcontrol jq tmux apt-transport-https dict gh unrar ripgrep
|
||||
#+end_src
|
||||
|
||||
For working with container images locally outside of kubernetes clusters we use [[https://podman.io/][~podman~]] so that we can avoid the security problems of a standard docker daemon. Follow the steps below to install podman:
|
||||
|
||||
#+begin_src tmux
|
||||
# Add the repositories to our apt sources
|
||||
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||
|
||||
# Add the repository key
|
||||
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key" | sudo apt-key add -
|
||||
|
||||
sudo apt update && sudo apt --yes install podman
|
||||
brew bundle install --cleanup
|
||||
#+end_src
|
||||
|
||||
|
||||
When working with kubernetes applications we often use [[https://helm.sh][helm]], let's download and install the latest release from github.
|
||||
* Install flatpak packages
|
||||
|
||||
#+NAME: Install helm
|
||||
#+BEGIN_src tmux
|
||||
wget $(sed 's/.\{1\}$//' <<< $(curl -s https://api.github.com/repos/helm/helm/releases/latest | grep -oP 'https...get.helm.sh.helm-v\d+.\d+.\d+-linux-amd64.tar.gz[)]'))
|
||||
For anything I can't get through Homebrew for Linux I install via Flathub. Included in this repository is my ~Flatfile~ of packages. Unfortunately the ~flatpak~ cli [[https://github.com/flatpak/flatpak/issues/5876][does not yet support list based installs]] so below is a bash oneliner to get the job done.
|
||||
|
||||
tar xf helm*.tar.gz linux-amd64/helm --transform 's,linux-amd64,,' && rm -rf helm-*linux-amd64.tar.gz
|
||||
|
||||
sudo mv helm /usr/local/bin/helm
|
||||
#+END_SRC
|
||||
#+begin_src
|
||||
while read line; do flatpak install --assumeyes `echo $line | awk '{print $2}'`; done < Flatfile
|
||||
#+end_src
|
||||
|
||||
|
||||
Finally, we should upgrade the python package manger ~pip~ that we installed, before using it to install [[https://github.com/containers/podman-compose][podman-compose]].
|
||||
|
||||
#+NAME: Upgrade pip
|
||||
#+BEGIN_src tmux
|
||||
sudo pip install --upgrade pip && sudo pip3 install podman-compose
|
||||
#+END_SRC
|
||||
|
||||
* Secret management
|
||||
|
||||
For managing secrets we use [[https://bitwarden.com/][bitwarden]] which provides a great [[https://github.com/bitwarden/cli][cli utility]]. Additionally in our [[.bashrc][bashrc]] file included in this repository there are a number of helper functions to make working with ~bw~ easier.
|
||||
|
||||
#+NAME: Install bitwarden and login
|
||||
The ~bw~ utility should already be installed as part of our homebrew packages. Let's login now.
|
||||
|
||||
#+NAME: Login to bitwarden
|
||||
#+begin_src tmux
|
||||
# Download the latest release
|
||||
wget "https://vault.bitwarden.com/download/?app=cli&platform=linux" --output-document "bw.zip"
|
||||
|
||||
# Unzip and install the latest release
|
||||
unzip "bw.zip" && sudo install "bw" "/usr/local/bin" && rm "bw" "bw.zip"
|
||||
|
||||
# Login to bitwarden
|
||||
bw login mail@jamesblair.net
|
||||
#+end_src
|
||||
|
||||
|
||||
For ad-hoc system administration we use [[https://deb.nodesource.com/setup_12.x ][ansible]]. We install ansible via ~pip3~ to ensure any modules or additional packages required at a later date can be easily managed.
|
||||
|
||||
For significant ansible or python projects a virtual environment for python is suggested to keep project packages separate from system python packages.
|
||||
|
||||
#+NAME: Install ansible via pip
|
||||
#+BEGIN_src tmux
|
||||
pip3 install ansible
|
||||
#+END_SRC
|
||||
|
||||
|
||||
* Restore ssh keys and dotfiles
|
||||
|
||||
I make extensive use of ~.dotfiles~ to further customise my environment. The script below restores my versions of key dotfiles automatically.
|
||||
|
||||
*** Obtain ssh key from bitwarden
|
||||
** Obtain ssh key from bitwarden
|
||||
|
||||
In order to be able to clone the repository in the next step we need to obtain our ssh keys from bitwarden. Given we have installed the bitwarden cli we can mostly automte this process minus the initial login to bitwarden.
|
||||
|
||||
@ -108,7 +59,7 @@ ssh-keygen -t rsa -f ~/.ssh/james -q -P ""
|
||||
export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)
|
||||
|
||||
# Export both keys
|
||||
export key=$(bw get item desktop --pretty | grep notes)
|
||||
export key=$(bw get item "$(hostname)" --pretty | grep notes)
|
||||
|
||||
# Extract private key
|
||||
export private=${key:12}
|
||||
@ -120,7 +71,7 @@ export public=${key/*ssh-rsa/ssh-rsa} && echo ${public::-2} | awk '{gsub(/\\n/,"
|
||||
#+end_src
|
||||
|
||||
|
||||
*** Clone and restore dotfiles
|
||||
** Clone and restore dotfiles
|
||||
|
||||
Once our keys are available to us we can clone down our dotfiles and get back to our comfortable normal terminal environment.
|
||||
|
||||
@ -143,22 +94,7 @@ source ~/.bashrc
|
||||
|
||||
** Optional - Cloud provider tools
|
||||
|
||||
Currently ~kubectl~ is packaged separately to ~gcloud~ and other cloud provider tools so let's install that first.
|
||||
|
||||
#+NAME: Install kubectl
|
||||
#+begin_src tmux
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
|
||||
sudo install kubectl /usr/local/bin/
|
||||
|
||||
which kubectl && kubectl version
|
||||
|
||||
rm kubectl
|
||||
#+end_src
|
||||
|
||||
|
||||
|
||||
For working with google cloud platform we use the [[https://cloud.google.com/sdk/][GCP SDK]], which provides our cli tools.
|
||||
For working with google cloud platform we use the [[https://cloud.google.com/sdk/][GCP SDK]], which provides our cli tools. Unfortunately we [[https://github.com/orgs/Homebrew/discussions/3594][can't install it via brew on Linux]] so we need to install it manually.
|
||||
|
||||
#+NAME: Install google cloud sdk
|
||||
#+BEGIN_src tmux
|
||||
@ -166,65 +102,47 @@ For working with google cloud platform we use the [[https://cloud.google.com/sdk
|
||||
curl -o gcpsdk.tar -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz
|
||||
|
||||
# Extract to a folder in path then remove archive
|
||||
tar xvf gcpsdk.tar -C /home/${USER}/.var/bin && rm gcpsdk.tar
|
||||
mkdir /home/${USER}/.var/bin && tar xvf gcpsdk.tar -C /home/${USER}/.var/bin && rm gcpsdk.tar
|
||||
|
||||
# Run the install script
|
||||
/home/${USER}/.var/bin/google-cloud-sdk/install.sh
|
||||
#+END_SRC
|
||||
|
||||
|
||||
For working with [[https://aws.com][Amazon Web Services]] we need the [[https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html][AWS CLI]].
|
||||
** Optional - Setup doom emacs
|
||||
|
||||
#+NAME: Install amazon web services cli
|
||||
An integral part of my development workflow is [[https://github.com/doomemacs/doomemacs][Doom Emacs]]. Below are the instructions to set this up.
|
||||
|
||||
#+NAME: Install and configure doom
|
||||
#+BEGIN_src tmux
|
||||
# Download the binary
|
||||
cd ~/Downloads/
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
# Install doom emacs
|
||||
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
|
||||
~/.config/emacs/bin/doom install
|
||||
|
||||
# Install
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install
|
||||
# Copy in my configuration
|
||||
cp /home/${USER}/Documents/doom/* /home/${USER}/.config/doom/
|
||||
|
||||
# Clean up
|
||||
rm -rf ~/Downloads/aws*
|
||||
# Doom sync to finalise
|
||||
doom sync
|
||||
#+END_SRC
|
||||
|
||||
|
||||
**
|
||||
** Optional - Nodejs dev tooling
|
||||
|
||||
Some of my project work involves working with [[https://nodejs.org/en][nodejs]] and for package management namely we sometimes use [[https://www.npmjs.com/][node package manager]]. The code below installs node ~16.x~, which is the latest stable release as of <2022-09-16 Fri>.
|
||||
|
||||
#+NAME: Install nodejs
|
||||
#+BEGIN_src tmux
|
||||
# Curl down the shell script for adding version 16 of nodejs to apt
|
||||
sudo curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
|
||||
|
||||
# Install the nodejs package via apt
|
||||
sudo apt-get install -y nodejs
|
||||
|
||||
# Install yarn dependency manager
|
||||
sudo npm install --global yarn
|
||||
#+END_SRC
|
||||
Included in this repository is a ~doom/~ subdirectory which layers my personal preferences on top of doom.
|
||||
|
||||
|
||||
** Optional - Install hardware drivers
|
||||
** Optional - setup tmux plugin manager
|
||||
|
||||
For terminal efficiency I use the [[https://github.com/tmux/tmux][tmux]] terminal multiplexer, however to customize it further I use the [[https://github.com/tmux-plugins/tpm][tpm]] plugin manager.
|
||||
|
||||
** Optional - Setup humacs editor
|
||||
#+NAME Install tmux plugin manager
|
||||
#+begin_src tmux
|
||||
# Install tmux plugin manager
|
||||
mkdir --parents /home/${USER}/.tmux/plugins
|
||||
git clone https://github.com/tmux-plugins/tpm /home/${USER}/.tmux/plugins/tpm
|
||||
./home/${USER}/.tmux/plugins/tpm/bin/install_plugins
|
||||
|
||||
An integral part of our pair development workflow is [[https://github.com/humacs/humacs][humacs]]. Below are the instructions to set this up.
|
||||
|
||||
#+NAME: Install and configure humacs
|
||||
#+BEGIN_src tmux
|
||||
# Clone down humacs
|
||||
git clone --recursive https://github.com/jmhbnz/humacs /home/$USER/Downloads/
|
||||
|
||||
# Need to ensure environment variables are set for load path
|
||||
export EMACSLOADPATH=/home/$USER/Downloads/humacs
|
||||
#+END_SRC
|
||||
|
||||
Included in this repository is a ~.bashrc~ and ~humacs-custom.el~ which layer my personal preferences on top of humacs.
|
||||
# Source the tmux configuration file
|
||||
tmux source ~/.tmux.conf
|
||||
#+end_src
|
||||
|
||||
|
||||
** Optional - Setup sbp powerline prompt
|
||||
@ -235,25 +153,13 @@ As you can see in the screenshot, contextual "segments" are presented in the pro
|
||||
|
||||
[[./images/powerline-prompt.png]]
|
||||
|
||||
|
||||
To set up this prompt the first thing we need to do is install powerline fonts:
|
||||
|
||||
#+NAME: Install powerline fonts
|
||||
#+begin_src tmux
|
||||
# Install the powerline fonts package
|
||||
sudo apt-get install fonts-powerline
|
||||
|
||||
# Refresh the system font cache
|
||||
sudo fc-cache --force --verbose
|
||||
#+end_src
|
||||
|
||||
|
||||
Once powerline fonts are installed we need to install simple bash prompt:
|
||||
|
||||
#+NAME: Install simple bash prompt
|
||||
#+begin_src tmux
|
||||
# Disable bluefin/aurora terminal motd
|
||||
ujust toggle-user-motd
|
||||
|
||||
# Clone the repository
|
||||
git clone https://github.com/jmhbnz/sbp ~/Downloads/sbp/
|
||||
git clone https://github.com/brujoand/sbp ~/Downloads/sbp/
|
||||
|
||||
# Run the install script
|
||||
/home/$USER/Downloads/sbp/bin/install
|
||||
@ -262,7 +168,7 @@ git clone https://github.com/jmhbnz/sbp ~/Downloads/sbp/
|
||||
mkdir --parents /home/$USER/.config/sbp/
|
||||
|
||||
# Write the config file
|
||||
cat << EOF >
|
||||
cat << EOF > /home/$USER/.config/sbp/settings.conf
|
||||
#!/usr/bin/env bash
|
||||
SBP_THEME_COLOR='apathy'
|
||||
SBP_THEME_LAYOUT='powerline'
|
||||
@ -308,54 +214,25 @@ sbp toggle peekaboo k8s
|
||||
Congratulations - you should now have a functional, good looking and informative bash prompt! 🎉
|
||||
|
||||
|
||||
** Optional - Setup mutt mail client
|
||||
** Optional - bluetooth device names
|
||||
|
||||
For reading email we ideally use a cli based client for fast searching and lightweight mail reading.
|
||||
On a fresh install a selection of bluetooth devices need to be paired. I prefer a custom naming scheme for these devices, so the snippet below can be used to bulk apply my preferred device names.
|
||||
|
||||
The [[https://gitlab.com/muttmua/mutt/][mutt]] mail client fills these roles well for imap mailboxes.
|
||||
|
||||
The first step to setup mutt is to ensure it is installed.
|
||||
|
||||
#+NAME: Install mutt
|
||||
#+BEGIN_src tmux
|
||||
sudo apt-get install -y mutt urlscan
|
||||
#+END_SRC
|
||||
|
||||
After installing mutt we then need to create configuration directories and files.
|
||||
|
||||
#+NAME: Create mutt config files
|
||||
#+BEGIN_src tmux
|
||||
mkdir -p ~/.mutt/cache/headers
|
||||
mkdir ~/.mutt/cache/bodies
|
||||
touch ~/.mutt/certificates
|
||||
#+END_SRC
|
||||
|
||||
One configuration folders and files exist we just need to populate our user mutt configuration file with a configuration for our particular mail provider.
|
||||
|
||||
The example provided in this repository utilises the ~bitwarden~ cli utility for secrets to ensure these are securely gathered at runtime and not stored in the file.
|
||||
|
||||
|
||||
** Optional - Rust dev tooling
|
||||
|
||||
I've been tinkering with learning the [[https://www.rust-lang.org/][Rust]] programming language lately, to set that up follow these steps:
|
||||
|
||||
#+NAME: Install pre-requisites
|
||||
#+NAME: Rename bluetooth devices
|
||||
#+begin_src tmux
|
||||
# Ensure pre-requisites are installed
|
||||
sudo apt install curl build-essential gcc make -y
|
||||
#+end_src
|
||||
|
||||
#+NAME: Install rust via helper script
|
||||
#+begin_src tmux
|
||||
# Install rust via helper script
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
#+end_src
|
||||
|
||||
Once installed you can check if the rust compiler is installed with the code block below:
|
||||
|
||||
#+NAME: Verify installation
|
||||
#+begin_src tmux
|
||||
rustc -V && cargo -V
|
||||
bluetoothctl connect CC:98:8B:B6:F0:8E && bluetoothctl set-alias james-headphones
|
||||
bluetoothctl connect CA:20:FE:30:DA:C0 && bluetoothctl set-alias james-travel-mouse
|
||||
bluetoothctl connect 80:E1:26:6D:66:4A && bluetoothctl set-alias james-flipper
|
||||
bluetoothctl connect 88:C9:E8:5A:56:6C && bluetoothctl set-alias james-earphones
|
||||
bluetoothctl connect E2:A0:9F:BC:DB:27 && bluetoothctl set-alias james-home-mouse
|
||||
#+end_src
|
||||
|
||||
|
||||
** Optional - disable sleep
|
||||
|
||||
I just power off my devices when they aren't in use, the snippet below disables sleep buttons and also ensures my devices will never unintentionally sleep when closing lid etc.
|
||||
|
||||
#+NAME: Disable sleep
|
||||
#+begin_src bash
|
||||
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user