Compare commits

...

10 Commits

6 changed files with 71 additions and 247 deletions

66
.bashrc
View File

@ -1,50 +1,61 @@
# ==============================================================================
# Personal $HOME/.bashrc file by James Blair <mail@jamesblair.net>
# ==============================================================================
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# Don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
# also ensure we write to history immediately instead of only on terminal close
# Append to the history file, don't overwrite it
# Also ensure we write to history immediately instead of only on terminal close
shopt -s histappend
export PROMPT_COMMAND="history -a; history -n"
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=20000
# Retain infinite bash history
HISTSIZE=-1
HISTFILESIZE=-1
# check the window size after each command and, if necessary,
# Check the window size after each command and, if necessary
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls -l --color=auto -h --group-directories-first'
alias ll='ls -l --color=auto -h --group-directories-first'
# Alias ls to eza
if [ "$(command -v eza)" ]; then
alias ll='eza -l --icons=auto --group-directories-first'
alias ls='eza -l --icons=auto --group-directories-first'
fi
# Alias cat to bat
if [ "$(command -v bat)" ]; then
alias cat='bat --style=plain --pager=never' 2>/dev/null
fi
# Alias docker to podman
alias docker=podman
# Custom git alias for pushing to all remotes at once
alias gpa='git remote | xargs -L1 git push --all'
# Alias df to dysk
if [ "$(command -v bat)" ]; then
alias df=dysk
fi
# simplify bitwarden cli usage
# Simplify bitwarden cli usage
cpcmd="xclip -selection c"; if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then cpcmd="wl-copy"; fi
alias bwu='export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)'
function bwgp () {
local test=$(export BW_SESSION=~/.bw_session) && bw get password "$1" | $cpcmd;
# If the login has a totp associated we should leave a follow-up prompt for it
if totp=$(bw get totp "$1"); then
read -p "Press enter when ready for totp"
echo "${totp}" | $cpcmd
# Retrieve full json
local test
test=$(eval $(export BW_SESSION=~/.bw_session) && bw get item "${1}");
# Update clipboard with initial value
echo ${test} | jq -r '.login.password' | "${cpcmd}"
# Check if a totp is associated
if [ $(echo ${test} | jq -r .login.totp) != "null" ]; then
# Retrieve totp in background
exec 3< <(echo $(bw get totp "${1}"))
read -r -p "Press enter when ready for totp"
read -r <&3 line && echo "${line}" | "${cpcmd}"
fi
}
function bwgt () { local test=$(export BW_SESSION=~/.bw_session) && bw get totp "$1" | $cpcmd; }
@ -79,9 +90,7 @@ function bwai () {
bw encode | bw create item && bw sync
}
# 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
@ -126,7 +135,7 @@ else
# Set pid + auth sock to ensure existing ssh-agent will be re-used
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
@ -158,6 +167,7 @@ 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

View File

@ -7,8 +7,10 @@ brew "bitwarden-cli"
brew "btop"
brew "cekit"
brew "cloudflared"
brew "pcre2"
brew "dict"
brew "direnv"
brew "dysk"
brew "emacs"
brew "eza"
brew "fd"
@ -18,17 +20,18 @@ brew "gh"
brew "git-absorb"
brew "git-lfs"
brew "glab"
brew "pcre2"
brew "go", link: false
brew "go@1.23", link: true
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"
@ -39,6 +42,7 @@ brew "npm-check-updates"
brew "ocm"
brew "openshift-cli"
brew "pcre"
brew "podman-compose"
brew "ripgrep"
brew "rosa-cli"
brew "roxctl"

View File

