Compare commits

...

123 Commits

Author SHA1 Message Date
f89791d7ff Cleanup and improve .bashrc. 2025-10-09 23:22:09 +13:00
4ee8c17fad Add dysk to Brewfile. 2025-10-09 23:20:55 +13:00
0f6197f4e2 Add instructions for disabling sleep. 2025-09-17 11:55:32 +12:00
c822db6021 Added bluetooth bulk device renaming. 2025-09-17 08:02:07 +12:00
9bc911a665 Remove defunct directories. 2025-09-17 07:44:15 +12:00
edeb664f73 Add --cleanup flag for brew bundle install. 2025-09-17 07:38:38 +12:00
3b454065ae Add gpgme to Brewfile. 2025-09-17 07:32:41 +12:00
dab4201158 Add podman-compose to Brewfile. 2025-09-17 07:28:24 +12:00
906b218136 Update go to 1.24 in Brewfile. 2025-08-25 14:40:23 +12:00
e29003e594 Retrieve totp in background for performance in .bashrc. 2025-08-18 11:21:35 +12:00
ed94e2047a Add qFlipper to Flatfile. 2025-07-31 07:35:53 +12:00
0e9151390b Swap remmina for thincast client in Flatfile. 2025-07-31 07:35:22 +12:00
59db8935ca Add raspberry pi imager to Flatfile. 2025-07-29 09:15:41 +12:00
2ee44c4120 Use machine hostname as identifier for retrieving key from bw. 2025-07-24 14:08:29 +12:00
edd55b23fa Add virtctl to Brewfile. 2025-06-27 12:57:29 +12:00
ff721a399e Add .kuberc for kubectl user preferences. 2025-06-25 14:32:22 +12:00
195b032b05 Update readme.org to switch from Ubuntu Touch to LineageOS. 2025-06-23 20:40:33 +12:00
3c82eca615 Remove bw alias in .bashrc.
Node deprecation flag no longer required.
2025-06-23 09:18:14 +12:00
7ce4beaa61 Add krew plugins to path in .bashrc. 2025-05-13 23:06:06 +12:00
8f49df5fb1 Add krew to Brewfile. 2025-05-13 23:01:51 +12:00
1a0f8d5d0c Configure mutt to always include messages when replying. 2025-05-08 09:45:54 +12:00
ad0ff1e15e Add bluetooth helper functions to .bashrc. 2025-05-01 07:50:54 +12:00
743ea12eea Remove old go versions from Brewfile. 2025-04-19 22:35:30 +12:00
c02c6ef3c9 Add kn to Brewfile. 2025-04-14 11:02:11 +12:00
1697c94dd9 Handle .pdf and .png attachments in .muttmailcap. 2025-03-08 11:39:09 +13:00
cde4685bb0 Switch from firefox to zen browser. 2025-03-03 10:52:17 +13:00
f5fae9ef1c Turn off threading in .muttrc. 2025-02-28 22:22:19 +13:00
a1c2bcafac Automate installing flatpaks from Flatfile. 2025-01-29 12:36:04 +13:00
c43b1467eb Update noscript config as code. 2025-01-29 12:15:00 +13:00
823adda10c Add goreman and roxctl to Brewfile. 2025-01-27 15:36:13 +13:00
127f07ae1f Add Remmina and VLC to Flatfile. 2025-01-26 10:28:43 +13:00
aa9fb4548b Add jpeg image handler in .muttmailcap. 2025-01-03 20:23:31 +13:00
4f94a072e3 Add urlscan to Brewfile. 2024-12-20 11:07:26 +13:00
41456ca499 Fix mutt smtp url.
Signed-off-by: James Blair <mail@jamesblair.net>
2024-12-19 17:02:57 +13:00
15483e4e0f Add lynx to Brewfile. 2024-12-08 13:26:11 +13:00
52e766899f Fix muttmailcap path in .muttrc. 2024-12-08 13:25:54 +13:00
918fc0c638 Add dracula config for tmux. 2024-12-08 12:55:34 +13:00
a8eeedf9d5 Add dracula theme to .muttrc.
Also fixed mailbox server address.
2024-12-08 12:54:43 +13:00
e04a92cfd0 Document setting up tmux plugin manager. 2024-12-08 12:32:08 +13:00
4cec5bf337 Add mutt to Brewfile. 2024-12-08 12:14:05 +13:00
6250dcfa89 Ensure ~/.var/bin exists for binary installs. 2024-12-08 12:08:44 +13:00
444363d6ef Remove powerline fonts setup. 2024-12-08 12:05:35 +13:00
f20ce37c15 Improve flow for setting up doom. 2024-12-08 12:00:48 +13:00
06c81ee085 Add polychromatic to Flatfile. 2024-12-08 11:52:07 +13:00
758892595d Add nmap to Brewfile. 2024-11-11 10:32:26 +13:00
785ea21020 Update noscript config as code. 2024-11-02 00:37:42 +13:00
cc4cec8609 Update go to 1.21 in Brewfile. 2024-10-22 07:01:46 +13:00
b7a5f97bf7 Update noscript config as code. 2024-10-06 08:05:20 +13:00
220728d9ec Add git-absorb to Brewfile. 2024-09-26 13:10:23 +12:00
ad69f2d36f Keep readme up to date. 2024-09-17 16:13:02 +12:00
8d9a9066e2 Add go 1.22 to Brewfile. 2024-09-16 11:51:50 +12:00
e9dd5e4a7c Add media write and Chromium codecs to Flatfile. 2024-09-11 04:14:51 +12:00
58d213c5f0 Update noscript config as code. 2024-09-05 13:47:38 +12:00
0a9ccb9a7f Add azure-cli to Brewfile. 2024-09-05 12:46:50 +12:00
21132c2062 Add markdownlint global dotfile. 2024-08-26 14:59:21 +12:00
8e38e0c7dd Add kwok to Brewfile. 2024-08-14 16:11:07 +12:00
1d4fc8d8aa Wrap ssh auth sock set in conditional to prevent early exits. 2024-08-14 16:04:55 +12:00
4eef245d6b Add npm-check-updates to Brewfile. 2024-08-14 12:28:37 +12:00
2464f92cfe Update noscript config as code. 2024-08-14 12:26:52 +12:00
b5fb0add24 Remove defunct prompt coloring function. 2024-08-14 11:00:00 +12:00
e4f12c16b5 Move custom git credential helper from .bashrc to .gitconfig. 2024-08-14 10:30:33 +12:00
7be5292542 Tidy .bashrc to prevent output on new windows. 2024-08-14 09:42:10 +12:00
c1763ba31e Add obs to Flatfile. 2024-08-12 21:38:50 +12:00
496a93080c Add kind to Brewfile. 2024-08-12 14:43:58 +12:00
efa71ca473 Add golangci-lint to Brewfile. 2024-08-12 14:17:37 +12:00
ccda8a92f9 Updated powerline and sbp setup for bluefin. 2024-08-12 09:34:16 +12:00
d23c310454 Add markdownlint-cli2 to Brewfile. 2024-08-08 21:56:48 +12:00
4ccfa0f8d5 Add a flatfile to track flatpaks. 2024-08-08 21:56:36 +12:00
c725c67bbb Updated firefox noscript configuration. 2024-07-29 11:28:11 +12:00
7efa1984c2 Add awscli, node, dict, kubectl and screenfetch to Brewfile. 2024-07-29 06:42:36 +12:00
48cca56e6c Rewrite setup.org for Bluefin. 2024-07-29 06:41:33 +12:00
99999fbdc3 Remove defunct .humacs-custom.el. 2024-07-29 06:41:03 +12:00
b5e1d7c411 Update noscript whitelist. 2024-07-23 14:07:14 +12:00
465604af77 Add cekit and git-lfs to Brewfile. 2024-07-23 13:29:43 +12:00
eb92c80b0c Track noscript configuration. 2024-07-23 13:27:31 +12:00
f560a829ca Overhaul gitconfig. 2024-07-23 13:27:14 +12:00
488c0fa680 Add rosa cli to Brewfile. 2024-07-02 08:27:26 +12:00
27f40b0050 Add markdownlint and ocm to Brewfile. 2024-07-02 07:32:27 +12:00
d408c90c4b Add etcd dev lint tools to Brewfile. 2024-06-30 06:09:04 +12:00
793d15a9a2 Update askpass tweaks for .gitconfig. 2024-06-29 16:58:09 +12:00
42a89ca91b Add docker alias and gcp sdk completion to .bashrc. 2024-06-29 16:57:06 +12:00
abc5692be6 Update google-cloud-sdk instructions for bluefin. 2024-06-29 16:52:14 +12:00
4b736f8315 Add gcc and go multi version to Brewfile. 2024-06-29 12:34:20 +12:00
64583007bc Disable gui prompts for git password. 2024-06-26 10:17:19 +12:00
2b67d89f8f Update .bashrc to reflect new go path and disable node spam. 2024-06-24 11:16:18 +12:00
6a4e01e8fb Add pcre and helm to Brewfile. 2024-06-23 13:18:25 +12:00
33ca651599 Add cloudflared, go, openshift-cli and sshfs to Brewfile. 2024-06-23 11:37:08 +12:00
b2769ddf65 Added initial brewfile. 2024-06-17 20:26:46 +12:00
696abf03ed Fix fzf key bindings. 2024-06-17 20:15:49 +12:00
fdb8b1a194 Auto generate new random pw if not supplied. 2024-03-27 03:44:40 +13:00
2ad2725fa0 Update installed version of gcp sdk. 2024-03-19 18:10:37 +13:00
574397c6e1 Update kubectl install instructions. 2024-03-18 15:17:21 +13:00
d519a13286 Update overview for migration to fairphone and doom emacs. 2024-02-17 20:55:54 +13:00
f95eed937c Install helm from github latest release not snap. 2024-01-20 10:37:56 +13:00
216df269ed Update golang install location in .bashrc. 2024-01-20 10:37:34 +13:00
cc0eb52561 Switch to new doom theme and change org dir. 2024-01-08 15:56:14 +13:00
78c05b072e Remove tmate as it is no longer maintained. 2023-12-23 08:25:37 +13:00
1303094e91 Add support for mdx files in doom config. 2023-12-04 18:26:59 +13:00
e4e5f91b44 Begin document for fairphone 4. 2023-11-03 16:49:59 +13:00
fbd1f6fca5 Added git alias to clear merged branches. 2023-10-30 16:18:05 +13:00
e6d5aa3472 Override color for comments in doom theme. 2023-10-30 16:12:37 +13:00
78e05345e7 Removed redundant manual bluetooth section. 2023-10-15 21:29:50 +13:00
eb296158f8 Switch to tmux as default terminal multiplexer. 2023-09-08 10:39:47 +12:00
8ab535f06e Working doom config for ob-tmux. 2023-09-06 17:32:21 +12:00
d221812cf7 Start adding ob-tmux to doom config. 2023-09-05 07:28:45 +12:00
9fde83fc09 Add mouse scroll for doom. 2023-08-03 11:19:49 +12:00
503fbca272 Use emacsclient with doom. 2023-07-30 08:23:49 +12:00
b6204e7d5e Add initial doom configuration. 2023-07-30 07:50:28 +12:00
3fd48e1e8c Pinephone pro camera now works out of the box. 2023-07-29 22:36:25 +12:00
fec04a2c36 Switch from htop to btop for standard tooling. 2023-07-19 09:35:39 +12:00
578cd49633 Remove extraneous comments from bwai function. 2023-06-08 09:55:27 +12:00
387b8bbfeb Added bw helper function for adding items. 2023-06-07 16:19:02 +12:00
dac3a3ca12 Updated bashrc for doom migration. 2023-05-04 20:40:12 +12:00
f12f909ca9 Ensure go is added to path automatically. 2023-03-24 08:39:31 +13:00
666b61828a Write to history file immediately. 2023-03-22 11:17:46 +13:00
551e7be5a3 Add fzf to my tooling workflow. 2023-03-22 09:59:34 +13:00
63de85e570 Added automated totp followup for bwgp helper. 2023-03-19 21:31:12 +13:00
3f9bd1ef16 Added unrar to standard packages. 2023-03-08 20:24:51 +13:00
cc27d929b4 Fix erroneous dash in cpmd for bw helpers. 2023-03-07 18:47:35 +13:00
4b58ae01e6 Add github cli to standard packages. 2023-03-07 18:44:13 +13:00
fb9c270bef Add alias for emacsclient and explain custom. 2023-03-07 07:58:33 +13:00
43ed1dbb03 Fix indentation in .gitconfig. 2023-03-05 09:58:24 +13:00
1f26391994 Document camera being used. 2023-03-05 09:51:25 +13:00
19 changed files with 836 additions and 408 deletions

