SHA256
1
0

Restructure files into roles

This commit is contained in:
2026-01-29 00:41:10 -05:00
parent d868ab2c3c
commit 62c413d42d
27 changed files with 461 additions and 932 deletions

View File

@@ -0,0 +1,7 @@
# see https://github.com/sigoden/aichat/blob/main/config.example.yaml
model: claude:claude-haiku-4-5-20251001
clients:
- type: claude
api_key: {{ ANTHROPIC_API_KEY }}

View File

@@ -0,0 +1,2 @@
OPENAI_API_KEY="{{ OPENAI_API_KEY }}"
ANTHROPIC_API_KEY="{{ ANTHROPIC_API_KEY }}"

View File

@@ -0,0 +1,10 @@
# This is Git's per-user configuration file.
[user]
email = bryanroessler@gmail.com
name = Bryan Roessler
[color]
ui = auto
[credential]
helper = cache
[init]
defaultBranch = main

View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# Nautilus script for creating one or more shared links
# Requires wl-clipboard and notify-send
ssh_server="bryanroessler.com"
ssh_files_path="/var/www/repos.bryanroessler.com/files"
www_files_path="https://repos.bryanroessler.com/files"
if [[ "$#" -lt 1 ]]; then
echo "You must provide at least one argument"
exit 1
fi
hash wl-copy &>/dev/null || { echo "Please install wl-copy"; exit 1; }
hash rsync &>/dev/null || { echo "Please install rsync"; exit 1; }
if [[ -v NAUTILUS_SCRIPT_SELECTED_URIS ]]; then
readarray -t files <<< "$NAUTILUS_SCRIPT_SELECTED_URIS"
for f in "${files[@]}"; do
f="${f#file://}"
f="${f//\%20/ }"
fixed_files+=("$f")
done
else
fixed_files=("$@")
fi
links_array=()
for f in "${fixed_files[@]}"; do
[[ "$f" == "" ]] && continue
fname="${f##*/}"
random64=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 64 | head -n 1)
nohup rsync -a "$f" "${ssh_server}:${ssh_files_path}/${random64}/" &
links_array+=("$www_files_path/${random64}/${fname// /%20}")
done
if [[ "${#links_array[@]}" == 1 ]]; then
printf '%s' "${links_array[@]}" | wl-copy
else
printf '%s\n' "${links_array[@]}" | wl-copy
fi
hash notify-send &>/dev/null &&
notify-send -t 3000 -i face-smile "share-link" "File(s) uploaded and link copied to clipboard"
exit 0

View File

@@ -0,0 +1,3 @@
{% for key in SSH_AUTHORIZED_KEYS %}
{{ key }}
{% endfor %}

View File

@@ -0,0 +1,42 @@
HashKnownHosts yes
AddressFamily inet
Host *
StrictHostKeyChecking no
Host uv.asc.edu
User uabbcr
ProxyJump roessler@hartmanlab.genetics.uab.edu
Host router
Hostname router.lan
User root
ServerAliveCountMax 10
ServerAliveInterval 120
Host home-router
Hostname home-router
User root
Host w1700k
Hostname w1700k.lan
User root
Host bryanroessler.com
Hostname 23.94.201.46
Host hartmanlab
Hostname hartmanlab.genetics.uab.edu
User roessler
Host workstation
Hostname workstation
Host laptop
Hostname laptop
Host vm-fedora43
Hostname 192.168.122.169
Host vm-alma9
Hostname 192.168.122.235

View File

@@ -0,0 +1,32 @@
# Synchronize windows shortcut
unbind a
bind a set-window-option synchronize-panes
# Use | and - to split a window vertically and horizontally instead of " and % respoectively
unbind '"'
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Alias (Ctrl-b + k) to kill the current session
bind-key k kill-session
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config'
# Set the history limit so we get lots of scrollback.
setw -g history-limit 50000000
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Enable mouse mode
set -g mouse on

View File