@ -1,14 +0,0 @@
#+TITLE: Fairphone setup
#+AUTHOR: James Blair
#+EMAIL: mail@jamesblair.net
#+DATE: <2023-11-03 Fri 16:45>
Below are the steps I follow post standard installation of [[https://ubuntu-touch.io][ubuntu touch]] on my [[https://en.wikipedia.org/wiki/Fairphone_4][Fairphone 4]].
I've been using the fairphone 4 as a daily driver since April 2023, most recently with Ubuntu Touch.
* Downgrade prior to installation
After initially purchasing the fairphone, while it was running android I had upgraded to android 12. Unfortunately the ubuntu touch installer is not fully working with Android 12 so I had to downgrade the phone to Android 11 by reinstalling a stock image before proceeding with the ubuntu touch installation.

View File

@ -1,200 +0,0 @@
{
"policy": {
"DEFAULT": {
"capabilities": [
"frame",
"fetch",
"noscript",
"other",
"media"
],
"temp": false
},
"TRUSTED": {
"capabilities": [
"script",
"object",
"media",
"frame",
"font",
"webgl",
"fetch",
"ping",
"noscript",
"unchecked_css",
"lan",
"other",
"lazy_load"
],
"temp": false
},
"UNTRUSTED": {
"capabilities": [],
"temp": false
},
"sites": {
"trusted": [
"§:addons.mozilla.org",
"§:ajax.aspnetcdn.com",
"§:ajax.googleapis.com",
"§:bootstrapcdn.com",
"§:code.jquery.com",
"§:google.com",
"§:googlevideo.com",
"§:gstatic.com",
"§:maps.googleapis.com",
"§:mozilla.net",
"§:noscript.net",
"§:paypal.com",
"§:paypalobjects.com",
"§:yimg.com",
"§:youtube.com",
"§:ytimg.com",
"§:jamma.life",
"§:github.com",
"§:githubassets.com",
"§:dreamhost.com",
"§:redhat.com",
"§:statuspage.io",
"§:southerncross.co.nz",
"§:azure.com",
"§:stripe.com",
"§:b2clogin.com",
"§:farmlands.co.nz",
"§:dynamics365commerce.ms",
"§:amazon.com",
"§:awsstatic.com",
"§:k8s.io",
"§:googleusercontent.com",
"§:windy.com",
"§:sharesies.nz",
"§:slack.com",
"§:slack-edge.com",
"§:tsbbank.co.nz",
"§:kiwibank.co.nz",
"§:linuxfoundation.org",
"§:cvent.com",
"§:cvent-assets.com",
"§:airnewzealand.com",
"§:airnewzealand.co.nz",
"§:airpointsstore.co.nz",
"§:reddit.com",
"§:redditstatic.com",
"§:cve.org",
"§:aquasec.com",
"§:nist.gov",
"§:cvefeed.io",
"§:mitre10.co.nz",
"§:cloudflare.com",
"§:jamma.dev",
"§:powershop.co.nz",
"§:flux.app",
"§:nzfarmsource.co.nz",
"§:primehort.co.nz",
"§:myworkday.com",
"§:opentlc.com",
"§:openshift.net",
"§:jmhbnz.github.io",
"§:redhatworkshops.io",
"§:bunnings.co.nz",
"§:openshiftapps.com",
"§:westpac.co.nz",
"§:kapiticoast.govt.nz",
"§:discord.com",
"§:farmlandspro.co.nz",
"§:hnry.io",
"§:trademe.co.nz",
"§:bitwarden.com",
"§:one.nz",
"§:vodafone.co.nz",
"§:cncf.io",
"§:openshift.com",
"§:force.com",
"§:keddle.net.nz",
"§:ycombinator.com",
"§:snyk.io",
"§:docker.com",
"rhdemo.win",
"§:clearscore.com",
"§:projectbluefin.io",
"§:pbtech.co.nz",
"§:kde.org",
"§:protondb.com",
"§:sharesies.com",
"§:ryobi.co.nz",
"§:metlink.org.nz",
"§:sched.com",
"§:sched.co",
"§:canva.com",
"§:safing.io",
"§:windcave.com",
"§:azure.net",
"§:microsoftonline.com",
"§:microsoft.com",
"§:msftauth.net",
"§:mypaymentvault.com",
"§:recaptcha.net",
"§:salesforce.com",
"§:acc.co.nz",
"§:realme.govt.nz",
"§:redhatstatic.com",
"§:starlink.com",
"§:quay.io",
"§:airbnb.co.nz",
"§:onetimesecret.com",
"§:concursolutions.com",
"§:etcd.io",
"§:gitlab.com",
"§:sessionize.com",
"§:morganstanley.com",
"§:hnry.co.nz",
"§:wise.com",
"§:deerstalkers.org.nz",
"§:arcgis.com",
"§:muscache.com",
"§:ird.govt.nz",
"§:p-airnz.com",
"§:nzpost.co.nz",
"§:fast.com",
"§:metservice.com",
"§:b-airnz.com",
"§:egencia.co.nz",
"§:egencia.com",
"§:wellingtonairport.co.nz",
"§:airnewzealand.com.au",
"§:homes.co.nz",
"§:netlify.com",
"§:github.dev",
"§:jaycar.co.nz"
],
"untrusted": [],
"custom": {}
},
"enforced": true,
"autoAllowTop": false
},
"local": {
"debug": false,
"showCtxMenuItem": true,
"showCountBadge": true,
"showFullAddresses": false,
"showProbePlaceholders": true,
"amnesticUpdates": true,
"storage": "local"
},
"sync": {
"global": false,
"xss": true,
"TabGuardMode": "incognito",
"TabGuardPrompt": "post",
"cascadeRestrictions": false,
"overrideTorBrowserPolicy": false,
"storage": "sync"
},
"xssUserChoices": {
"https://mail.google.com>https://www.youtube.com": "allow",
"https://drive.google.com>https://youtube.googleapis.com": "allow",
"https://app.sharesies.nz>https://js.stripe.com": "allow",
"https://app.sharesies.com>https://js.stripe.com": "allow"
}
}

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://projectbluefin.io/][Bluefin]] for my primary work device which is a 2021 Razer Blade 14". Additionally a subdirectory is included for my smartphone which is a [[https://en.wikipedia.org/wiki/Fairphone_4][Fairphone 4]] running [[https://lineageos.org][LineageOS]].
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

View File

@ -14,7 +14,7 @@ I use Bluefin as my daily driver operating system on a variety of different mach
Additional packages are ideally sourced from [[https://docs.brew.sh/Homebrew-on-Linux][Homebrew for Linux]], with [[https://flathub.org/][Flathub]] for anything I can't find in brew. Included in this repository is my ~Brewfile~ of packages.
#+begin_src tmux
brew bundle install
brew bundle install --cleanup
#+end_src
@ -212,3 +212,27 @@ sbp toggle peekaboo k8s
#+end_src
Congratulations - you should now have a functional, good looking and informative bash prompt! 🎉
** Optional - bluetooth device names
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.
#+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 - 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