227
.bashrc
View File

@ -1,100 +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
# Custom git alias for pushing to all remotes at once
alias gpa='git remote | xargs -L1 git push --all'
# Alias cat to bat
if [ "$(command -v bat)" ]; then
alias cat='bat --style=plain --pager=never' 2>/dev/null
fi
# simplify bitwarden cli usage
cpcmd="xclip -selection -c"; if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then cpcmd="wl-copy"; 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" | $cpcmd; }
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}' | $cpcmd; }
function bwgu () { local test=$(export BW_SESSION=~/.bw_session) && bw get username "$1" | $cpcmd; }
# 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
# Custom function for creating new entries
function bwai () {
if [[ "$1" == "get" ]]; then
read -r line
while [ -n "$line" ]; do
key=${line%%=*}
value=${line#*=}
params[$key]=$value
read -r line
done
# 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
if [[ "${params['protocol']}" != "https" ]]; then
exit
fi
# Use a generated password if none supplied
local pass="${3:-$(tr -dc A-Za-z0-9 </dev/urandom | head -c 20; echo)}"
if [[ -z "${params["host"]}" ]]; then
exit
fi
# Pad the url with required json
bw_uris=$(bw get template item.login.uri | jq ".match="0" | .uri=\"${4}\"" | jq -c)
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
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
}
# 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'
# 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
@ -103,33 +99,44 @@ if ! shopt -oq posix; then
fi
fi
# Configure emacs location
export EMACSLOADPATH=~/Downloads/humacs:
# Configure fuzzy find
export FZF_DEFAULT_COMMAND="rg --files --follow --no-ignore-vcs --hidden -g '!{**/node_modules/*,**/.git/*,**.emacs.d/*}'"
eval "$(fzf --bash)"
# 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 "
# Configure emacs location and aliases
export PATH=$PATH:/home/james/.config/emacs/bin/
alias emacs="emacsclient -nw -a 'doom run --bg-daemon && emacsclient -nw'"
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
@ -137,27 +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
# This isn't working properly yet!
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

View File

@ -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

View File

@ -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
View 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
View File

@ -0,0 +1,5 @@
{
"default": true,
"MD013": false,
"whitespace": false
}

View File

@ -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
View File

@ -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
#================================================================

View File

@ -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
View 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
View 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
View 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
View 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
View 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
View 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
View 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)