@@ -0,0 +1,169 @@
" File: .vimrc
" Author: Jake Zimmerman <jake@zimmerman.io>
"
" How I configure Vim :P
"
" Gotta be first
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" ----- Making Vim look good ------------------------------------------
Plugin 'altercation/vim-colors-solarized'
Plugin 'tomasr/molokai'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" ----- Vim as a programmer's text editor -----------------------------
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'vim-syntastic/syntastic'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-easytags'
Plugin 'majutsushi/tagbar'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'vim-scripts/a.vim'
" ----- Working with Git ----------------------------------------------
Plugin 'airblade/vim-gitgutter'
Plugin 'tpope/vim-fugitive'
" ----- Other text editing features -----------------------------------
Plugin 'Raimondi/delimitMate'
" ----- man pages, tmux -----------------------------------------------
Plugin 'jez/vim-superman'
Plugin 'christoomey/vim-tmux-navigator'
" ----- Syntax plugins ------------------------------------------------
Plugin 'jez/vim-c0'
Plugin 'jez/vim-ispc'
Plugin 'kchmck/vim-coffee-script'
" ---- Extras/Advanced plugins ----------------------------------------
" Highlight and strip trailing whitespace
"Plugin 'ntpeters/vim-better-whitespace'
" Easily surround chunks of text
"Plugin 'tpope/vim-surround'
" Align CSV files at commas, align Markdown tables, and more
"Plugin 'godlygeek/tabular'
" Automaticall insert the closing HTML tag
"Plugin 'HTML-AutoCloseTag'
" Make tmux look like vim-airline (read README for extra instructions)
"Plugin 'edkolev/tmuxline.vim'
" All the other syntax plugins I use
"Plugin 'ekalinin/Dockerfile.vim'
"Plugin 'digitaltoad/vim-jade'
"Plugin 'tpope/vim-liquid'
"Plugin 'cakebaker/scss-syntax.vim'
call vundle#end()
filetype plugin indent on
" --- General settings ---
set backspace=indent,eol,start
set ruler
set number
set showcmd
set incsearch
set hlsearch
syntax on
set mouse=a
" We need this for plugins like Syntastic and vim-gitgutter which put symbols
" in the sign column.
hi clear SignColumn
" ----- Plugin-Specific Settings --------------------------------------
" ----- altercation/vim-colors-solarized settings -----
" Toggle this to "light" for light colorscheme
set background=dark
" Uncomment the next line if your terminal is not configured for solarized
let g:solarized_termcolors=256
" Set the colorscheme
colorscheme solarized
" ----- bling/vim-airline settings -----
" Always show statusbar
set laststatus=2
" Fancy arrow symbols, requires a patched font
" To install a patched font, run over to
" https://github.com/abertsch/Menlo-for-Powerline
" download all the .ttf files, double-click on them and click "Install"
" Finally, uncomment the next line
"let g:airline_powerline_fonts = 1
" Show PASTE if in paste mode
let g:airline_detect_paste=1
" Show airline for tabs too
let g:airline#extensions#tabline#enabled = 1
" Use the solarized theme for the Airline status bar
let g:airline_theme='solarized'
" ----- jistr/vim-nerdtree-tabs -----
" Open/close NERDTree Tabs with \t
nmap <silent> <leader>t :NERDTreeTabsToggle<CR>
" To have NERDTree always open on startup
let g:nerdtree_tabs_open_on_console_startup = 1
" ----- scrooloose/syntastic settings -----
let g:syntastic_error_symbol = '✘'
let g:syntastic_warning_symbol = "▲"
augroup mySyntastic
au!
au FileType tex let b:syntastic_mode = "passive"
augroup END
" ----- xolox/vim-easytags settings -----
" Where to look for tags files
set tags=./tags;,~/.vimtags
" Sensible defaults
let g:easytags_events = ['BufReadPost', 'BufWritePost']
let g:easytags_async = 1
let g:easytags_dynamic_files = 2
let g:easytags_resolve_links = 1
let g:easytags_suppress_ctags_warning = 1
" ----- majutsushi/tagbar settings -----
" Open/close tagbar with \b
nmap <silent> <leader>b :TagbarToggle<CR>
" Uncomment to open tagbar automatically whenever possible
"autocmd BufEnter * nested :call tagbar#autoopen(0)
" ----- airblade/vim-gitgutter settings -----
" In vim-airline, only display "hunks" if the diff is non-zero
let g:airline#extensions#hunks#non_zero_only = 1
" ----- Raimondi/delimitMate settings -----
let delimitMate_expand_cr = 1
augroup mydelimitMate
au!
au FileType markdown let b:delimitMate_nesting_quotes = ["`"]
au FileType tex let b:delimitMate_quotes = ""
au FileType tex let b:delimitMate_matchpairs = "(:),[:],{:},`:'"
au FileType python let b:delimitMate_nesting_quotes = ['"', "'"]
augroup END
" ----- jez/vim-superman settings -----
" better man page support
noremap K :SuperMan <cword><CR>

View File

