Initial commit
This commit is contained in:
7
dotfiles/common/.config/aichat/config.yaml.j2
Normal file
7
dotfiles/common/.config/aichat/config.yaml.j2
Normal 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 }}
|
||||
2
dotfiles/common/.env.j2
Normal file
2
dotfiles/common/.env.j2
Normal file
@@ -0,0 +1,2 @@
|
||||
OPENAI_API_KEY="{{ OPENAI_API_KEY }}"
|
||||
ANTHROPIC_API_KEY="{{ ANTHROPIC_API_KEY }}"
|
||||
10
dotfiles/common/.gitconfig
Normal file
10
dotfiles/common/.gitconfig
Normal 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
|
||||
46
dotfiles/common/.local/share/nautilus/scripts/share-link
Executable file
46
dotfiles/common/.local/share/nautilus/scripts/share-link
Executable 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
|
||||
3
dotfiles/common/.ssh/authorized_keys.j2
Normal file
3
dotfiles/common/.ssh/authorized_keys.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
{% for key in SSH_AUTHORIZED_KEYS %}
|
||||
{{ key }}
|
||||
{% endfor %}
|
||||
42
dotfiles/common/.ssh/config
Normal file
42
dotfiles/common/.ssh/config
Normal 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 ax6000
|
||||
Hostname ax6000.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-fedora42
|
||||
Hostname vm-fedora42
|
||||
|
||||
Host vm-alma9
|
||||
Hostname 192.168.122.235
|
||||
32
dotfiles/common/.tmux.conf
Normal file
32
dotfiles/common/.tmux.conf
Normal 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
|
||||
169
dotfiles/common/.vimrc
Normal file
169
dotfiles/common/.vimrc
Normal 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>
|
||||
|
||||
143
dotfiles/common/.zshrc
Normal file
143
dotfiles/common/.zshrc
Normal 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"
|
||||
|
||||
Reference in New Issue
Block a user