Compare commits
101 Commits
78e05345e7
...
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 |
183
.bashrc
183
.bashrc
@ -1,47 +1,61 @@
|
|||||||
# ==============================================================================
|
|
||||||
# Personal $HOME/.bashrc file by James Blair <mail@jamesblair.net>
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[ -z "$PS1" ] && return
|
[ -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
|
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
|
# Also ensure we write to history immediately instead of only on terminal close
|
||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
export PROMPT_COMMAND="history -a; history -n"
|
export PROMPT_COMMAND="history -a; history -n"
|
||||||
|
|
||||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
# Retain infinite bash history
|
||||||
HISTSIZE=10000
|
HISTSIZE=-1
|
||||||
HISTFILESIZE=20000
|
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.
|
# update the values of LINES and COLUMNS.
|
||||||
shopt -s checkwinsize
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# enable color support of ls and also add handy aliases
|
# Alias ls to eza
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
if [ "$(command -v eza)" ]; then
|
||||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
alias ll='eza -l --icons=auto --group-directories-first'
|
||||||
alias ls='ls -l --color=auto -h --group-directories-first'
|
alias ls='eza -l --icons=auto --group-directories-first'
|
||||||
alias ll='ls -l --color=auto -h --group-directories-first'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Custom git alias for pushing to all remotes at once
|
# Alias cat to bat
|
||||||
alias gpa='git remote | xargs -L1 git push --all'
|
if [ "$(command -v bat)" ]; then
|
||||||
|
alias cat='bat --style=plain --pager=never' 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# simplify bitwarden cli usage
|
# 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
|
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)'
|
alias bwu='export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)'
|
||||||
|
|
||||||
function bwgp () {
|
function bwgp () {
|
||||||
local test=$(export BW_SESSION=~/.bw_session) && bw get password "$1" | $cpcmd;
|
|
||||||
|
|
||||||
# If the login has a totp associated we should leave a follow-up prompt for it
|
# Retrieve full json
|
||||||
if totp=$(bw get totp "$1"); then
|
local test
|
||||||
read -p "Press enter when ready for totp"
|
test=$(eval $(export BW_SESSION=~/.bw_session) && bw get item "${1}");
|
||||||
echo "${totp}" | $cpcmd
|
|
||||||
|
# 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
|
fi
|
||||||
}
|
}
|
||||||
function bwgt () { local test=$(export BW_SESSION=~/.bw_session) && bw get totp "$1" | $cpcmd; }
|
function bwgt () { local test=$(export BW_SESSION=~/.bw_session) && bw get totp "$1" | $cpcmd; }
|
||||||
@ -54,76 +68,29 @@ function bwgu () { local test=$(export BW_SESSION=~/.bw_session) && bw get usern
|
|||||||
function bwai () {
|
function bwai () {
|
||||||
|
|
||||||
# Verify enough parameters are supplied
|
# Verify enough parameters are supplied
|
||||||
if [ "$#" -lt "3" ]; then
|
if [ "$#" -lt "2" ]; then
|
||||||
echo 'Ensure all required parameters are supplied:'
|
echo 'Ensure all required parameters are supplied:'
|
||||||
echo ' $1 = Name for item'
|
echo ' $1 = Name for item'
|
||||||
echo ' $2 = Username for item'
|
echo ' $2 = Username for item'
|
||||||
echo ' $3 = Secret for item'
|
echo ' $3 = Secret for item (optional)'
|
||||||
echo ' $4 = Url for item (optional)'
|
echo ' $4 = Url for item (optional)'
|
||||||
return 2
|
return 2
|
||||||
fi
|
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
|
# Pad the url with required json
|
||||||
bw_uris=$(bw get template item.login.uri | jq ".match="0" | .uri=\"${4}\"" | jq -c)
|
bw_uris=$(bw get template item.login.uri | jq ".match="0" | .uri=\"${4}\"" | jq -c)
|
||||||
|
|
||||||
bw get template item | \
|
bw get template item | \
|
||||||
jq ".name=\"${1}\" | \
|
jq ".name=\"${1}\" | \
|
||||||
.login=$(bw get template item.login | jq ".username=\"${2}\" | .password=\"${3}\" | .uris=[${bw_uris}] | .totp=null")" | \
|
.login=$(bw get template item.login | jq ".username=\"${2}\" | .password=\"${pass}\" | .uris=[${bw_uris}] | .totp=null")" | \
|
||||||
jq '.notes=null' | \
|
jq '.notes=null' | \
|
||||||
bw encode | bw create item && bw sync
|
bw encode | bw create item && bw sync
|
||||||
}
|
}
|
||||||
|
|
||||||
# custom git credential cache implementation for bitwarden
|
# Enable programmable completion features
|
||||||
# https://github.com/bitwarden/cli/blob/master/examples/git-credential-bw.sh
|
|
||||||
function bw_gitea () {
|
|
||||||
declare -A params
|
|
||||||
|
|
||||||
if [[ "$1" == "get" ]]; then
|
|
||||||
read -r line
|
|
||||||
while [ -n "$line" ]; do
|
|
||||||
key=${line%%=*}
|
|
||||||
value=${line#*=}
|
|
||||||
params[$key]=$value
|
|
||||||
read -r line
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ "${params['protocol']}" != "https" ]]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "${params["host"]}" ]]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! bw list items --search "asdf" > /dev/null 2>&1; then
|
|
||||||
echo "Please login to Bitwarden to use git credential helper" > /dev/stderr
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
id=$(bw list items --search "${params["host"]}"|jq ".[] | select(.name == \"${params["host"]}\").id" -r)
|
|
||||||
|
|
||||||
if [[ -z "$id" ]]; then
|
|
||||||
echo "Couldn't find item id in Bitwarden DB." > /dev/stderr
|
|
||||||
echo "${params}"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
user=$(bw get username "${id}")
|
|
||||||
pass=$(bw get password "${id}")
|
|
||||||
|
|
||||||
if [[ -z "$user" ]] || [[ -z "$pass" ]]; then
|
|
||||||
echo "Couldn't find host in Bitwarden DB." > /dev/stderr
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo username="$user"
|
|
||||||
echo password="$pass"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# enable programmable completion features (you don't need to enable
|
|
||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
||||||
# sources /etc/bash.bashrc).
|
|
||||||
if ! shopt -oq posix; then
|
if ! shopt -oq posix; then
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
. /usr/share/bash-completion/bash_completion
|
. /usr/share/bash-completion/bash_completion
|
||||||
@ -134,12 +101,11 @@ fi
|
|||||||
|
|
||||||
# Configure fuzzy find
|
# Configure fuzzy find
|
||||||
export FZF_DEFAULT_COMMAND="rg --files --follow --no-ignore-vcs --hidden -g '!{**/node_modules/*,**/.git/*,**.emacs.d/*}'"
|
export FZF_DEFAULT_COMMAND="rg --files --follow --no-ignore-vcs --hidden -g '!{**/node_modules/*,**/.git/*,**.emacs.d/*}'"
|
||||||
source /usr/share/doc/fzf/examples/key-bindings.bash
|
eval "$(fzf --bash)"
|
||||||
|
|
||||||
# Configure emacs location and aliases
|
# Configure emacs location and aliases
|
||||||
export PATH=$PATH:/home/james/.config/emacs/bin/
|
export PATH=$PATH:/home/james/.config/emacs/bin/
|
||||||
alias emacs="emacsclient -nw -a 'doom run --bg-daemon && emacsclient -nw'"
|
alias emacs="emacsclient -nw -a 'doom run --bg-daemon && emacsclient -nw'"
|
||||||
alias nano="emacsclient -nw -a 'doom run --bg-daemon' && emacsclient -nw"
|
|
||||||
|
|
||||||
function e {
|
function e {
|
||||||
|
|
||||||
@ -153,51 +119,60 @@ function e {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Configure go location
|
# Configure go location
|
||||||
export PATH=$PATH:/usr/local/go/bin
|
export PATH=$PATH:/var/home/james/go/bin
|
||||||
export PATH=$PATH:/home/$USER/go/bin/
|
|
||||||
|
|
||||||
# Setup prompt
|
# If ssh-agent is not already running
|
||||||
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 "
|
|
||||||
}
|
|
||||||
|
|
||||||
color_my_prompt
|
|
||||||
|
|
||||||
# Configure ssh-agent
|
|
||||||
if [ -z "$(pgrep ssh-agent)" ]; then
|
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
|
eval $(ssh-agent -s) > /dev/null
|
||||||
else
|
else
|
||||||
|
# Set pid + auth sock to ensure existing ssh-agent will be re-used
|
||||||
export SSH_AGENT_PID=$(pgrep ssh-agent)
|
export SSH_AGENT_PID=$(pgrep ssh-agent)
|
||||||
|
if [ -d "/tmp/ssh" ]; then
|
||||||
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
|
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# If ssh-agent has no identities, add mine
|
# If ssh-agent has no identities, add mine
|
||||||
ssh-add -l &>/dev/null
|
ssh-add -l &>/dev/null
|
||||||
if [ "$?" == 1 ]; then ssh-add ~/.ssh/$USER; fi
|
if [ "$?" == 1 ]; then ssh-add ~/.ssh/$USER; fi
|
||||||
|
|
||||||
# Remove bitwarden sessions older than a day
|
# 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 we have a bitwarden session file available set from it
|
||||||
if [ -n "$BW_SESSION" ]; then echo "Bitwarden set";
|
if [ -f ~/.bw_session ]; then export BW_SESSION=$(cat ~/.bw_session);
|
||||||
|
|
||||||
# Else if there is a session file set from there
|
|
||||||
elif [ -f ~/.bw_session ]; then export BW_SESSION=$(cat ~/.bw_session);
|
|
||||||
|
|
||||||
# Otherwise unlock to start new session
|
# Otherwise unlock to start new session
|
||||||
else bwu; fi
|
elif [ -z "$BW_SESSION" ]; then bwu; fi
|
||||||
|
|
||||||
# Try connect to my default tmux socket
|
# Try connect to my default tmux socket
|
||||||
|
if [ -z "$TMUX" ]; then
|
||||||
if ! tmux -S /tmp/default.tmux attach; 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 new-session -s default -n default -d
|
||||||
tmux -S /tmp/default.tmux attach
|
tmux -S /tmp/default.tmux attach
|
||||||
fi
|
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
|
SBP_PATH=/home/james/Downloads/sbp
|
||||||
source /home/james/Downloads/sbp/sbp.bash
|
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
|
||||||
|
|||||||
38
.gitconfig
38
.gitconfig
@ -2,11 +2,47 @@
|
|||||||
email = mail@jamesblair.net
|
email = mail@jamesblair.net
|
||||||
name = James Blair
|
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
|
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]
|
[pull]
|
||||||
rebase = false
|
rebase = true
|
||||||
|
|
||||||
|
[merge]
|
||||||
|
conflictstyle = diff3
|
||||||
|
|
||||||
|
[push]
|
||||||
|
autoSetupRemote = true
|
||||||
|
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
|
||||||
[credential]
|
[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]
|
[commit]
|
||||||
gpgsign = true
|
gpgsign = true
|
||||||
|
|
||||||
[gpg]
|
[gpg]
|
||||||
format = ssh
|
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,31 +0,0 @@
|
|||||||
(custom-set-variables
|
|
||||||
;; custom-set-variables was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(evil-want-Y-yank-to-eol nil)
|
|
||||||
'(package-selected-packages
|
|
||||||
'(typescript-mode import-js grizzl add-node-modules-path simpleclip yasnippet-snippets yapfify yaml-mode xterm-color ws-butler writeroom-mode visual-fill-column winum web-mode web-beautify vterm volatile-highlights vi-tilde-fringe uuidgen unfill undo-tree treemacs-projectile treemacs-persp treemacs-magit treemacs-icons-dired treemacs-evil toc-org terminal-here tagedit symon symbol-overlay string-inflection sql-indent spaceline-all-the-icons memoize all-the-icons spaceline powerline smeargle slim-mode shell-pop seeing-is-believing scss-mode sass-mode rvm ruby-tools ruby-test-mode ruby-refactor ruby-hash-syntax rubocopfmt rubocop rspec-mode robe reveal-in-osx-finder restart-emacs rbenv rake rainbow-delimiters pytest pyenv-mode py-isort pug-mode prettier-js popwin pippel pipenv pyvenv pip-requirements persp-mode password-generator paradox ox-twbs ox-gfm ox-epub overseer osx-trash osx-clipboard orgit org-superstar org-re-reveal org-protocol-capture-html org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download org-cliplink org-brain open-junk-file ob-sql-mode ob-go ob-async nodejs-repl nameless mwim multi-term move-text mmm-mode minitest markdown-toc magit-svn magit-gitflow magit macrostep lsp-ui lsp-treemacs treemacs cfrs pfuture posframe lsp-python-ms lorem-ipsum livid-mode skewer-mode live-py-mode link-hint launchctl kubernetes-tramp kubernetes-evil kubernetes magit-popup magit-section json-reformat json-navigator hierarchy js2-refactor multiple-cursors js2-mode js-doc indent-guide importmagic epc ctable concurrent deferred impatient-mode simple-httpd hungry-delete htmlize hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-xref helm-themes helm-swoop helm-pydoc helm-purpose window-purpose imenu-list helm-projectile helm-org-rifle helm-org helm-mode-manager helm-make helm-lsp lsp-mode eldoc markdown-mode helm-ls-git helm-gitignore request helm-git-grep helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag haml-mode google-translate golden-ratio godoctor go-tag go-rename go-impl go-guru go-gen-test go-fill-struct go-eldoc gnuplot gitignore-templates git-timemachine git-messenger git-link git-commit with-editor gh-md fuzzy flycheck-pos-tip pos-tip flycheck-package package-lint let-alist flycheck-elsa flycheck pkg-info epl flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-org evil-numbers evil-nerd-commenter evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-cleverparens smartparens evil-args evil-anzu anzu eshell-z eshell-prompt-extras esh-help emr iedit clang-format projectile paredit list-utils emmet-mode elisp-slime-nav editorconfig nadvice dumb-jump dockerfile-mode docker transient tablist json-mode docker-tramp json-snatcher devdocs define-word cython-mode csv-mode company-web web-completion-data company-terraform terraform-mode hcl-mode company-lua lua-mode company-go go-mode company-anaconda company column-enforce-mode clojure-snippets clean-aindent-mode cider-eval-sexp-fu eval-sexp-fu cider sesman seq spinner queue parseedn clojure-mode map parseclj chruby centered-cursor-mode bundler inf-ruby blacken auto-yasnippet yasnippet auto-highlight-symbol ht auto-compile packed anaconda-mode pythonic f dash s aggressive-indent ace-window ace-link ace-jump-helm-line helm avy helm-core ac-ispell auto-complete popup which-key use-package pcre2el org-plus-contrib hydra lv hybrid-mode font-lock+ evil goto-chg dotenv-mode diminish bind-map bind-key async)))
|
|
||||||
(custom-set-faces
|
|
||||||
;; custom-set-faces was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(highlight-parentheses-highlight ((nil (:weight ultra-bold))) t))
|
|
||||||
(set-face-background 'default "undefined")
|
|
||||||
(add-hook 'text-mode-hook 'visual-line-mode)
|
|
||||||
(add-hook 'org-mode-hook 'org-indent-mode)
|
|
||||||
|
|
||||||
;; Prevent undo tree files from polluting your git repo
|
|
||||||
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))
|
|
||||||
|
|
||||||
;; Fix annoying indentation with shell script src blocks in org-mode
|
|
||||||
(setq org-edit-src-content-indentation 0)
|
|
||||||
|
|
||||||
;; Change indentation of org-mode headline tags to left
|
|
||||||
(setq org-tags-column 0)
|
|
||||||
|
|
||||||
;; Custom keybind for yank because my 60% keyboard doesn't have an insert key
|
|
||||||
(setq x-select-enable-clipboard t)
|
|
||||||
(global-set-key (kbd "C-c w") 'clipboard-kill-ring-save)
|
|
||||||
(global-set-key (kbd "C-c v") 'clipboard-yank)
|
|
||||||
12
.kuberc
Normal file
12
.kuberc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kubectl.config.k8s.io/v1alpha1
|
||||||
|
kind: Preference
|
||||||
|
overrides:
|
||||||
|
- command: apply
|
||||||
|
flags:
|
||||||
|
- name: server-side
|
||||||
|
default: "true"
|
||||||
|
- command: delete
|
||||||
|
flags:
|
||||||
|
- name: interactive
|
||||||
|
default: "true"
|
||||||
5
.markdownlintrc
Normal file
5
.markdownlintrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"MD013": false,
|
||||||
|
"whitespace": false
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -collapse_br_tags -dump %s; nametemplate=%s.html; copiousoutput
|
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 %s
|
||||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice --nologo %s; nametemplate=%s.docx; test=test -n "$DISPLAY"
|
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.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"
|
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`
|
set imap_pass=`bw get password hosted`
|
||||||
|
|
||||||
# This is the remote server and folder (optional)
|
# 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
|
# This is the folder your mail arrives into
|
||||||
set spoolfile=+INBOX
|
set spoolfile=+INBOX
|
||||||
@ -24,12 +24,13 @@ set realname='James Blair'
|
|||||||
set header_cache="~/.mutt/cache/headers"
|
set header_cache="~/.mutt/cache/headers"
|
||||||
set message_cachedir="~/.mutt/cache/bodies"
|
set message_cachedir="~/.mutt/cache/bodies"
|
||||||
set certificate_file="~/.mutt/certificates"
|
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 smtp_pass=`bw get password hosted`
|
||||||
set move=no
|
set move=no
|
||||||
set imap_keepalive=900
|
set imap_keepalive=900
|
||||||
set postponed="=INBOX.Drafts"
|
set postponed="=INBOX.Drafts"
|
||||||
set record="=INBOX.Sent"
|
set record="=INBOX.Sent"
|
||||||
|
set sort=date-received
|
||||||
unset imap_passive
|
unset imap_passive
|
||||||
|
|
||||||
macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
|
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
|
# Configure html emails
|
||||||
alternative_order text/plain text/html
|
alternative_order text/plain text/html
|
||||||
auto_view 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
|
|
||||||
@ -13,7 +13,13 @@ set -g @plugin 'tmux-plugins/tmux-sensible'
|
|||||||
set -g @plugin 'dracula/tmux'
|
set -g @plugin 'dracula/tmux'
|
||||||
|
|
||||||
# Make dracula theme more minimal
|
# Make dracula theme more minimal
|
||||||
set -g @dracula-plugins " "
|
set -g @dracula-plugins "cpu-usage gpu-usage ram-usage"
|
||||||
|
set -g @dracula-cpu-usage-colors "grey dark_gray"
|
||||||
|
set -g @dracula-ram-usage-colors "grey dark_gray"
|
||||||
|
set -g @dracula-gpu-usage-colors "grey dark_gray"
|
||||||
|
|
||||||
|
|
||||||
|
set -g @dracula-show-powerline true
|
||||||
|
|
||||||
# Initialise tpm
|
# Initialise tpm
|
||||||
run '~/.tmux/plugins/tpm/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
|
||||||
@ -32,7 +32,7 @@
|
|||||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
;; 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
|
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||||
;; `load-theme' function. This is the default:
|
;; `load-theme' function. This is the default:
|
||||||
(setq doom-theme 'doom-one)
|
(setq doom-theme 'doom-badger)
|
||||||
|
|
||||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
;; 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'.
|
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
;; If you use `org' and don't want your org files in the default location below,
|
;; 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!
|
;; change `org-directory'. It must be set before org loads!
|
||||||
(setq org-directory "~/org/")
|
(setq org-directory "~/Documents/org-journal/")
|
||||||
|
|
||||||
|
|
||||||
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
||||||
@ -113,3 +113,10 @@
|
|||||||
'((:results . "silent") ;
|
'((:results . "silent") ;
|
||||||
(:session . "default") ; The default tmux session to send code to
|
(:session . "default") ; The default tmux session to send code to
|
||||||
(:socket . nil))) ; The default tmux socket to communicate with
|
(: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))
|
||||||
|
|||||||
12
readme.org
12
readme.org
@ -8,7 +8,7 @@ This document captures my standard tooling for future replication and aims to ma
|
|||||||
|
|
||||||
For the purposes of this repository I broadly refer to tooling as the "standard" way my devices are configured and which things are installed that are non-standard to the operating system.
|
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
|
* 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
|
** 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]].
|
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]].
|
||||||
|
|
||||||
Working with some clients I also use [[https://code.visualstudio.com/][visual studio code]].
|
|
||||||
|
|
||||||
|
|
||||||
** Browsing the web
|
** 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]].
|
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.
|
[[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.
|
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.
|
||||||
|
|||||||
263
setup.org
263
setup.org
@ -4,93 +4,46 @@
|
|||||||
#+DATE: <2022-11-15 Tue 09:15>
|
#+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 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.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
* 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 tmux
|
||||||
#+begin_src shell
|
brew bundle install --cleanup
|
||||||
# Ensure we are in our home folder and create required directories
|
|
||||||
cd ~/ && mkdir Documents Downloads
|
|
||||||
#+end_src
|
#+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
|
#+begin_src
|
||||||
sudo apt install --yes btop nvtop screenfetch git curl wget xclip wl-clipboard xsel emacs xterm xtermcontrol jq tmux tmate apt-transport-https dict gh unrar ripgrep
|
while read line; do flatpak install --assumeyes `echo $line | awk '{print $2}'`; done < Flatfile
|
||||||
#+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
|
#+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.
|
* Secret management
|
||||||
|
|
||||||
#+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
|
|
||||||
|
|
||||||
|
|
||||||
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.
|
For managing secrets we use [[https://bitwarden.com/][bitwarden]] which provides a great [[https://github.com/bitwarden/cli][cli utility]]. Additionally in our [[.bashrc][bashrc]] file included in this repository there are a number of helper functions to make working with ~bw~ easier.
|
||||||
|
|
||||||
#+NAME: Install bitwarden and login
|
The ~bw~ utility should already be installed as part of our homebrew packages. Let's login now.
|
||||||
#+begin_src tmate
|
|
||||||
# Download the latest release
|
|
||||||
wget "https://vault.bitwarden.com/download/?app=cli&platform=linux" --output-document "bw.zip"
|
|
||||||
|
|
||||||
# Unzip and install the latest release
|
#+NAME: Login to bitwarden
|
||||||
unzip "bw.zip" && sudo install "bw" "/usr/local/bin" && rm "bw" "bw.zip"
|
#+begin_src tmux
|
||||||
|
|
||||||
# Login to bitwarden
|
|
||||||
bw login mail@jamesblair.net
|
bw login mail@jamesblair.net
|
||||||
#+end_src
|
#+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
|
* 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.
|
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.
|
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 BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)
|
||||||
|
|
||||||
# Export both keys
|
# Export both keys
|
||||||
export key=$(bw get item desktop --pretty | grep notes)
|
export key=$(bw get item "$(hostname)" --pretty | grep notes)
|
||||||
|
|
||||||
# Extract private key
|
# Extract private key
|
||||||
export private=${key:12}
|
export private=${key:12}
|
||||||
@ -118,7 +71,7 @@ export public=${key/*ssh-rsa/ssh-rsa} && echo ${public::-2} | awk '{gsub(/\\n/,"
|
|||||||
#+end_src
|
#+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.
|
Once our keys are available to us we can clone down our dotfiles and get back to our comfortable normal terminal environment.
|
||||||
|
|
||||||
@ -141,94 +94,55 @@ source ~/.bashrc
|
|||||||
|
|
||||||
** Optional - Cloud provider tools
|
** Optional - Cloud provider tools
|
||||||
|
|
||||||
Currently ~kubectl~ is packaged separately to ~gcloud~ and other cloud provider tools so let's install that first.
|
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 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.
|
|
||||||
|
|
||||||
#+NAME: Install google cloud sdk
|
#+NAME: Install google cloud sdk
|
||||||
#+BEGIN_SRC tmate
|
#+BEGIN_src tmux
|
||||||
# Download the sdk archive
|
# 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
|
# Extract to a folder in path then remove archive
|
||||||
sudo tar xvf gcpsdk.tar -C /usr/local/ && rm gcpsdk.tar
|
mkdir /home/${USER}/.var/bin && tar xvf gcpsdk.tar -C /home/${USER}/.var/bin && rm gcpsdk.tar
|
||||||
|
|
||||||
# Correct folder permissions
|
|
||||||
sudo chown -R $USER:$USER /usr/local/google-cloud-sdk
|
|
||||||
|
|
||||||
# Run the install script
|
# Run the install script
|
||||||
/usr/local/google-cloud-sdk/install.sh
|
/home/${USER}/.var/bin/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*
|
|
||||||
#+END_SRC
|
#+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
|
#+NAME: Install and configure doom
|
||||||
#+BEGIN_SRC tmate
|
#+BEGIN_src tmux
|
||||||
# Curl down the shell script for adding version 16 of nodejs to apt
|
# Install doom emacs
|
||||||
sudo curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
|
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
|
||||||
|
~/.config/emacs/bin/doom install
|
||||||
|
|
||||||
# Install the nodejs package via apt
|
# Copy in my configuration
|
||||||
sudo apt-get install -y nodejs
|
cp /home/${USER}/Documents/doom/* /home/${USER}/.config/doom/
|
||||||
|
|
||||||
# Install yarn dependency manager
|
# Doom sync to finalise
|
||||||
sudo npm install --global yarn
|
doom sync
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Included in this repository is a ~doom/~ subdirectory which layers my personal preferences on top of doom.
|
||||||
** Optional - Install hardware drivers
|
|
||||||
|
|
||||||
|
|
||||||
** Optional - Setup 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
|
#+NAME Install tmux plugin manager
|
||||||
#+BEGIN_SRC tmate
|
#+begin_src tmux
|
||||||
# Clone down humacs
|
# Install tmux plugin manager
|
||||||
git clone --recursive https://github.com/jmhbnz/humacs /home/$USER/Downloads/
|
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
|
# Source the tmux configuration file
|
||||||
export EMACSLOADPATH=/home/$USER/Downloads/humacs
|
tmux source ~/.tmux.conf
|
||||||
#+END_SRC
|
#+end_src
|
||||||
|
|
||||||
Included in this repository is a ~.bashrc~ and ~humacs-custom.el~ which layer my personal preferences on top of humacs.
|
|
||||||
|
|
||||||
|
|
||||||
** Optional - Setup sbp powerline prompt
|
** Optional - Setup sbp powerline prompt
|
||||||
@ -239,25 +153,13 @@ As you can see in the screenshot, contextual "segments" are presented in the pro
|
|||||||
|
|
||||||
[[./images/powerline-prompt.png]]
|
[[./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
|
#+NAME: Install simple bash prompt
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
|
# Disable bluefin/aurora terminal motd
|
||||||
|
ujust toggle-user-motd
|
||||||
|
|
||||||
# Clone the repository
|
# 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
|
# Run the install script
|
||||||
/home/$USER/Downloads/sbp/bin/install
|
/home/$USER/Downloads/sbp/bin/install
|
||||||
@ -266,7 +168,7 @@ git clone https://github.com/jmhbnz/sbp ~/Downloads/sbp/
|
|||||||
mkdir --parents /home/$USER/.config/sbp/
|
mkdir --parents /home/$USER/.config/sbp/
|
||||||
|
|
||||||
# Write the config file
|
# Write the config file
|
||||||
cat << EOF >
|
cat << EOF > /home/$USER/.config/sbp/settings.conf
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
SBP_THEME_COLOR='apathy'
|
SBP_THEME_COLOR='apathy'
|
||||||
SBP_THEME_LAYOUT='powerline'
|
SBP_THEME_LAYOUT='powerline'
|
||||||
@ -312,54 +214,25 @@ sbp toggle peekaboo k8s
|
|||||||
Congratulations - you should now have a functional, good looking and informative bash prompt! 🎉
|
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.
|
#+NAME: Rename bluetooth devices
|
||||||
|
#+begin_src tmux
|
||||||
The first step to setup mutt is to ensure it is installed.
|
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
|
||||||
#+NAME: Install mutt
|
bluetoothctl connect 80:E1:26:6D:66:4A && bluetoothctl set-alias james-flipper
|
||||||
#+BEGIN_SRC tmate
|
bluetoothctl connect 88:C9:E8:5A:56:6C && bluetoothctl set-alias james-earphones
|
||||||
sudo apt-get install -y mutt urlscan
|
bluetoothctl connect E2:A0:9F:BC:DB:27 && bluetoothctl set-alias james-home-mouse
|
||||||
#+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
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** Optional - disable sleep
|
||||||
|
|
||||||
|
I just power off my devices when they aren't in use, the snippet below disables sleep buttons and also ensures my devices will never unintentionally sleep when closing lid etc.
|
||||||
|
|
||||||
|
#+NAME: Disable sleep
|
||||||
|
#+begin_src bash
|
||||||
|
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
|
||||||
|
#+end_src
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#+DATE: 25th January 2022
|
#+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, 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]].
|
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]].
|
||||||
|
|
||||||
@ -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:
|
To get started install obs including all dependencies required using the steps below:
|
||||||
|
|
||||||
#+NAME: Install open broadcast studio dependencies
|
#+NAME: Install open broadcast studio dependencies
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
# Install dependencies first
|
# Install dependencies first
|
||||||
sudo apt install --yes ffmpeg v4l2loopback-dkms
|
sudo apt install --yes ffmpeg v4l2loopback-dkms
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ sudo add-apt-repository ppa:obsproject/obs-studio
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+NAME: Install open broadcast studio
|
#+NAME: Install open broadcast studio
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
# Install open broadcast studio
|
# Install open broadcast studio
|
||||||
sudo apt update && sudo apt install --yes obs-studio
|
sudo apt update && sudo apt install --yes obs-studio
|
||||||
#+end_src
|
#+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:
|
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
|
#+NAME: Install streamfx plugin
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
# Ensure the plugin directory exists
|
# Ensure the plugin directory exists
|
||||||
mkdir --parents ~/.config/obs-studio && cd ~/.config/obs-studio
|
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.
|
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
|
#+NAME: Create virtual audio devices
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
# Create the virtual speaker
|
# Create the virtual speaker
|
||||||
pactl load-module module-null-sink sink_name=Source sink_properties=device.description=VirtualSpeaker
|
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.
|
To make it permanent we need to save the configuration to a file in our home directory.
|
||||||
|
|
||||||
#+NAME: Save virtual audio device configuration
|
#+NAME: Save virtual audio device configuration
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
# Ensure required directory exists
|
# Ensure required directory exists
|
||||||
mkdir --parents ~/.config/pulse
|
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".
|
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
|
#+NAME: Run open broadcast studio
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
obs&
|
obs&
|
||||||
#+end_src
|
#+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.
|
You can use the snippet below to check the contents of the files.
|
||||||
|
|
||||||
#+NAME: Show included configuration files
|
#+NAME: Show included configuration files
|
||||||
#+begin_src tmate
|
#+begin_src tmux
|
||||||
# Show contents of profile ini file
|
# Show contents of profile ini file
|
||||||
cat ~/Documents/tooling/streaming/basic.ini
|
cat ~/Documents/tooling/streaming/basic.ini
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user