@@ -0,0 +1,352 @@
[20160811230132225]
applications=WWWBROWSER, MAILCLIENT, OFFICE, TERMINAL
autoconnect=0
autologin=true
autostart=0
clipboard=both
command=MATE
defsndport=true
directrdp=false
directrdpsettings=
directxdmcp=false
directxdmcpsettings=
display=1
dpi=96
export=
forwardsshagent=0
fstunnel=true
fullscreen=false
height=1000
host=hartmanlab.genetics.uab.edu
icon=:/img/icons/128x128/x2gosession.png
iconvfrom=ISO8859-1
iconvto=UTF-8
kdrive=false
key=
krbdelegation=false
krblogin=false
layout=us
maxdim=false
mimeboxaction=OPEN
mimeboxextensions=
multidisp=false
name=Hartman Lab
pack=adaptive
print=false
published=false
quality=9
rdpclient=rdesktop
rdpoptions=
rdpport=3389
rdpserver=
restoreexports=0
rootless=false
sessiontitle=
setdpi=true
setsessiontitle=0
sndport=4713
sound=false
soundsystem=pulse
soundtunnel=true
speed=3
sshport=22
sshproxyautologin=false
sshproxyhost=
sshproxykeyfile=
sshproxykrblogin=false
sshproxyport=22
sshproxysamepass=false
sshproxysameuser=false
sshproxytype=SSH
sshproxyuser=
startsoundsystem=true
type=auto
uniquehostkeyaliases=0
useexports=1
useiconv=false
usekbd=true
usemimebox=0
user=roessler
usesshproxy=false
variant=
width=1920
xdmcpclient=Xnest
xdmcpserver=localhost
xinerama=false
[20161102210455144]
applications=WWWBROWSER, MAILCLIENT, OFFICE, TERMINAL
autoconnect=0
autologin=true
autostart=0
clipboard=both
command=SHADOW
defsndport=false
directrdp=false
directrdpsettings=
directxdmcp=false
directxdmcpsettings=
display=1
dpi=96
export=
forwardsshagent=0
fstunnel=true
fullscreen=false
height=1080
host=workstation.lan
icon=:/img/icons/128x128/x2gosession.png
iconvfrom=ISO8859-1
iconvto=UTF-8
key=/home/bryan/.ssh/id_rsa
krbdelegation=false
krblogin=false
layout=us
maxdim=false
mimeboxaction=OPEN
mimeboxextensions=
multidisp=false
name=Workstation
pack=16m-tight
print=false
published=false
quality=9
rdpclient=rdesktop
rdpoptions=
rdpport=3389
rdpserver=
restoreexports=0
rootless=false
sessiontitle=
setdpi=true
setsessiontitle=0
sndport=4713
sound=false
soundsystem=pulse
soundtunnel=true
speed=3
sshport=22
sshproxyautologin=false
sshproxyhost=
sshproxykeyfile=
sshproxykrblogin=false
sshproxyport=22
sshproxysamepass=false
sshproxysameuser=false
sshproxytype=SSH
sshproxyuser=
startsoundsystem=true
type=auto
uniquehostkeyaliases=0
useexports=0
useiconv=false
usekbd=true
usemimebox=0
user=bryan
usesshproxy=false
variant=
width=1920
xdmcpclient=Xnest
xdmcpserver=localhost
xinerama=false
[20180402120430827]
applications=WWWBROWSER, MAILCLIENT, OFFICE, TERMINAL
autoconnect=0
autologin=true
autostart=0
clipboard=both
command=SHADOW
defsndport=false
directrdp=false
directrdpsettings=
directxdmcp=false
directxdmcpsettings=
display=1
dpi=96
export=
forwardsshagent=0
fstunnel=true
fullscreen=false
height=600
host=home.bryanroessler.com
icon=:/img/icons/128x128/x2gosession.png
iconvfrom=ISO8859-1
iconvto=UTF-8
kdrive=false
key=
krbdelegation=false
krblogin=false
layout=
maxdim=false
mimeboxaction=OPEN
mimeboxextensions=
multidisp=false
name=Bryan-PC
pack=16m-png-jpeg
print=false
published=false
quality=9
rdpclient=rdesktop
rdpoptions=
rdpport=3389
rdpserver=
restoreexports=0
rootless=false
sessiontitle=
setdpi=true
setsessiontitle=0
sndport=4713
sound=false
soundsystem=pulse
soundtunnel=true
speed=3
sshport=8022
sshproxyautologin=false
sshproxyhost=
sshproxykeyfile=
sshproxykrblogin=false
sshproxyport=22
sshproxysamepass=false
sshproxysameuser=false
sshproxytype=SSH
sshproxyuser=
startsoundsystem=true
type=pc105/us
uniquehostkeyaliases=0
useexports=0
useiconv=false
usekbd=true
usemimebox=0
user=bryan
usesshproxy=false
variant=
width=800
xdmcpclient=Xnest
xdmcpserver=localhost
xinerama=false
[20200610122259197]
applications=WWWBROWSER, MAILCLIENT, OFFICE, TERMINAL
autologin=true
clipboard=both
command=SHADOW
defsndport=true
directrdp=false
directrdpsettings=
directxdmcp=false
directxdmcpsettings=
display=1
dpi=159
export=
fstunnel=true
fullscreen=false
height=600
host=hartmanlab.genetics.uab.edu
icon=:/img/icons/128x128/x2gosession.png
iconvfrom=ISO8859-1
iconvto=UTF-8
kdrive=false
key=
krbdelegation=false
krblogin=false
maxdim=false
multidisp=false
name=jwrodger hartmanlab
pack=16m-jpeg
print=true
published=false
quality=9
rdpclient=rdesktop
rdpoptions=
rdpport=3389
rdpserver=
rootless=false
setdpi=true
sndport=4713
sound=true
soundsystem=pulse
soundtunnel=true
speed=2
sshport=22
sshproxyautologin=false
sshproxyhost=
sshproxykeyfile=
sshproxykrblogin=false
sshproxyport=22
sshproxysamepass=false
sshproxysameuser=false
sshproxytype=SSH
sshproxyuser=
startsoundsystem=true
type=auto
useiconv=false
usekbd=true
user=jwrodger
usesshproxy=false
width=800
xdmcpclient=Xnest
xdmcpserver=localhost
xinerama=false
[20240628174700221]
applications=WWWBROWSER, MAILCLIENT, OFFICE, TERMINAL
autologin=false
clipboard=both
command=MATE
defsndport=true
directrdp=false
directrdpsettings=
directxdmcp=false
directxdmcpsettings=
display=1
dpi=96
export=
fstunnel=true
fullscreen=false
height=1000
host=hartmanlab.genetics.uab.edu
icon=:/img/icons/128x128/x2gosession.png
iconvfrom=ISO8859-1
iconvto=UTF-8
kdrive=false
key=
krbdelegation=false
krblogin=false
maxdim=false
multidisp=false
name=Hartman Lab (Testing)
pack=64k-png
print=false
published=false
quality=9
rdpclient=rdesktop
rdpoptions=
rdpport=3389
rdpserver=
rootless=false
setdpi=true
sndport=4713
sound=false
soundsystem=pulse
soundtunnel=true
speed=3
sshport=22
sshproxyautologin=false
sshproxyhost=
sshproxykeyfile=
sshproxykrblogin=false
sshproxyport=22
sshproxysamepass=false
sshproxysameuser=false
sshproxytype=SSH
sshproxyuser=
startsoundsystem=true
type=auto
useiconv=false
usekbd=true
user=testbr
usesshproxy=false
width=1920
xdmcpclient=Xnest
xdmcpserver=localhost
xinerama=false

View File