View File

@ -6,7 +6,7 @@
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 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.
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.
@ -203,28 +203,3 @@ EOF
Done! You now have a custom app in the launcher to control your remote device access 😎
** Custom camera application
The pinephone pro generally uses the [[https://gitlab.com/postmarketOS/megapixels][megapixels]] application for users interacting with the front and rear cameras.
This works out of the box on the original pinephone, however for the pinephone pro a custom build of megapixels is required:
Run the code block below to clone, compile and install the custom megapixels build:
#+NAME: Compile and install custom megapixels
#+begin_src tmate
git clone https://github.com/kgmt0/megapixels -b linux-megi-6.1 && cd megapixels && wget http://deb.debian.org/debian/pool/main/m/megapixels/megapixels_1.6.0-1.debian.tar.xz && tar -xvf megapixels_1.6.0-1.debian.tar.xz && sudo apt build-dep . && dpkg-buildpackage -b -rfakeroot -us -uc && cd .. && sudo dpkg -i megapixels_1.6.0-1_arm64.deb
#+end_src
Once the custom megapixels build is installed and the phone has been rebooted the megapixels app will launch successfully and take photos, however these will be washed out with a green color.
To fix this we can update the script the megapixels app uses to postprocess images that are taken, refer [[https://forum.pine64.org/showthread.php?tid=17711&pid=115439#pid115439][here]]. Run the block below to address this:
#+NAME: Update post processing script
#+begin_src tmate
sudo cp /usr/share/megapixels/postprocess.sh /usr/share/megapixels/postprocess.sh.bak
sudo sed -i 's/$DCRAW +M -H 4 -o 1 -q 3 -T "$@" "$MAIN_PICTURE.dng"/$DCRAW +M -H 4 -o 1 -q 3 -n 300 -a -m 0 -g 2.4 12.92 -b 1.0 -T "$@" "$MAIN_PICTURE.dng"./' /usr/share/megapixels/postprocess.sh
#+end_src

View File

@ -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://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 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]].
@ -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, including an implementation of a custom git credential cache to dynamically retrieve git https credentials from bitwarden.

283
setup.org
View File

@ -4,93 +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
* Install base packages
* Install flatpak packages
Now that we have our home directory done let's install the standard packages we use.
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.
#+begin_src tmate
sudo apt install --yes htop nvtop screenfetch git curl wget xclip wl-clipboard xsel 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
#+begin_src
while read line; do flatpak install --assumeyes `echo $line | awk '{print $2}'`; done < Flatfile
#+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.
@ -106,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}
@ -118,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.
@ -141,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
@ -237,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
@ -264,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'
@ -310,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

View File

@ -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