Compare commits
135 Commits
eff67c276c
...
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 | |||
| b5e1d7c411 | |||
| 465604af77 | |||
| eb92c80b0c | |||
| f560a829ca | |||
| 488c0fa680 | |||
| 27f40b0050 | |||
| d408c90c4b | |||
| 793d15a9a2 | |||
| 42a89ca91b | |||
| abc5692be6 | |||
| 4b736f8315 | |||
| 64583007bc | |||
| 2b67d89f8f | |||
| 6a4e01e8fb | |||
| 33ca651599 | |||
| b2769ddf65 | |||
| 696abf03ed | |||
| fdb8b1a194 | |||
| 2ad2725fa0 | |||
| 574397c6e1 | |||
| d519a13286 | |||
| f95eed937c | |||
| 216df269ed | |||
| cc0eb52561 | |||
| 78c05b072e | |||
| 1303094e91 | |||
| e4e5f91b44 | |||
| fbd1f6fca5 | |||
| e6d5aa3472 | |||
| 78e05345e7 | |||
| eb296158f8 | |||
| 8ab535f06e | |||
| d221812cf7 | |||
| 9fde83fc09 | |||
| 503fbca272 | |||
| b6204e7d5e | |||
| 3fd48e1e8c | |||
| fec04a2c36 | |||
| 578cd49633 | |||
| 387b8bbfeb | |||
| dac3a3ca12 | |||
| f12f909ca9 | |||
| 666b61828a | |||
| 551e7be5a3 | |||
| 63de85e570 | |||
| 3f9bd1ef16 | |||
| cc27d929b4 | |||
| 4b58ae01e6 | |||
| fb9c270bef | |||
| 43ed1dbb03 | |||
| 1f26391994 | |||
| d30c8892a8 | |||
| d599e9cd5e | |||
| eda1ba16ad | |||
| be32f35315 | |||
| 44a39a9544 | |||
| a27a41c47e | |||
| 4d44980bb1 | |||
| d5efc3c7cf | |||
| e6903c4074 | |||
| 15ef57167a | |||
| d9602cb5d2 | |||
| ce92e7fbcc |
195
.bashrc
195
.bashrc
@ -1,47 +1,96 @@
|
||||
# ==============================================================================
|
||||
# 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
|
||||
# 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
|
||||
|
||||
# simplify bitwarden cli usage
|
||||
# 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
|
||||
|
||||
# Alias df to dysk
|
||||
if [ "$(command -v bat)" ]; then
|
||||
alias df=dysk
|
||||
fi
|
||||
|
||||
# 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" | xclip -selection c; }
|
||||
function bwgt () { local test=$(export BW_SESSION=~/.bw_session) && bw get totp "$1" | xclip -selection c; }
|
||||
|
||||
function bwgp () {
|
||||
|
||||
# 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; }
|
||||
function bwgi () { local test=$(export BW_SESSION=~/.bw_session) && bw get item --pretty "$1"; }
|
||||
function bwli () { local test=$(export BW_SESSION=~/.bw_session) && bw list items --search "$1" --pretty | egrep -i 'name|"id":'; }
|
||||
function bwol () { local test=$(export BW_SESSION=~/.bw_session) && bw get item --pretty "$1" | grep https | awk '{print $2}' | xclip -selection c; }
|
||||
function bwgu () { local test=$(export BW_SESSION=~/.bw_session) && bw get username "$1" | xclip -selection c; }
|
||||
function bwol () { local test=$(export BW_SESSION=~/.bw_session) && bw get item --pretty "$1" | grep https | awk '{print $2}' | $cpcmd; }
|
||||
function bwgu () { local test=$(export BW_SESSION=~/.bw_session) && bw get username "$1" | $cpcmd; }
|
||||
|
||||
# automate multimonitor command
|
||||
alias hdmioff='xrandr --output HDMI-0 --off'
|
||||
alias hdmion='xrandr --output HDMI-0 --auto --rate 144.00 --left-of DVI-I-0 --primary'
|
||||
# Custom function for creating new entries
|
||||
function bwai () {
|
||||
|
||||
# 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).
|
||||
# Verify enough parameters are supplied
|
||||
if [ "$#" -lt "2" ]; then
|
||||
echo 'Ensure all required parameters are supplied:'
|
||||
echo ' $1 = Name for item'
|
||||
echo ' $2 = Username for item'
|
||||
echo ' $3 = Secret for item (optional)'
|
||||
echo ' $4 = Url for item (optional)'
|
||||
return 2
|
||||
fi
|
||||
|
||||
# Use a generated password if none supplied
|
||||
local pass="${3:-$(tr -dc A-Za-z0-9 </dev/urandom | head -c 20; echo)}"
|
||||
|
||||
# Pad the url with required json
|
||||
bw_uris=$(bw get template item.login.uri | jq ".match="0" | .uri=\"${4}\"" | jq -c)
|
||||
|
||||
bw get template item | \
|
||||
jq ".name=\"${1}\" | \
|
||||
.login=$(bw get template item.login | jq ".username=\"${2}\" | .password=\"${pass}\" | .uris=[${bw_uris}] | .totp=null")" | \
|
||||
jq '.notes=null' | \
|
||||
bw encode | bw create item && bw sync
|
||||
}
|
||||
|
||||
# Enable programmable completion features
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
@ -50,39 +99,44 @@ if ! shopt -oq posix; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Configure display and browser for wsl
|
||||
if [ $(uname -r | sed -n 's/.*\( *Microsoft *\).*/\1/ip') ]; then
|
||||
export DISPLAY=`grep -oP "(?<=nameserver ).+" /etc/resolv.conf`:0.0
|
||||
export BROWSER="explorer.exe"
|
||||
fi
|
||||
# Configure fuzzy find
|
||||
export FZF_DEFAULT_COMMAND="rg --files --follow --no-ignore-vcs --hidden -g '!{**/node_modules/*,**/.git/*,**.emacs.d/*}'"
|
||||
eval "$(fzf --bash)"
|
||||
|
||||
# Configure emacs location
|
||||
export EMACSLOADPATH=~/Downloads/humacs:
|
||||
# Configure emacs location and aliases
|
||||
export PATH=$PATH:/home/james/.config/emacs/bin/
|
||||
alias emacs="emacsclient -nw -a 'doom run --bg-daemon && emacsclient -nw'"
|
||||
|
||||
# Setup prompt
|
||||
function color_my_prompt {
|
||||
local __user_and_host="\[\033[01;32m\]\u@\h"
|
||||
local __cur_location="\[\033[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 "
|
||||
function e {
|
||||
|
||||
# If the file exists just open it
|
||||
if test -f "$1"; then
|
||||
emacsclient -nw -a 'doom run --bg-daemon && emacsclient -nw' "$1"
|
||||
|
||||
# Otherwise we should search for it
|
||||
else emacsclient -nw -a 'doom run --bg-daemon && emacsclient -nw' $(fzf --height 40% --reverse -i --query "$1")
|
||||
fi
|
||||
}
|
||||
|
||||
color_my_prompt
|
||||
# Configure go location
|
||||
export PATH=$PATH:/var/home/james/go/bin
|
||||
|
||||
# Start from home folder
|
||||
cd ~/
|
||||
|
||||
|
||||
# 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
|
||||
@ -90,26 +144,35 @@ 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
|
||||
|
||||
# Helper function for tmate pane renaming
|
||||
function renamepane {
|
||||
printf '\033]2;%s\033\\' "${1}"
|
||||
}
|
||||
|
||||
# Try connect to my default tmate socket
|
||||
if ! tmate -S /tmp/default.tmate attach; then
|
||||
tmate -S /tmp/default.tmate.tmate new-session -s default -n default -d
|
||||
tmate -S /tmp/default.tmate.tmate attach
|
||||
# Try connect to my default tmux socket
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# The next line enables shell command completion for gcloud.
|
||||
if [ -f '/var/home/james/.var/bin/google-cloud-sdk/completion.bash.inc' ]; then . '/var/home/james/.var/bin/google-cloud-sdk/completion.bash.inc'; fi
|
||||
|
||||
40
.gitconfig
40
.gitconfig
@ -2,11 +2,47 @@
|
||||
email = mail@jamesblair.net
|
||||
name = James Blair
|
||||
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 = false
|
||||
rebase = true
|
||||
|
||||
[merge]
|
||||
conflictstyle = diff3
|
||||
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[credential]
|
||||
helper = cache --timeout=21600
|
||||
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
|
||||
|
||||
[gpg]
|
||||
format = ssh
|
||||
|
||||
[alias]
|
||||
sweep = !"git branch -d $(git branch --merged | grep -vw $(git rev-parse --abbrev-ref HEAD))"
|
||||
|
||||
[help]
|
||||
autocorrect = 10
|
||||
|
||||
[core]
|
||||
askPass = false
|
||||
editor = emacs
|
||||
|
||||
[log]
|
||||
date = iso
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
@ -1,17 +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.
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(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.
|
||||
)
|
||||
(set-face-background 'default "undefined")
|
||||
(add-hook 'text-mode-hook 'visual-line-mode)
|
||||
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||
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
|
||||
#================================================================
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
set-option -g set-clipboard on
|
||||
set-option -g mouse on
|
||||
set-option -g history-limit 50000
|
||||
set -g tmate-identity "james"
|
||||
set -s escape-time 0
|
||||
25
.tmux.conf
Normal file
25
.tmux.conf
Normal file
@ -0,0 +1,25 @@
|
||||
# Mouse support for tmux scrollback and copy
|
||||
set-option -g set-clipboard on
|
||||
set-option -g mouse on
|
||||
|
||||
# Keep current path when creating new windows or panes
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
bind % split-window -h -c "#{pane_current_path}"
|
||||
bind '"' split-window -v -c "#{pane_current_path}"
|
||||
|
||||
# Install tpm plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'dracula/tmux'
|
||||
|
||||
# Make dracula theme more minimal
|
||||
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'
|
||||
58
Brewfile
Normal file
58
Brewfile
Normal file
@ -0,0 +1,58 @@
|
||||
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 "go"
|
||||
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"
|
||||
brew "zoxide"
|
||||
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
|
||||
122
doom/config.el
Normal file
122
doom/config.el
Normal file
@ -0,0 +1,122 @@
|
||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Place your private configuration here! Remember, you do not need to run 'doom
|
||||
;; sync' after modifying this file!
|
||||
|
||||
|
||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||
;; clients, file templates and snippets. It is optional.
|
||||
(setq user-full-name "James Blair"
|
||||
user-mail-address "mail@jamesblair.net")
|
||||
|
||||
;; Doom exposes five (optional) variables for controlling fonts in Doom:
|
||||
;;
|
||||
;; - `doom-font' -- the primary font to use
|
||||
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
|
||||
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
|
||||
;; presentations or streaming.
|
||||
;; - `doom-unicode-font' -- for unicode glyphs
|
||||
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
|
||||
;;
|
||||
;; See 'C-h v doom-font' for documentation and more examples of what they
|
||||
;; accept. For example:
|
||||
;;
|
||||
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
|
||||
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
|
||||
;;
|
||||
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
|
||||
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
|
||||
;; refresh your font settings. If Emacs still can't find your font, it likely
|
||||
;; wasn't installed correctly. Font issues are rarely Doom issues!
|
||||
|
||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||
;; `load-theme' function. This is the default:
|
||||
(setq doom-theme 'doom-badger)
|
||||
|
||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
||||
(setq display-line-numbers-type t)
|
||||
|
||||
;; If you use `org' and don't want your org files in the default location below,
|
||||
;; change `org-directory'. It must be set before org loads!
|
||||
(setq org-directory "~/Documents/org-journal/")
|
||||
|
||||
|
||||
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
||||
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
||||
;;
|
||||
;; (after! PACKAGE
|
||||
;; (setq x y))
|
||||
;;
|
||||
;; The exceptions to this rule:
|
||||
;;
|
||||
;; - Setting file/directory variables (like `org-directory')
|
||||
;; - Setting variables which explicitly tell you to set them before their
|
||||
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
|
||||
;; - Setting doom variables (which start with 'doom-' or '+').
|
||||
;;
|
||||
;; Here are some additional functions/macros that will help you configure Doom.
|
||||
;;
|
||||
;; - `load!' for loading external *.el files relative to this one
|
||||
;; - `use-package!' for configuring packages
|
||||
;; - `after!' for running code after a package has loaded
|
||||
;; - `add-load-path!' for adding directories to the `load-path', relative to
|
||||
;; this file. Emacs searches the `load-path' when you load packages with
|
||||
;; `require' or `use-package'.
|
||||
;; - `map!' for binding new keys
|
||||
;;
|
||||
;; To get information about any of these functions/macros, move the cursor over
|
||||
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
|
||||
;; This will open documentation for it, including demos of how they are used.
|
||||
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
|
||||
;; etc).
|
||||
;;
|
||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||
;; they are implemented.
|
||||
|
||||
;; Ensure treemacs is open by default
|
||||
;;(add-hook 'window-setup-hook #'treemacs 'append)
|
||||
|
||||
;; Disable theme backgrounds when in the terminal
|
||||
(defun set-background-for-terminal (&optional frame)
|
||||
(or frame (setq frame (selected-frame)))
|
||||
"unsets the background color in terminal mode"
|
||||
(unless (display-graphic-p frame)
|
||||
(set-face-background 'default "unspecified-bg" frame)))
|
||||
(add-hook 'after-make-frame-functions 'set-background-for-terminal)
|
||||
(add-hook 'window-setup-hook 'set-background-for-terminal)
|
||||
|
||||
;; Add nice mouse scrolling support
|
||||
(xterm-mouse-mode 1)
|
||||
|
||||
(defun scroll-up-5-lines ()
|
||||
"Scroll up 5 lines"
|
||||
(interactive)
|
||||
(scroll-up 5))
|
||||
|
||||
(defun scroll-down-5-lines ()
|
||||
"Scroll down 5 lines"
|
||||
(interactive)
|
||||
(scroll-down 5))
|
||||
|
||||
(global-set-key (kbd "<mouse-4>") 'scroll-down-5-lines)
|
||||
(global-set-key (kbd "<mouse-5>") 'scroll-up-5-lines)
|
||||
|
||||
(setq org-babel-default-header-args:shell
|
||||
'((:results . "output code verbatim replace")
|
||||
(:wrap . "example")))
|
||||
|
||||
(require 'ob-async)
|
||||
(require 'ob-tmux)
|
||||
(setq org-babel-default-header-args:tmux
|
||||
'((:results . "silent") ;
|
||||
(:session . "default") ; The default tmux session to send code to
|
||||
(:socket . nil))) ; The default tmux socket to communicate with
|
||||
|
||||
;; Fix comment colors
|
||||
(set-face-foreground 'font-lock-string-face "green")
|
||||
(set-face-foreground 'font-lock-comment-face "green")
|
||||
|
||||
;; Add support for mdx files
|
||||
(add-to-list 'auto-mode-alist '("\\.mdx\\'" . markdown-mode))
|
||||
54
doom/custom.el
Normal file
54
doom/custom.el
Normal file
@ -0,0 +1,54 @@
|
||||
(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.
|
||||
'(ansi-color-names-vector
|
||||
["#0D0E16" "#D83441" "#79D836" "#D8B941" "#3679D8" "#8041D8" "#36D8BD" "#CEDBE5"])
|
||||
'(custom-safe-themes
|
||||
'("2e05569868dc11a52b08926b4c1a27da77580daa9321773d92822f7a639956ce" "2dd4951e967990396142ec54d376cced3f135810b2b69920e77103e0bcedfba9" "7a424478cb77a96af2c0f50cfb4e2a88647b3ccca225f8c650ed45b7f50d9525" default))
|
||||
'(exwm-floating-border-color "#0F1019")
|
||||
'(fci-rule-color "#767676")
|
||||
'(highlight-tail-colors
|
||||
((("#172219" "color-113" "green")
|
||||
. 0)
|
||||
(("#112226" "color-79" "cyan")
|
||||
. 20)))
|
||||
'(ispell-dictionary nil)
|
||||
'(jdee-db-active-breakpoint-face-colors (cons "#0F1019" "#D85F00"))
|
||||
'(jdee-db-requested-breakpoint-face-colors (cons "#0F1019" "#79D836"))
|
||||
'(jdee-db-spec-breakpoint-face-colors (cons "#0F1019" "#767676"))
|
||||
'(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
|
||||
'(objed-cursor-color "#D83441")
|
||||
'(package-selected-packages '(ob-tmux yaml-mode cmake-mode))
|
||||
'(pdf-view-midnight-colors (cons "#CEDBE5" "#0D0E16"))
|
||||
'(rustic-ansi-faces
|
||||
["#0D0E16" "#D83441" "#79D836" "#D8B941" "#3679D8" "#8041D8" "#36D8BD" "#CEDBE5"])
|
||||
'(vc-annotate-background "#0D0E16")
|
||||
'(vc-annotate-color-map
|
||||
(list
|
||||
(cons 20 "#79D836")
|
||||
(cons 40 "#98cd39")
|
||||
(cons 60 "#b8c33d")
|
||||
(cons 80 "#D8B941")
|
||||
(cons 100 "#d89b2b")
|
||||
(cons 120 "#d87d15")
|
||||
(cons 140 "#D85F00")
|
||||
(cons 160 "#ba5548")
|
||||
(cons 180 "#9d4b90")
|
||||
(cons 200 "#8041D8")
|
||||
(cons 220 "#9d3ca5")
|
||||
(cons 240 "#ba3873")
|
||||
(cons 260 "#D83441")
|
||||
(cons 280 "#bf444e")
|
||||
(cons 300 "#a7555b")
|
||||
(cons 320 "#8e6568")
|
||||
(cons 340 "#767676")
|
||||
(cons 360 "#767676")))
|
||||
'(vc-annotate-very-old-color nil))
|
||||
(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.
|
||||
)
|
||||
196
doom/init.el
Normal file
196
doom/init.el
Normal file
@ -0,0 +1,196 @@
|
||||
;;; init.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; This file controls what Doom modules are enabled and what order they load
|
||||
;; in. Remember to run 'doom sync' after modifying it!
|
||||
|
||||
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
|
||||
;; documentation. There you'll find a link to Doom's Module Index where all
|
||||
;; of our modules are listed, including what flags they support.
|
||||
|
||||
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
|
||||
;; 'C-c c k' for non-vim users) to view its documentation. This works on
|
||||
;; flags as well (those symbols that start with a plus).
|
||||
;;
|
||||
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
|
||||
;; directory (for easy access to its source code).
|
||||
|
||||
(doom! :input
|
||||
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
|
||||
;;chinese
|
||||
;;japanese
|
||||
;;layout ; auie,ctsrnm is the superior home row
|
||||
:os
|
||||
(tty +osc)
|
||||
|
||||
:completion
|
||||
company ; the ultimate code completion backend
|
||||
helm ; the *other* search engine for love and life
|
||||
;;ido ; the other *other* search engine...
|
||||
;;ivy ; a search engine for love and life
|
||||
vertico ; the search engine of the future
|
||||
|
||||
:ui
|
||||
;;deft ; notational velocity for Emacs
|
||||
doom ; what makes DOOM look the way it does
|
||||
doom-dashboard ; a nifty splash screen for Emacs
|
||||
doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||
(emoji +unicode) ; 🙂
|
||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||
;;hydra
|
||||
;;indent-guides ; highlighted indent columns
|
||||
;;ligatures ; ligatures and symbols to make your code pretty again
|
||||
minimap ; show a map of the code on the side
|
||||
modeline ; snazzy, Atom-inspired modeline, plus API
|
||||
;;nav-flash ; blink cursor line after big motions
|
||||
;;neotree ; a project drawer, like NERDTree for vim
|
||||
ophints ; highlight the region an operation acts on
|
||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||
tabs ; a tab bar for Emacs
|
||||
treemacs ; a project drawer, like neotree but cooler
|
||||
;;unicode ; extended unicode support for various languages
|
||||
(vc-gutter +pretty) ; vcs diff in the fringe
|
||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||
;;window-select ; visually switch windows
|
||||
workspaces ; tab emulation, persistence & separate workspaces
|
||||
;;zen ; distraction-free coding or writing
|
||||
|
||||
:editor
|
||||
(evil +everywhere); come to the dark side, we have cookies
|
||||
file-templates ; auto-snippets for empty files
|
||||
fold ; (nigh) universal code folding
|
||||
;;(format +onsave) ; automated prettiness
|
||||
;;god ; run Emacs commands without modifier keys
|
||||
;;lispy ; vim for lisp, for people who don't like vim
|
||||
;;multiple-cursors ; editing in many places at once
|
||||
;;objed ; text object editing for the innocent
|
||||
;;parinfer ; turn lisp into python, sort of
|
||||
;;rotate-text ; cycle region at point between text candidates
|
||||
snippets ; my elves. They type so I don't have to
|
||||
;;word-wrap ; soft wrapping with language-aware indent
|
||||
|
||||
:emacs
|
||||
dired ; making dired pretty [functional]
|
||||
electric ; smarter, keyword-based electric-indent
|
||||
;;ibuffer ; interactive buffer management
|
||||
undo ; persistent, smarter undo for your inevitable mistakes
|
||||
vc ; version-control and Emacs, sitting in a tree
|
||||
|
||||
:term
|
||||
;;eshell ; the elisp shell that works everywhere
|
||||
;;shell ; simple shell REPL for Emacs
|
||||
;;term ; basic terminal emulator for Emacs
|
||||
;;vterm ; the best terminal emulation in Emacs
|
||||
|
||||
:checkers
|
||||
syntax ; tasing you for every semicolon you forget
|
||||
;;(spell +flyspell) ; tasing you for misspelling mispelling
|
||||
;;grammar ; tasing grammar mistake every you make
|
||||
|
||||
:tools
|
||||
;;ansible
|
||||
;;biblio ; Writes a PhD for you (citation needed)
|
||||
;;debugger ; FIXME stepping through code, to help you add bugs
|
||||
;;direnv
|
||||
;;docker
|
||||
;;editorconfig ; let someone else argue about tabs vs spaces
|
||||
;;ein ; tame Jupyter notebooks with emacs
|
||||
(eval +overlay) ; run code, run (also, repls)
|
||||
;;gist ; interacting with github gists
|
||||
lookup ; navigate your code and its documentation
|
||||
lsp ; M-x vscode
|
||||
magit ; a git porcelain for Emacs
|
||||
;;make ; run make tasks from Emacs
|
||||
;;pass ; password manager for nerds
|
||||
;;pdf ; pdf enhancements
|
||||
;;prodigy ; FIXME managing external services & code builders
|
||||
;;rgb ; creating color strings
|
||||
;;taskrunner ; taskrunner for all your projects
|
||||
;;terraform ; infrastructure as code
|
||||
tmux ; an API for interacting with tmux
|
||||
;;tree-sitter ; syntax and parsing, sitting in a tree...
|
||||
;;upload ; map local to remote projects via ssh/ftp
|
||||
|
||||
:os
|
||||
(:if IS-MAC macos) ; improve compatibility with macOS
|
||||
;;tty ; improve the terminal Emacs experience
|
||||
|
||||
:lang
|
||||
;;agda ; types of types of types of types...
|
||||
;;beancount ; mind the GAAP
|
||||
;;(cc +lsp) ; C > C++ == 1
|
||||
;;clojure ; java with a lisp
|
||||
;;common-lisp ; if you've seen one lisp, you've seen them all
|
||||
;;coq ; proofs-as-programs
|
||||
;;crystal ; ruby at the speed of c
|
||||
;;csharp ; unity, .NET, and mono shenanigans
|
||||
;;data ; config/data formats
|
||||
;;(dart +flutter) ; paint ui and not much else
|
||||
;;dhall
|
||||
;;elixir ; erlang done right
|
||||
;;elm ; care for a cup of TEA?
|
||||
emacs-lisp ; drown in parentheses
|
||||
;;erlang ; an elegant language for a more civilized age
|
||||
;;ess ; emacs speaks statistics
|
||||
;;factor
|
||||
;;faust ; dsp, but you get to keep your soul
|
||||
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
|
||||
;;fsharp ; ML stands for Microsoft's Language
|
||||
;;fstar ; (dependent) types and (monadic) effects and Z3
|
||||
;;gdscript ; the language you waited for
|
||||
(go +lsp) ; the hipster dialect
|
||||
;;(graphql +lsp) ; Give queries a REST
|
||||
;;(haskell +lsp) ; a language that's lazier than I am
|
||||
;;hy ; readability of scheme w/ speed of python
|
||||
;;idris ; a language you can depend on
|
||||
json ; At least it ain't XML
|
||||
;;(java +lsp) ; the poster child for carpal tunnel syndrome
|
||||
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
|
||||
;;julia ; a better, faster MATLAB
|
||||
;;kotlin ; a better, slicker Java(Script)
|
||||
;;latex ; writing papers in Emacs has never been so fun
|
||||
;;lean ; for folks with too much to prove
|
||||
;;ledger ; be audit you can be
|
||||
;;lua ; one-based indices? one-based indices
|
||||
markdown ; writing docs for people to ignore
|
||||
;;nim ; python + lisp at the speed of c
|
||||
;;nix ; I hereby declare "nix geht mehr!"
|
||||
;;ocaml ; an objective camel
|
||||
org ; organize your plain life in plain text
|
||||
;;php ; perl's insecure younger brother
|
||||
;;plantuml ; diagrams for confusing people more
|
||||
;;purescript ; javascript, but functional
|
||||
python ; beautiful is better than ugly
|
||||
;;qt ; the 'cutest' gui framework ever
|
||||
;;racket ; a DSL for DSLs
|
||||
;;raku ; the artist formerly known as perl6
|
||||
;;rest ; Emacs as a REST client
|
||||
;;rst ; ReST in peace
|
||||
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
|
||||
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||
;;scala ; java, but good
|
||||
;;(scheme +guile) ; a fully conniving family of lisps
|
||||
sh ; she sells {ba,z,fi}sh shells on the C xor
|
||||
;;sml
|
||||
;;solidity ; do you need a blockchain? No.
|
||||
;;swift ; who asked for emoji variables?
|
||||
;;terra ; Earth and Moon in alignment for performance.
|
||||
web ; the tubes
|
||||
yaml ; JSON, but readable
|
||||
;;zig ; C, but simpler
|
||||
|
||||
:email
|
||||
;;(mu4e +org +gmail)
|
||||
;;notmuch
|
||||
;;(wanderlust +gmail)
|
||||
|
||||
:app
|
||||
;;calendar
|
||||
;;emms
|
||||
;;everywhere ; *leave* Emacs!? You must be joking
|
||||
;;irc ; how neckbeards socialize
|
||||
;;(rss +org) ; emacs as an RSS reader
|
||||
;;twitter ; twitter client https://twitter.com/vnought
|
||||
|
||||
:config
|
||||
;;literate
|
||||
(default +bindings +smartparens))
|
||||
56
doom/packages.el
Normal file
56
doom/packages.el
Normal file
@ -0,0 +1,56 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; $DOOMDIR/packages.el
|
||||
|
||||
;; To install a package with Doom you must declare them here and run 'doom sync'
|
||||
;; on the command line, then restart Emacs for the changes to take effect -- or
|
||||
;; use 'M-x doom/reload'.
|
||||
|
||||
|
||||
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||
;(package! some-package)
|
||||
|
||||
;; To install a package directly from a remote git repo, you must specify a
|
||||
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
|
||||
;; https://github.com/radian-software/straight.el#the-recipe-format
|
||||
;(package! another-package
|
||||
; :recipe (:host github :repo "username/repo"))
|
||||
|
||||
;; If the package you are trying to install does not contain a PACKAGENAME.el
|
||||
;; file, or is located in a subdirectory of the repo, you'll need to specify
|
||||
;; `:files' in the `:recipe':
|
||||
;(package! this-package
|
||||
; :recipe (:host github :repo "username/repo"
|
||||
; :files ("some-file.el" "src/lisp/*.el")))
|
||||
|
||||
;; If you'd like to disable a package included with Doom, you can do so here
|
||||
;; with the `:disable' property:
|
||||
;(package! builtin-package :disable t)
|
||||
|
||||
;; You can override the recipe of a built in package without having to specify
|
||||
;; all the properties for `:recipe'. These will inherit the rest of its recipe
|
||||
;; from Doom or MELPA/ELPA/Emacsmirror:
|
||||
;(package! builtin-package :recipe (:nonrecursive t))
|
||||
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
|
||||
|
||||
;; Specify a `:branch' to install a package from a particular branch or tag.
|
||||
;; This is required for some packages whose default branch isn't 'master' (which
|
||||
;; our package manager can't deal with; see radian-software/straight.el#279)
|
||||
;(package! builtin-package :recipe (:branch "develop"))
|
||||
|
||||
;; Use `:pin' to specify a particular commit to install.
|
||||
;(package! builtin-package :pin "1a2b3c4d5e")
|
||||
|
||||
|
||||
;; Doom's packages are pinned to a specific commit and updated from release to
|
||||
;; release. The `unpin!' macro allows you to unpin single packages...
|
||||
;(unpin! pinned-package)
|
||||
;; ...or multiple packages
|
||||
;(unpin! pinned-package another-pinned-package)
|
||||
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||
;(unpin! t)
|
||||
|
||||
(package! ob-tmux)
|
||||
(package! ob-async)
|
||||
(package! kubernetes)
|
||||
(package! kubernetes-evil)
|
||||
(package! graphviz-dot-mode)
|
||||
@ -4,7 +4,11 @@
|
||||
#+DATE: <2022-12-11 Sun 16:00>
|
||||
|
||||
|
||||
Below are the steps I follow post standard installation of mobian on my pinephone.
|
||||
Below are the steps I follow post standard installation of [[https://mobian-project.org][mobian]] on my [[https://www.pine64.org/pinephone/][pinephone]] or [[https://www.pine64.org/pinephonepro/][pinephone pro]].
|
||||
|
||||
I've been using the pinephone pro as a daily driver on and off since mid 2021. I still carry an android phone in my every day carry to act as my alarm and camera as these two functions don't currently work well enough for me on the pinephone pro.
|
||||
|
||||
After much experimentation with various distros I have settled on Mobian with Phosh as this is keeps me in the Debian ecosystem that I run for my servers and laptop devices and also seems to be quite stable.
|
||||
|
||||
* Start temporary terminal session
|
||||
|
||||
@ -18,11 +22,14 @@ sudo apt install --yes tmate
|
||||
#+end_src
|
||||
|
||||
|
||||
Once ~tmate~ is installed we can launch it in a terminal and provided our device has internet connectivity use the ssh connection strings shown on screen to connect from a terminal or web browser on my primary device.
|
||||
|
||||
|
||||
* Setup ssh server
|
||||
|
||||
Once we have a foothold on the device via tmate we need to setup ~ssh~ server which we will use to securely connect to the device.
|
||||
|
||||
#+NAME: Setup ssh server[
|
||||
#+NAME: Setup ssh server
|
||||
#+begin_src tmate
|
||||
sudo apt install --yes openssh-server
|
||||
#+end_src
|
||||
@ -50,11 +57,149 @@ sudo cloudflared service install <token>
|
||||
#+end_src
|
||||
|
||||
|
||||
* Bluetooth audio fix
|
||||
At the client end we need to add the following to our ssh config to simplify the connection process so we can use our familar ~[user]@[hostname]~ approach for starting a session.
|
||||
|
||||
#+NAME: Update ssh config
|
||||
#+begin_src shell
|
||||
cat << EOF >> ~/.ssh/config
|
||||
|
||||
Host phone.jamma.life
|
||||
ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h
|
||||
EOF
|
||||
|
||||
To pair a wireless headset we first need to install the pa bluetooth module.
|
||||
|
||||
#+NAME: Install pa bt module
|
||||
#+begin_src tmate
|
||||
sudo apt install pulseaudio-module-bluetooth
|
||||
#+end_src
|
||||
|
||||
|
||||
At this point with both services installed we should now be able to start both and connect. For security reasons we will be limiting connections to key based only and disabling both services by default so we need to intentionally start them.
|
||||
|
||||
#+NAME: Start services
|
||||
#+begin_src tmate
|
||||
# Start services and exit tmate session
|
||||
sudo systemctl start cloudflared ssh && exit
|
||||
|
||||
# Copy our key to the server
|
||||
ssh-copy-id -i ~/.ssh/james.pub mobian@phone.jamma.life
|
||||
|
||||
# Connect via ssh
|
||||
ssh mobian@phone.jamma.life
|
||||
|
||||
# Disable ssh password authentication
|
||||
sudo sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config
|
||||
|
||||
# Restart ssh daemon
|
||||
sudo systemctl restart ssh
|
||||
|
||||
# Disable services by default
|
||||
sudo systemctl disable cloudflared ssh
|
||||
#+end_src
|
||||
|
||||
|
||||
* Install extra packages
|
||||
|
||||
Now that we have our remote access done let's install any pinephone specific packages that we need over an above the standard packages covered in the [[../setup.org][setup.org]] file at the top level of this repository.
|
||||
|
||||
#+begin_src tmate
|
||||
sudo apt install --yes yad wlr-randr pulseaudio-module-bluetooth
|
||||
#+end_src
|
||||
|
||||
|
||||
* Optional configuration
|
||||
|
||||
Once the primary setup is complete there is some further customisation I will generally do however these steps are optional.
|
||||
|
||||
** List apt changelogs when upgrading
|
||||
|
||||
Development for linux mobile packages is happening at a fast rate and breaking changes are sometimes introduced. For this reason I like to keep a close eye on package changelogs and get an idea of what is changing before an upgrade.
|
||||
|
||||
To help with this package changelogs can be displayed directly in terminal whenever completing a ~sudo apt upgrade~. Follow the steps below to set this up.
|
||||
|
||||
#+NAME: Install list changes
|
||||
#+begin_src tmate
|
||||
sudo apt install --yes apt-listchanges
|
||||
#+end_src
|
||||
|
||||
#+NAME: Set listchanges config
|
||||
#+begin_src tmate
|
||||
sudo tee /etc/apt/listchanges.conf << EOF
|
||||
[apt]
|
||||
frontend=text
|
||||
which=both
|
||||
email_address=none
|
||||
email_format=text
|
||||
confirm=true
|
||||
headers=false
|
||||
reverse=false
|
||||
save_seen=/var/lib/apt/listchanges.db
|
||||
no_network=false
|
||||
EOF
|
||||
#+end_src
|
||||
|
||||
|
||||
** Disable haptic feedback for on screen keyboard
|
||||
|
||||
I prefer to have no haptic vibration feedback when typing with the on screen keyboard. To disable it run the following:
|
||||
|
||||
#+NAME: Disable haptic feedback
|
||||
#+begin_src tmate
|
||||
gsettings set org.sigxcpu.feedbackd.application:/org/sigxcpu/feedbackd/application/sm-puri-squeekboard/ profile silent
|
||||
#+end_src
|
||||
|
||||
|
||||
** Create app launcher for remote access
|
||||
|
||||
I want a quick and easy way to launch the ~ssh~ and ~cloudflared~ services that I use for remote terminal access to the phone. Additionally this should provide a quick way to disable these services when no longer required, which gives us a battery life improvement.
|
||||
|
||||
To achive this we can create a simple bash script leveraging [[https://manpages.debian.org/testing/yad/yad.1.en.html][yad]]. This will display gtk+ dialogs prompting for user input and return output to the script.
|
||||
|
||||
#+NAME: Create remote access script
|
||||
#+begin_src tmate
|
||||
cat << EOF > ~/Downloads/remote-start.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Prompt for start
|
||||
yad --title "Start remote access." \
|
||||
--text "Remote access via cloudflared and ssh will start once you press Ok." \
|
||||
--button gtk-ok
|
||||
|
||||
# Start services (this will prompt with native dialog for password)
|
||||
systemctl start cloudflared ssh
|
||||
|
||||
# Prompt for end
|
||||
yad --title "End remote access." \
|
||||
--text "Remote access via cloudflared and ssh will end once you press Ok." \
|
||||
--button gtk-ok
|
||||
|
||||
# Stop services (this will prompt with native dialog for password)
|
||||
systemctl stop cloudflared ssh
|
||||
EOF
|
||||
#+end_src
|
||||
|
||||
|
||||
Once the script has been created we can make it executable and test it manually by running the following:
|
||||
|
||||
#+NAME: Execute and test script
|
||||
#+begin_src tmate
|
||||
chmod +x ~/Downloads/remote-start.sh
|
||||
|
||||
cd ~/Downloads && ./remote-start.sh
|
||||
#+end_src
|
||||
|
||||
|
||||
We should see our flow of prompts and the services start and stop as expected. If all is well create a gnome phosh app launcher icon for the script as follows:
|
||||
|
||||
#+NAME: Create app launcher icon
|
||||
#+begin_src tmate
|
||||
cat << EOF > ~/.local/share/applications/remote-access.sh
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Remote access
|
||||
Icon=gnome-power-manager
|
||||
Exec=/home/mobian/Downloads/remote-start.sh
|
||||
Terminal=false
|
||||
EOF
|
||||
#+end_src
|
||||
|
||||
|
||||
Done! You now have a custom app in the launcher to control your remote device access 😎
|
||||
|
||||
|
||||
16
readme.org
16
readme.org
@ -6,9 +6,9 @@
|
||||
|
||||
This document captures my standard tooling for future replication and aims to make it as easy as possible to setup and use a new device with my workflows.
|
||||
|
||||
For the purposes of this repository I broadly refer to tooling as the "standard" way devices are configured and which things are installed that are non-standard to the operating system.
|
||||
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://www.pine64.org/pinephonepro/][PinePhone Pro]] from Pine64 running [[https://mobian-project.org/][Mobian]] ~12~.
|
||||
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,16 +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/humacs/humacs][humacs]]. To pair and share my terminals with others I rely on [[https://tmate.io/][tmate]].
|
||||
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]].
|
||||
|
||||
Working with some clients I also use [[https://code.visualstudio.com/][visual studio code]].
|
||||
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 addons have come and gone but [[https://github.com/gorhill/uBlock][u-block origin]] has remained a constant and something I use everywhere.
|
||||
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]].
|
||||
|
||||
@ -45,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.
|
||||
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.
|
||||
|
||||
300
setup.org
300
setup.org
@ -4,110 +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:
|
||||
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.
|
||||
|
||||
#+NAME: Setup home folder strucuture
|
||||
#+begin_src shell
|
||||
# Ensure we are in our home folder and create required directories
|
||||
cd ~/ && mkdir Documents Downloads
|
||||
#+begin_src tmux
|
||||
brew bundle install --cleanup
|
||||
#+end_src
|
||||
|
||||
|
||||
* Configure apt to use a local mirror
|
||||
* Install flatpak packages
|
||||
|
||||
To speed up how quickly our system can install new or updated packages we should tell ~apt~ to use a mirror here in New Zealand.
|
||||
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.
|
||||
|
||||
#+NAME: Configure local apt mirror
|
||||
#+begin_src tmate
|
||||
# Backup our apt sources configuration before we make changes
|
||||
sudo cp /etc/apt/sources.list.d/official-package-repositories.list /etc/apt/sources.list.d/official-package-repositories.list.bak
|
||||
|
||||
# Replace packages repo with local
|
||||
sudo sed -i 's|https://packages.linuxmint.com|http://ucmirror.canterbury.ac.nz/linux/mint/packages|g' /etc/apt/sources.list.d/official-package-repositories.list
|
||||
|
||||
# Replace base repo with local
|
||||
sudo sed -i 's|https://archive.ubuntu.com/ubuntu|http://ucmirror.canterbury.ac.nz/ubuntu|g' /etc/apt/sources.list.d/official-package-repositories.list
|
||||
#+begin_src
|
||||
while read line; do flatpak install --assumeyes `echo $line | awk '{print $2}'`; done < Flatfile
|
||||
#+end_src
|
||||
|
||||
|
||||
* Install base packages
|
||||
|
||||
Now that we have our ~apt~ package manager configured let's install the standard packages we use.
|
||||
|
||||
#+begin_src tmate
|
||||
sudo apt install --yes htop screenfetch git curl wget xclip emacs xterm xtermcontrol jq tmux tmate apt-transport-https dict
|
||||
#+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 tmate
|
||||
# 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
|
||||
#+end_src
|
||||
|
||||
|
||||
When working with kubernetes applications we often use [[https://helm.sh][helm]], unfortunately we need an extra ~apt~ repository for this so let's add that now and install.
|
||||
|
||||
#+NAME: Install helm
|
||||
#+BEGIN_SRC tmate
|
||||
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
|
||||
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
|
||||
sudo apt-get update && sudo apt install -y helm
|
||||
#+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 tmate
|
||||
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
|
||||
#+begin_src tmate
|
||||
# Download the latest release
|
||||
wget "https://vault.bitwarden.com/download/?app=cli&platform=linux" --output-document "bw.zip"
|
||||
The ~bw~ utility should already be installed as part of our homebrew packages. Let's login now.
|
||||
|
||||
# Unzip and install the latest release
|
||||
unzip "bw.zip" && sudo install "bw" "/usr/local/bin" && rm "bw" "bw.zip"
|
||||
|
||||
# Login to bitwarden
|
||||
#+NAME: Login to bitwarden
|
||||
#+begin_src tmux
|
||||
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 tmate
|
||||
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.
|
||||
|
||||
@ -123,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}
|
||||
@ -135,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.
|
||||
|
||||
@ -158,92 +94,55 @@ 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 tmate
|
||||
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl
|
||||
|
||||
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
|
||||
|
||||
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
|
||||
|
||||
sudo apt-get update && sudo apt-get install -y 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 tmate
|
||||
#+BEGIN_src tmux
|
||||
# Download the sdk archive
|
||||
curl -o gcpsdk.tar -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-375.0.0-linux-x86_64.tar.gz
|
||||
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
|
||||
sudo tar xvf gcpsdk.tar -C /usr/local/ && rm gcpsdk.tar
|
||||
|
||||
# Correct folder permissions
|
||||
sudo chown -R $USER:$USER /usr/local/google-cloud-sdk
|
||||
mkdir /home/${USER}/.var/bin && tar xvf gcpsdk.tar -C /home/${USER}/.var/bin && rm gcpsdk.tar
|
||||
|
||||
# Run the install script
|
||||
/usr/local/google-cloud-sdk/install.sh
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS: Install google cloud sdk
|
||||
#+begin_example
|
||||
#+end_example
|
||||
|
||||
|
||||
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]].
|
||||
|
||||
#+NAME: Install amazon web services cli
|
||||
#+BEGIN_SRC tmate
|
||||
# Download the binary
|
||||
cd ~/Downloads/
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
|
||||
# Install
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install
|
||||
|
||||
# Clean up
|
||||
rm -rf ~/Downloads/aws*
|
||||
/home/${USER}/.var/bin/google-cloud-sdk/install.sh
|
||||
#+END_SRC
|
||||
|
||||
|
||||
** Optional - Nodejs dev tooling
|
||||
** Optional - Setup doom emacs
|
||||
|
||||
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>.
|
||||
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 nodejs
|
||||
#+BEGIN_SRC tmate
|
||||
# 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 -
|
||||
#+NAME: Install and configure doom
|
||||
#+BEGIN_src tmux
|
||||
# Install doom emacs
|
||||
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
|
||||
~/.config/emacs/bin/doom install
|
||||
|
||||
# Install the nodejs package via apt
|
||||
sudo apt-get install -y nodejs
|
||||
# Copy in my configuration
|
||||
cp /home/${USER}/Documents/doom/* /home/${USER}/.config/doom/
|
||||
|
||||
# Install yarn dependency manager
|
||||
sudo npm install --global yarn
|
||||
# Doom sync to finalise
|
||||
doom sync
|
||||
#+END_SRC
|
||||
|
||||
|
||||
** Optional - Install hardware drivers
|
||||
Included in this repository is a ~doom/~ subdirectory which layers my personal preferences on top of doom.
|
||||
|
||||
|
||||
** Optional - Setup humacs editor
|
||||
** Optional - setup tmux plugin manager
|
||||
|
||||
An integral part of our pair development workflow is [[https://github.com/humacs/humacs][humacs]]. Below are the instructions to set this up.
|
||||
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.
|
||||
|
||||
#+NAME: Install and configure humacs
|
||||
#+BEGIN_SRC tmate
|
||||
# Clone down humac[s
|
||||
git clone --recursive https://github.com/jmhbnz/humacs /home/$USER/Downloads/
|
||||
#+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
|
||||
|
||||
# Need to ensure environment variables are set for load path
|
||||
export EMACSLOADPATH=/home/$USER/Downloads/humacs
|
||||
#+END_SRC
|
||||
# Source the tmux configuration file
|
||||
tmux source ~/.tmux.conf
|
||||
#+end_src
|
||||
|
||||
|
||||
** Optional - Setup sbp powerline prompt
|
||||
@ -254,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 tmate
|
||||
# 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 tmate
|
||||
#+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
|
||||
@ -281,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'
|
||||
@ -327,82 +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 tmate
|
||||
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 tmate
|
||||
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
|
||||
#+begin_src tmate
|
||||
# Ensure pre-requisites are installed
|
||||
sudo apt install curl build-essential gcc make -y
|
||||
#+end_src
|
||||
|
||||
#+NAME: Install rust via helper script
|
||||
#+begin_src tmate
|
||||
# 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 tmate
|
||||
rustc -V && cargo -V
|
||||
#+NAME: Rename bluetooth devices
|
||||
#+begin_src tmux
|
||||
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 - Bluetooth manual pairing
|
||||
** Optional - disable sleep
|
||||
|
||||
Using linux across all my devices has been pretty smooth however I have one annoyance with bluetooth on my HP Envy x360 ultrabook (model 13-ag0015AU). On that device I can't pair my Logitech k380 keyboard with the user interface, via either ~blueberry~ or ~blueman~.
|
||||
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.
|
||||
|
||||
To work around this I found some excellent documentation on the Arch Linux wiki for [[https://wiki.archlinux.org/title/Bluetooth#Pairing][manually pairing]] with ~bluetoothctl~.
|
||||
|
||||
The steps I follow to manually pair are:
|
||||
|
||||
#+NAME: Manually pair keyboard
|
||||
#+begin_src tmate
|
||||
# Enter bluetoothctl interactive prompt
|
||||
bluetoothctl
|
||||
|
||||
# Ensure laptop can pair
|
||||
pairable on
|
||||
|
||||
# Scan for devices
|
||||
scan on
|
||||
|
||||
# Pair with the keyboard
|
||||
pair 34:88:5D:D6:A6:2B
|
||||
|
||||
# Trust the keyboard
|
||||
trust 34:88:5D:D6:A6:2B
|
||||
|
||||
# Connect to the keyboard
|
||||
connect 34:88:5D:D6:A6:2B
|
||||
#+NAME: Disable sleep
|
||||
#+begin_src bash
|
||||
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
|
||||
#+end_src
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
#+DATE: 25th January 2022
|
||||
|
||||
|
||||
I use [[https://obsproject.com][Open Broadcast Studio]] in Linux Mint to manage my audio and video devices for virtual meetings which drastically improves my video and audio quality. This page documents how I set up and the configuration I use.
|
||||
I use [[https://obsproject.com][Open Broadcast Studio]] to manage my audio and video devices for virtual meetings which drastically improves my video and audio quality. This page documents how I set up and the configuration I use.
|
||||
|
||||
Note: For audio hardware I generally rely on [[https://www.bluemic.com/en-us/products/yeti-nano/][Blue Yeti Nano]] microphones and [[https://electronics.sony.com/audio/headphones/headband/p/wh1000xm4-b][Sony WH-1000XM]] bluetooth headphones.
|
||||
Note: For audio hardware I generally rely on [[https://www.bluemic.com/en-us/products/yeti-nano/][Blue Yeti Nano]] microphones and [[https://electronics.sony.com/audio/headphones/headband/p/wh1000xm4-b][Sony WH-1000XM]] bluetooth headphones, for a camera I've recently moved to the [[https://www.logitech.com/en-au/products/webcams/brio-4k-hdr-webcam.960-001105.html][Logitech Brio 4k]].
|
||||
|
||||
|
||||
* Install obs
|
||||
@ -14,7 +14,7 @@ Note: For audio hardware I generally rely on [[https://www.bluemic.com/en-us/pro
|
||||
To get started install obs including all dependencies required using the steps below:
|
||||
|
||||
#+NAME: Install open broadcast studio dependencies
|
||||
#+begin_src tmate
|
||||
#+begin_src tmux
|
||||
# Install dependencies first
|
||||
sudo apt install --yes ffmpeg v4l2loopback-dkms
|
||||
|
||||
@ -26,7 +26,7 @@ sudo add-apt-repository ppa:obsproject/obs-studio
|
||||
#+end_src
|
||||
|
||||
#+NAME: Install open broadcast studio
|
||||
#+begin_src tmate
|
||||
#+begin_src tmux
|
||||
# Install open broadcast studio
|
||||
sudo apt update && sudo apt install --yes obs-studio
|
||||
#+end_src
|
||||
@ -38,7 +38,7 @@ sudo apt update && sudo apt install --yes obs-studio
|
||||
Before we get underway we also install the StreamFX plugin for OBS so we can blur backgrounds without a greenscreen. Follow the steps below to install the plugin:
|
||||
|
||||
#+NAME: Install streamfx plugin
|
||||
#+begin_src tmate
|
||||
#+begin_src tmux
|
||||
# Ensure the plugin directory exists
|
||||
mkdir --parents ~/.config/obs-studio && cd ~/.config/obs-studio
|
||||
|
||||
@ -62,7 +62,7 @@ unzip -o streamfx.zip && rm streamfx.zip
|
||||
To control improve the quality of our audio we use a virtual audio output device, this allows us to take raw audio input from a microphone, apply filters and enhancements in obs, then output the enhanced audio to the virtual meeting software as a virtual microphone.
|
||||
|
||||
#+NAME: Create virtual audio devices
|
||||
#+begin_src tmate
|
||||
#+begin_src tmux
|
||||
# Create the virtual speaker
|
||||
pactl load-module module-null-sink sink_name=Source sink_properties=device.description=VirtualSpeaker
|
||||
|
||||
@ -80,7 +80,7 @@ The code snippet above sets up virtual audio devices for our current session onl
|
||||
To make it permanent we need to save the configuration to a file in our home directory.
|
||||
|
||||
#+NAME: Save virtual audio device configuration
|
||||
#+begin_src tmate
|
||||
#+begin_src tmux
|
||||
# Ensure required directory exists
|
||||
mkdir --parents ~/.config/pulse
|
||||
|
||||
@ -117,7 +117,7 @@ Once obs is installed we can launch it with the command below. The setup wizard
|
||||
If you see that option, select it; once you get to the main OBS Studio screen, you should now see a button in the bottom right, "Start Virtual Camera".
|
||||
|
||||
#+NAME: Run open broadcast studio
|
||||
#+begin_src tmate
|
||||
#+begin_src tmux
|
||||
obs&
|
||||
#+end_src
|
||||
|
||||
@ -129,7 +129,7 @@ Our final step to get up and running is to restore our "Profile" and "Scene Coll
|
||||
You can use the snippet below to check the contents of the files.
|
||||
|
||||
#+NAME: Show included configuration files
|
||||
#+begin_src tmate
|
||||
#+begin_src tmux
|
||||
# Show contents of profile ini file
|
||||
cat ~/Documents/tooling/streaming/basic.ini
|
||||
|
||||
|
||||
Reference in New Issue
Block a user