@@ -0,0 +1,143 @@
# Shell options
setopt autocd menucomplete correct globdots extendedglob nomatch notify \
share_history inc_append_history hist_expire_dups_first hist_reduce_blanks \
hist_find_no_dups hist_verify extended_history auto_pushd pushd_ignore_dups \
prompt_subst
unsetopt beep
bindkey -e
# Load secrets
if [[ -f $HOME/.env ]]; then
set -a # automatically export all variables
source "$HOME/.env"
set +a
fi
# Completions
local compdump=${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompdump-${HOST}-${ZSH_VERSION}
[[ -d ${compdump:h} ]] || mkdir -p ${compdump:h}
zstyle ':completion:*' menu select
zstyle ':completion:*' gain-privileges 1
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zmodload zsh/complist
autoload -Uz compinit && compinit -d "$compdump"
# History
HISTFILE=${XDG_STATE_HOME:-$HOME}/.histfile
[[ -d $HISTFILE:h ]] || mkdir -p $HISTFILE:h
HISTSIZE=1000000
SAVEHIST=1000000
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
# Colors
autoload -Uz colors && colors
# Prompt
if [[ $EUID -eq 0 ]]; then
user_color=red
else
user_color=white
fi
# Assign colors based on the hostname
# https://www.ditig.com/256-colors-cheat-sheet
if [[ -v TOOLBOX_PATH ]]; then
host_color=magenta
elif [[ -v DISTROBOX_ENTER_PATH ]]; then
host_color=15
else
case $HOSTNAME in
laptop) host_color=green ;;
workstation) host_color=red ;;
bryan-pc) host_color=cyan ;;
time4vps) host_color=blue ;;
racknerd) host_color=yellow ;;
htpc) host_color=214 ;;
hartmanlab) host_color=magenta ;;
router) host_color=blue ;;
ax6000) host_color=87 ;;
home-router) host_color=218 ;;
vm-fedora*) host_color=57 ;;
vm-alma*) host_color=214 ;;
*) host_color=white ;;
esac
fi
_git_prompt() {
local br
if br=$(git symbolic-ref --short HEAD 2>/dev/null); then
print -n " %F{242}($br)%f"
fi
}
PROMPT='[%F{'$user_color'}%n%f@%F{'$host_color'}%m%f]%~$(_git_prompt)%(!.#.$) '
# RPROMPT='%*' # display clock to right of screen
precmd() { print -Pn "\e]0;%n@%m: ${PWD/#$HOME/~}\a" ; }
# Set hostname on OpenWRT
[[ -z $HOSTNAME ]] && HOSTNAME=$(noglob uci get system.@system[0].hostname 2>/dev/null)
# Paths
typeset -U path PATH
path=(
$HOME/bin
$HOME/.local/bin
$HOME/documents/develop/scripts/shell/.local/bin
$HOME/.cargo/bin
$path
)
export PATH
export R_LIBS_USER="$HOME/R/qhtcp-workflow"
# Keybindings
typeset -g -A key
for k v in \
Home khome End kend Insert kich1 Backspace kbs Delete kdch1 \
Up kcuu1 Down kcud1 Left kcub1 Right kcuf1 PageUp kpp PageDown knp ShiftTab kcbt; do
[[ -n ${terminfo[$v]} ]] && key[$k]=${terminfo[$v]}
done
bindkey -- ${key[Home]-} beginning-of-line
bindkey -- ${key[End]-} end-of-line
bindkey -- ${key[Insert]-} overwrite-mode
bindkey -- ${key[Backspace]-} backward-delete-char
bindkey -- ${key[Delete]-} delete-char
bindkey -- ${key[Left]-} backward-char
bindkey -- ${key[Right]-} forward-char
bindkey -- ${key[PageUp]-} beginning-of-buffer-or-history
bindkey -- ${key[PageDown]-} end-of-buffer-or-history
bindkey -- ${key[ShiftTab]-} reverse-menu-complete
bindkey -- ${key[Up]-} up-line-or-beginning-search
bindkey -- ${key[Down]-} down-line-or-beginning-search
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
autoload -Uz add-zle-hook-widget
zle_app_start() { echoti smkx; }
zle_app_finish() { echoti rmkx; }
add-zle-hook-widget zle-line-init zle_app_start
add-zle-hook-widget zle-line-finish zle_app_finish
fi
# Aliases and one-liners
alias ll='ls -lh'
alias la='ls -A'
alias vmd='vmd -nt'
alias dnf-list-files='dnf repoquery -l'
alias gedit='gnome-text-editor'
alias xclip='xclip -selection c'
alias pdoman='podman'
alias git-list='git ls-tree -r HEAD --name-only'
alias chatgpt='aichat'
alias chromium='chromium --disable-features=GlobalShortcutsPortal'
podman-pull-all() {
for image in $(podman images --format "{{.Repository}}:{{.Tag}}"); do
podman pull "$image"
done
}
buildah-prune() { buildah rm --all; }
export EDITOR="code --wait"

View File

@@ -0,0 +1,8 @@
# see `man dnf.conf` for defaults and possible options
[main]
# installonly_limit=3
# best=False
skip_if_unavailable=True
deltarpm=True
fastestmirror=True

View File

@@ -0,0 +1,154 @@
## Path: System/File systems/btrfs
## Type: string(none,stdout,journal,syslog)
## Default: "stdout"
#
# Output target for messages. Journal and syslog messages are tagged by the task name like
# 'btrfs-scrub' etc.
BTRFS_LOG_OUTPUT="journal"
## Path: System/File systems/btrfs
## Type: string
## Default: ""
#
# Run periodic defrag on selected paths. The files from a given path do not
# cross mount points or other subvolumes/snapshots. If you want to defragment
# nested subvolumes, all have to be listed in this variable.
# (Colon separated paths)
BTRFS_DEFRAG_PATHS=""
## Path: System/File systems/btrfs
## Type: string(none,daily,weekly,monthly)
## Default: "none"
## ServiceRestart: btrfsmaintenance-refresh
#
# Frequency of defrag.
BTRFS_DEFRAG_PERIOD="none"
## Path: System/File systems/btrfs
## Type: string
## Default: "+1M"
#
# Minimal file size to consider for defragmentation
BTRFS_DEFRAG_MIN_SIZE="+1M"
## Path: System/File systems/btrfs
## Type: string
## Default: "/"
#
# Which mountpoints/filesystems to balance periodically. This may reclaim unused
# portions of the filesystem and make the rest more compact.
# (Colon separated paths)
# The special word/mountpoint "auto" will evaluate all mounted btrfs
# filesystems
BTRFS_BALANCE_MOUNTPOINTS="auto"
## Path: System/File systems/btrfs
## Type: string(none,daily,weekly,monthly)
## Default: "weekly"
## ServiceRestart: btrfsmaintenance-refresh
#
# Frequency of periodic balance.
#
# The frequency may be specified using one of the listed values or
# in the format documented in the "Calendar Events" section of systemd.time(7),
# if available.
BTRFS_BALANCE_PERIOD="weekly"
## Path: System/File systems/btrfs
## Type: string
## Default: "5 10"
#
# The usage percent for balancing data block groups.
#
# Note: default values should not disturb normal work but may not reclaim
# enough block groups. If you observe that, add higher values but beware that
# this will increase IO load on the system.
BTRFS_BALANCE_DUSAGE="0 20 50 80"
## Path: System/File systems/btrfs
## Type: string
## Default: "5"
#
# The usage percent for balancing metadata block groups. The values are also
# used in case the filesystem has mixed blockgroups.
#
# Note: default values should not disturb normal work but may not reclaim
# enough block groups. If you observe that, add higher values but beware that
# this will increase IO load on the system.
BTRFS_BALANCE_MUSAGE="80"
## Path: System/File systems/btrfs
## Type: string
## Default: "/"
#
# Which mountpoints/filesystems to scrub periodically.
# (Colon separated paths)
# The special word/mountpoint "auto" will evaluate all mounted btrfs
# filesystems
BTRFS_SCRUB_MOUNTPOINTS="auto"
## Path: System/File systems/btrfs
## Type: string(none,weekly,monthly)
## Default: "monthly"
## ServiceRestart: btrfsmaintenance-refresh
#
# Frequency of periodic scrub.
#
# The frequency may be specified using one of the listed values or
# in the format documented in the "Calendar Events" section of systemd.time(7),
# if available.
BTRFS_SCRUB_PERIOD="quarterly"
## Path: System/File systems/btrfs
## Type: string(idle,normal)
## Default: "idle"
#
# Priority of IO at which the scrub process will run. Idle should not degrade
# performance but may take longer to finish.
BTRFS_SCRUB_PRIORITY="idle"
## Path: System/File systems/btrfs
## Type: boolean
## Default: "false"
#
# Do read-only scrub and don't try to repair anything.
BTRFS_SCRUB_READ_ONLY="false"
## Path: System/File systems/btrfs
## Description: Configuration for periodic fstrim
## Type: string(none,daily,weekly,monthly)
## Default: "none"
## ServiceRestart: btrfsmaintenance-refresh
#
# Frequency of periodic trim. Off by default so it does not collide with
# fstrim.timer . If you do not use the timer, turn it on here. The recommended
# period is 'weekly'.
#
# The frequency may be specified using one of the listed values or
# in the format documented in the "Calendar Events" section of systemd.time(7),
# if available.
BTRFS_TRIM_PERIOD="weekly"
## Path: System/File systems/btrfs
## Description: Configuration for periodic fstrim - mountpoints
## Type: string
## Default: "/"
#
# Which mountpoints/filesystems to trim periodically.
# (Colon separated paths)
# The special word/mountpoint "auto" will evaluate all mounted btrfs
# filesystems
BTRFS_TRIM_MOUNTPOINTS="auto"
## Path: System/File systems/btrfs
## Description: Configuration to allow concurrent jobs
## Type: boolean
## Default: "false"
#
# These maintenance tasks may compete for resources with each other, blocking
# out other tasks from using the file systems. This option will force
# these jobs to run in FIFO order when scheduled at overlapping times. This
# may include tasks scheduled to run when a system resumes or boots when
# the timer for these tasks(s) elapsed while the system was suspended
# or powered off.
BTRFS_ALLOW_CONCURRENCY="false"

View File

@@ -0,0 +1,176 @@
#
# Example btrbk configuration file
#
#
# Please refer to the btrbk.conf(5) man-page for a complete
# description of all configuration options.
#
# Note that the options can be overridden per volume/subvolume/target
# in the corresponding sections.
#
# Enable transaction log
transaction_log /var/log/btrbk.log
# Enable stream buffer. Adding a buffer between the sending and
# receiving side is generally a good idea.
# NOTE: If enabled, make sure the "mbuffer" package is installed on
# the target host!
#stream_buffer 512m
# Directory in which the btrfs snapshots are created. Relative to
# <volume-directory> of the volume section.
# If not set, the snapshots are created in <volume-directory>.
#
# If you want to set a custom name for the snapshot (and backups),
# use the "snapshot_name" option within the subvolume section.
#
# NOTE: btrbk does not autmatically create this directory, and the
# snapshot creation will fail if it is not present.
#
snapshot_dir .snapshots
# Always create snapshots. Set this to "ondemand" to only create
# snapshots if the target volume is reachable. Set this to "no" if
# snapshot creation is done by another instance of btrbk.
snapshot_create ondemand
# Perform incremental backups (set to "strict" if you want to prevent
# creation of non-incremental backups if no parent is found).
#incremental yes
# Specify after what time (in full hours after midnight) backups/
# snapshots are considered as a daily backup/snapshot
#preserve_hour_of_day 0
# Specify on which day of week weekly/monthly backups are to be
# preserved.
#preserve_day_of_week sunday
# Preserve all snapshots for a minimum period of time.
#snapshot_preserve_min 1d
# Retention policy for the source snapshots.
#snapshot_preserve <NN>h <NN>d <NN>w <NN>m <NN>y
# Preserve all backup targets for a minimum period of time.
#target_preserve_min no
# Retention policy for backup targets:
#target_preserve <NN>h <NN>d <NN>w <NN>m <NN>y
# Retention policy for archives ("btrbk archive" command):
#archive_preserve_min no
#archive_preserve <NN>h <NN>d <NN>w <NN>m <NN>y
# Specify SSH private key for "ssh://" volumes / targets:
#ssh_identity /etc/btrbk/ssh/id_ed25519
ssh_identity /root/.ssh/id_ed25519
ssh_user root
ssh_compression no
#ssh_cipher_spec default
compat_remote busybox
send_protocol 2
# Enable compression for remote btrfs send/receive operations:
stream_compress no
#stream_compress_level default
#stream_compress_threads default
# Enable lock file support: Ensures that only one instance of btrbk
# can be run at a time.
lockfile /var/lock/btrbk.lock
# Don't wait for transaction commit on deletion. Set this to "after"
# or "each" to make sure the deletion of subvolumes is committed to
# disk when btrbk terminates.
#btrfs_commit_delete no
#
# Volume section: "volume <volume-directory>"
#
# <volume-directory> Directory of a btrfs volume (or subvolume)
# containing the subvolume to be backuped
# (usually the mount-point of a btrfs filesystem
# mounted with subvolid=5 option)
#
# Subvolume section: "subvolume <subvolume-name>"
#
# <subvolume-name> Subvolume to be backuped, relative to
# <volume-directory> in volume section.
#
# Target section: "target <type> <volume-directory>"
#
# <type> (optional) type, defaults to "send-receive".
# <volume-directory> Directory of a btrfs volume (or subvolume)
# receiving the backups.
#
# NOTE: The parser does not care about indentation, this is only for
# human readability. The options always apply to the last section
# encountered, overriding the corresponding option of the upper
# section. This means that the global options must be set before any
# "volume" section.
#
#
# Example configuration:
#
# Backup to external disk mounted on /mnt/btr_backup
#volume /mnt/btr_pool
# no action if external disk is not attached
# snapshot_create ondemand
# propagates to all subvolume sections:
# target /mnt/btr_backup/_btrbk
# subvolume root_gentoo
# subvolume kvm
# use different retention policy for kvm backups
# target_preserve 7d 4w
# Backup to external disk as well as some remote host
#volume /mnt/btr_data
# subvolume home
# always create snapshot, even if targets are unreachable
# snapshot_create always
# target /mnt/btr_backup/_btrbk
# target ssh://backup.my-remote-host.com/mnt/btr_backup
# Backup from remote host, with different naming
#volume ssh://my-remote-host.com/mnt/btr_pool
# subvolume data_0
# snapshot_dir snapshots/btrbk
# snapshot_name data_main
# target /mnt/btr_backup/_btrbk/my-remote-host.com
# Resume backups from remote host which runs its own btrbk instance
# creating snapshots for "home" in "/mnt/btr_pool/btrbk_snapshots".
#volume ssh://my-remote-host.com/mnt/btr_pool
# snapshot_dir btrbk_snapshots
# snapshot_create no
# snapshot_preserve_min all
# subvolume home
# target /mnt/btr_backup/_btrbk/my-remote-host.com
snapshot_preserve_min 2d
snapshot_preserve 14d
target_preserve_min no
target_preserve 14d 10w *m
archive_preserve_min latest
archive_preserve 12m 10y
subvolume /
target_preserve 14d 10w 6m
snapshot_dir /.snapshots
target ssh://workstation/mnt/backup/laptop/root
# target ssh://router.lan/mnt/backup/laptop/root
volume /home
subvolume bryan
# target /mnt/backup/laptop/home
target ssh://workstation/mnt/backup/laptop/home
# target ssh://router.lan/mnt/backup/laptop/home

View File

@@ -0,0 +1,5 @@
[ids]
0001:0001:09b4e68d
[main]
leftmeta+leftshift+f23 = rightcontrol

View File

@@ -1,82 +1,18 @@
---
- name: Build file lists
ansible.builtin.set_fact:
dotfiles_files_home: "{{ lookup('community.general.filetree',
playbook_dir ~ '/dotfiles/common/home',
playbook_dir ~ '/dotfiles/' ~ group_names[0] ~ '/home') | selectattr('state', 'equalto', 'file') | rejectattr('path', 'match', '.*\\.j2$') | list }}"
dotfiles_templates_home: "{{ lookup('community.general.filetree',
playbook_dir ~ '/dotfiles/common/home',
playbook_dir ~ '/dotfiles/' ~ group_names[0] ~ '/home') | selectattr('state', 'equalto', 'file') | selectattr('path', 'match', '.*\\.j2$') | list }}"
dotfiles_files_root: "{{ lookup('community.general.filetree',
playbook_dir ~ '/dotfiles/common/root',
playbook_dir ~ '/dotfiles/' ~ group_names[0] ~ '/root') | selectattr('state', 'equalto', 'file') | rejectattr('path', 'match', '.*\\.j2$') | list }}"
dotfiles_templates_root: "{{ lookup('community.general.filetree',
playbook_dir ~ '/dotfiles/common/root',
playbook_dir ~ '/dotfiles/' ~ group_names[0] ~ '/root') | selectattr('state', 'equalto', 'file') | selectattr('path', 'match', '.*\\.j2$') | list }}"
- name: Deploy home dotfiles
ansible.builtin.include_tasks: ../../deploy_files.yml
vars:
var_prefix: dotfiles_home
subdir: home
target_root: "{{ ansible_facts.env.HOME }}"
use_symlinks: true
become_root: false
- name: Ensure home directories
ansible.builtin.file:
path: "{{ ansible_facts.env.HOME }}/{{ item.path | dirname }}"
state: directory
mode: "{{ '0700' if (item.path | dirname).startswith('.ssh') else '0755' }}"
loop: "{{ dotfiles_files_home + dotfiles_templates_home }}"
when: item.path | dirname != ''
- name: Deploy home files (local)
ansible.builtin.file:
src: "{{ item.src }}"
dest: "{{ ansible_facts.env.HOME }}/{{ item.path }}"
state: link
force: true
loop: "{{ dotfiles_files_home }}"
when: ansible_connection in ['local', 'localhost']
- name: Deploy home files (remote)
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ ansible_facts.env.HOME }}/{{ item.path }}"
mode: preserve
loop: "{{ dotfiles_files_home }}"
when: ansible_connection not in ['local', 'localhost']
- name: Render home templates
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ ansible_facts.env.HOME }}/{{ item.path | replace('.j2', '') }}"
mode: preserve
loop: "{{ dotfiles_templates_home }}"
- name: Ensure root directories
ansible.builtin.file:
path: "/{{ item.path | dirname }}"
state: directory
mode: '0755'
loop: "{{ dotfiles_files_root + dotfiles_templates_root }}"
become: true
- name: Deploy root files (local)
ansible.builtin.file:
src: "{{ item.src }}"
dest: "/{{ item.path }}"
state: link
force: true
loop: "{{ dotfiles_files_root }}"
when: ansible_connection in ['local', 'localhost']
become: true
- name: Deploy root files (remote)
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "/{{ item.path }}"
mode: preserve
loop: "{{ dotfiles_files_root }}"
when: ansible_connection not in ['local', 'localhost']
become: true
- name: Render root templates
ansible.builtin.template:
src: "{{ item.src }}"
dest: "/{{ item.path | replace('.j2', '') }}"
mode: preserve
loop: "{{ dotfiles_templates_root }}"
become: true
- name: Deploy root dotfiles
ansible.builtin.include_tasks: ../../deploy_files.yml
vars:
var_prefix: dotfiles_root
subdir: root
target_root: "/"
use_symlinks: true
become_root: true

View File

@@ -0,0 +1,253 @@
#
# Example btrbk configuration file
#
#
# Please refer to the btrbk.conf(5) man-page for a complete
# description of all configuration options.
# For more examples, see README.md included with this package.
#
# btrbk.conf(5): <https://digint.ch/btrbk/doc/btrbk.conf.5.html>
# README.md: <https://digint.ch/btrbk/doc/readme.html>
#
# Note that the options can be overridden per volume/subvolume/target
# in the corresponding sections.
#
# Enable transaction log
transaction_log /var/log/btrbk.log
# Specify SSH private key for remote connections
ssh_identity /home/bryan/.config/btrbk/id_ed25519
ssh_user root
# Use sudo if btrbk or lsbtr is run by regular user
backend_local_user btrfs-progs-sudo
# Enable stream buffer. Adding a buffer between the sending and
# receiving side is generally a good idea.
# NOTE: If enabled, make sure to install the "mbuffer" package!
stream_buffer 1g
# Directory in which the btrfs snapshots are created. Relative to
# <volume-directory> of the volume section.
# If not set, the snapshots are created in <volume-directory>.
#
# If you want to set a custom name for the snapshot (and backups),
# use the "snapshot_name" option within the subvolume section.
#
# NOTE: btrbk does not automatically create this directory, and the
# snapshot creation will fail if it is not present.
#
snapshot_dir .snapshots
# Always create snapshots. Set this to "ondemand" to only create
# snapshots if the target volume is reachable. Set this to "no" if
# snapshot creation is done by another instance of btrbk.
snapshot_create onchange
# Perform incremental backups (set to "strict" if you want to prevent
# creation of non-incremental backups if no parent is found).
#incremental yes
# Specify after what time (in full hours after midnight) backups/
# snapshots are considered as a daily backup/snapshot
#preserve_hour_of_day 0
# Specify on which day of week weekly/monthly backups are to be
# preserved.
#preserve_day_of_week sunday
# Preserve all snapshots for a minimum period of time.
#snapshot_preserve_min 1d
# Retention policy for the source snapshots.
#snapshot_preserve <NN>h <NN>d <NN>w <NN>m <NN>y
# Preserve all backup targets for a minimum period of time.
#target_preserve_min no
# Retention policy for backup targets:
#target_preserve <NN>h <NN>d <NN>w <NN>m <NN>y
# Retention policy for archives ("btrbk archive" command):
#archive_preserve_min no
#archive_preserve <NN>h <NN>d <NN>w <NN>m <NN>y
# Enable compression for remote btrfs send/receive operations:
#stream_compress no
#stream_compress_level default
#stream_compress_threads default
# Enable lock file support: Ensures that only one instance of btrbk
# can be run at a time.
lockfile /var/lock/btrbk.lock
# Don't wait for transaction commit on deletion. Enable this to make
# sure the deletion of subvolumes is committed to disk when btrbk
# terminates.
#btrfs_commit_delete no
#
# Volume section (optional): "volume <volume-directory>"
#
# <volume-directory> Base path within a btrfs filesystem
# containing the subvolumes to be backuped
# (usually the mount-point of a btrfs filesystem
# mounted with subvolid=5 option).
#
# Subvolume section: "subvolume <subvolume-name>"
#
# <subvolume-name> Subvolume to be backuped, relative to
# <volume-directory> in volume section.
#
# Target section: "target <type> <volume-directory>"
#
# <type> (optional) type, defaults to "send-receive".
# <volume-directory> Directory within a btrfs filesystem
# receiving the backups.
#
# NOTE: The parser does not care about indentation, this is only for
# human readability. All options apply to the last section
# encountered, overriding the corresponding option of the upper
# section. This means that the global options must be set on top,
# before any "volume", "subvolume" or "target section.
#
#
# Example retention policy:
#
# snapshot_preserve_min 2d
# snapshot_preserve 14d
# target_preserve_min no
# target_preserve 20d 10w *m
snapshot_preserve_min 2d
snapshot_preserve 14d
target_preserve_min no
target_preserve 14d 10w *m
archive_preserve_min latest
archive_preserve 12m 10y
# Global settings
compat_remote busybox
send_protocol 2
# Root backup workaround, omit the volume section
subvolume /
target_preserve 14d 10w 6m
snapshot_dir /.snapshots # Absolute path to snapshots dir
target /mnt/backup/workstation/root
# target ssh://router.lan/mnt/backup/workstation/root
# target /run/media/bryan/backup/workstation/root
# target ssh://home-router/mnt/backup/workstation/root
volume /home
subvolume bryan
target /mnt/backup/workstation/home
# target ssh://router.lan/mnt/backup/workstation/home
target_preserve 14d 10w 6m
# target ssh://home-router/mnt/backup/workstation/home
# target /run/media/bryan/backup/workstation/home
volume /mnt/downloads
subvolume downloads
target /mnt/backup/workstation/downloads
# target /run/media/bryan/backup/workstation/downloads
volume /
subvolume /mnt/ebooks
target /mnt/backup/media
subvolume /mnt/cover-art
target /mnt/backup/media
# target ssh://router.lan/mnt/backup/media
# target ssh://home-router/mnt/backup/media
volume /mnt/array/media
target /mnt/backup/media
# target ssh://router.lan/mnt/backup/media
# target ssh://home-router/mnt/backup/media
subvolume pictures
subvolume music
target_preserve_min all # for home-router to keep samba share (and safer overall)
# #
# # Simple setup: Backup root and home to external disk
# #
# snapshot_dir /btrbk_snapshots
# target /mnt/btr_backup
# subvolume /
# subvolume /home
# #
# # Complex setup
# #
# # In order to keep things organized, it is recommended to use "volume"
# # sections and mount the top-level subvolume (subvolid=5):
# #
# # $ mount -o subvolid=5 /dev/sda1 /mnt/btr_pool
# #
# # Backup to external disk mounted on /mnt/btr_backup
# volume /mnt/btr_pool
# # Create snapshots in /mnt/btr_pool/btrbk_snapshots
# snapshot_dir btrbk_snapshots
# # Target for all subvolume sections:
# target /mnt/btr_backup
# # Some default btrfs installations (e.g. Ubuntu) use "@" for rootfs
# # (mounted at "/") and "@home" (mounted at "/home"). Note that this
# # is only a naming convention.
# #subvolume @
# subvolume root
# subvolume home
# subvolume kvm
# # Use different retention policy for kvm backups:
# target_preserve 7d 4w
# # Backup data to external disk as well as remote host
# volume /mnt/btr_data
# subvolume data
# # Always create snapshot, even if targets are unreachable
# snapshot_create always
# target /mnt/btr_backup
# target ssh://backup.my-remote-host.com/mnt/btr_backup
# # Backup from remote host, with different naming
# volume ssh://my-remote-host.com/mnt/btr_pool
# subvolume data_0
# snapshot_dir snapshots/btrbk
# snapshot_name data_main
# target /mnt/btr_backup/my-remote-host.com
# # Backup on demand (noauto) to remote host running busybox, login as
# # regular user using ssh-agent with current user name (ssh_user no)
# # and default credentials (ssh_identity no).
# volume /home
# noauto yes
# compat busybox
# backend_remote btrfs-progs-sudo
# ssh_user no
# ssh_identity no
# target ssh://my-user-host.com/mnt/btr_backup/home
# subvolume alice
# subvolume bob
# # Resume backups from remote host which runs its own btrbk instance
# # creating snapshots for "home" in "/mnt/btr_pool/btrbk_snapshots".
# volume ssh://my-remote-host.com/mnt/btr_pool
# snapshot_dir btrbk_snapshots
# snapshot_create no
# snapshot_preserve_min all
# subvolume home
# target /mnt/btr_backup/my-remote-host.com

View File

@@ -0,0 +1,131 @@
#
# pwrstatd configuration file
#
# You must restart pwrstatd after changing this file in order for changes to take effect.
# Ex:/etc/init.d/pwrstatd restart
#
# Action setting for event of Power Failure
#
# A delay time in seconds since event of Power Failure occur then to run shell
# script and shutdown system. Allowed range is 0 ~ 3600. Default is 60 sec.
powerfail-delay = 60
# Enable to run shell script when the event of Power Failure occur.
# The allowed options are yes and no. Default is yes.
powerfail-active = no
# Assign a path of script file for event of Power Failure.
# The default is /etc/pwrstatd-powerfail.sh
powerfail-cmd-path = /etc/pwrstatd-powerfail.sh
# How much time in seconds to take script running for event of Power Failure.
# The allowed range is 0 ~ 3600. Default is 0 sec.
powerfail-duration = 0
# Allow Daemon to shutdown system for event of Power Failure.
# The allowed options are yes and no. Default is yes.
powerfail-shutdown = no
#
# Action setting for event of Battery Low
#
# A threshold of Battery Capacity, If the battery capacity is lower than this
# value and a event of Battery Low will be identified. The unit is percentage.
# The allowed range is 0 ~ 90. Default is 35 %.
lowbatt-threshold = 10
# A threshold of Remaining Runtime, If the Remaining Runtime is lower than this
# value and a event of Battery Low will be identified. The unit is second.
# The allowed range is 0 ~ 3600. Default is 300 sec.
# Note: When meet this condition the below 'shutdown-sustain' property
# will be ignored.
runtime-threshold = 180
# Enable to run shell script when the event of Battery Low occur.
# The allowed options are yes and no. Default is yes.
lowbatt-active = no
# Assign a path of script file for event of Battery Low.
# The default is /etc/pwrstatd-lowbatt.sh
lowbatt-cmd-path = /etc/pwrstatd-lowbatt.sh
# How much time in seconds to take script running for event of Battery Low.
# The allowed range is 0 ~ 60. Default is 0 sec.
lowbatt-duration = 0
# Allow Daemon to shutdown system for event of Battery Low.
# The allowed options are yes and no. Default is yes.
lowbatt-shutdown = yes
# Turn UPS alarm on or off.
# The allowed options are yes and no. Default is yes.
enable-alarm = yes
# The necessary time in seconds for system shutdown.
# The UPS will turn power off when this time is expired.
# The allowed range is 0 ~ 3600. Default is 600 sec.(10 min.)
# If the computer shutdown is cause by low runtime condition, the UPS will
# turn power off when the time is expired that time is assigned on
# 'runtime-threshold' property and it is no longer to refer the
# 'shutdown-sustain' property.
shutdown-sustain = 0
# Daemon will turn UPS power off once it ask system shutdown cause by a power
# event. Allowed options are yes and no. Default is yes.
turn-ups-off = no
# The period of polling UPS in seconds.
# The allowed range is 1 ~ 60. Default is 3 sec.
ups-polling-rate = 5
# the period of re-try to find available UPS in seconds since find nothing at
# last time. The allowed range is 1 ~ 300. Default is 10 sec.
ups-retry-rate = 10
# Prohibiting daemon to provide communication mechanism for client, such as
# pwrstat command. normally, it should be 'no'. It can be 'yes' if any security
# consideration. Allowed options are yes and no. Default is no.
prohibit-client-access = no
# The pwrstatd accepts four types of device node which includes the 'ttyS',
# 'ttyUSB', 'hiddev', and 'libusb' for communication with UPS. The pwrstatd
# defaults to enumerate all acceptable device nodes and pick up to use an
# available device node automatically. But this may cause a disturbance to the
# device node which is occupied by other software. Therefore, you can restrict
# this enumerate behave by using allowed-device-nodes option. You can assign
# the single device node path or multiple device node paths divided by a
# semicolon at this option. All groups of 'ttyS', 'ttyUSB', 'hiddev', or
# 'libusb' device node are enumerated without a suffix number assignment.
# Note, the 'libusb' does not support suffix number only.
#
# For example: restrict to use ttyS1, ttyS2 and hiddev1 device nodes at /dev
# path only.
# allowed-device-nodes = /dev/ttyS1;/dev/ttyS2;/dev/hiddev1
#
# For example: restrict to use ttyS and ttyUSB two groups of device node at
# /dev,/dev/usb, and /dev/usb/hid paths(includes ttyS0 to ttySN and ttyUSB0 to
# ttyUSBN, N is number).
# allowed-device-nodes = ttyS;ttyUSB
#
# For example: restrict to use hiddev group of device node at /dev,/dev/usb,
# and /dev/usb/hid paths(includes hiddev0 to hiddevN, N is number).
# allowed-device-nodes = hiddev
#
# For example: restrict to use libusb device.
# allowed-device-nodes = libusb
allowed-device-nodes =
# Daemon will hibernate system to instead of system shutdown when power
# event occur. Allowed options are yes and no. Default is no.
hibernate = no
# Enable cloud solution.
# The allowed options are yes and no. Default is no.
cloud-active = no
# Account for cloud server login.
cloud-account =