Skip to content

Commit 2099b08

Browse files
authored
Merge branch 'master' into renovate/major-24-major
2 parents 39297bc + 9e0de5c commit 2099b08

File tree

8 files changed

+135
-49
lines changed

8 files changed

+135
-49
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,6 @@ hugo_stats.json
193193
hugo.linux
194194
hugo.darwin
195195
/.hugo_build.lock
196+
197+
# aws thing I'm trying
198+
update-aws-creds.sh

0-paths.rc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ esac
5656
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
5757
export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"
5858
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
59+
60+
# to fix Library not loaded: @rpath/libllama.dylib
61+
export PATH="${HOME}/git/llama.cpp/bin:$PATH"

1-zgen.rc

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,32 +40,14 @@ if ! zgen saved; then
4040
zsh-users/zsh-history-substring-search
4141
zdharma-continuum/fast-syntax-highlighting
4242

43-
ocodo/ollama_zsh_completion
44-
4543
# git related
4644
peterhurford/git-it-on.zsh
4745

4846
# fzf wrappers
49-
sunlei/zsh-ssh
5047
bigH/git-fuzzy
5148
EOPLUGINS
52-
53-
# olivierverdier/zsh-git-prompt # hasn't been updated in 9 years
54-
55-
# MichaelAquilina/zsh-you-should-us
56-
# paulirish/git-open
57-
# lukechilds/zsh-better-npm-completion
58-
# 3v1n0/zsh-bash-completions-fallback
59-
# mrkmg/borgbackup-zsh-completion
60-
# torifat/npms
61-
62-
## zsh completion generator ##
63-
# zgen load RobSis/zsh-completion-generator # Disabled for now as was the cause of 25% of my load time
64-
65-
## Not in use at present ##
66-
# nnao45/zsh-kubectl-completion
67-
# trejo08/kubecolor-zsh
68-
# ascii-soup/zsh-url-highlighter
49+
# sunlei/zsh-ssh
50+
# ocodo/ollama_zsh_completion
6951

7052
# save zgen cache
7153
zgen save

14-source-files.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ eval "$(/opt/homebrew/bin/fnm env --use-on-cd --corepack-enabled)"
88
eval "$(saml2aws --completion-script-zsh)"
99

1010
#asdf
11-
. /opt/homebrew/opt/asdf/libexec/asdf.sh
11+
# . /opt/homebrew/opt/asdf/libexec/asdf.sh
1212

1313
#pyenv
1414
export PYENV_ROOT="$HOME/.pyenv"
1515
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
1616
eval "$(pyenv init -)"
17-
# uv
17+
1818
. ~/.venv/bin/activate
1919

2020
# # pnpm
@@ -30,6 +30,6 @@ eval "$(pyenv init -)"
3030
# nav bindkeys
3131

3232
#cargo
33-
if [ -d "$HOME/.cargo/env" ]; then
33+
if [ -f "$HOME/.cargo/env" ]; then
3434
. "$HOME/.cargo/env"
3535
fi

4-aliases.rc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ alias flushdns='sudo discoveryutil udnsflushcaches'
9292
alias httpserver='sudo python3 -m http.server 80'
9393
alias cc='colorize.py'
9494
alias rmid="ssh-keygen -R"
95-
# alias aria="aria2c -s 5 -j 5 -x 5 -c --enable-http-pipelining=true --http-accept-gzip=true --max-connection-per-server=10"
95+
# alias aria="aria2c -s 5 -j 5 -x 5 -c --enable-http-pipelining=true --http-accept-gzip=true --max-connection-per-server=10 --content-disposition-default-utf8=true"
9696
# alias a=aria
9797
alias dmesg="dmesg -LT"
9898
alias cpuinfo="sysctl -n machdep.cpu.brand_string"
@@ -197,7 +197,11 @@ alias rotate_min_supports='tweaker3 -vb -x -min sur -i'
197197

198198
alias obsidian='cd /Users/samm/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Main && ls -ltarh'
199199

200-
# ML / Github Copilot
200+
# ML / AI
201+
# shellcheck disable=SC2139
202+
alias clinerules="code /Users/samm/Library/Mobile\ Documents/com\~apple\~CloudDocs/Documents/Cline"
203+
alias clinerulesd="cd /Users/samm/Library/Mobile\ Documents/com\~apple\~CloudDocs/Documents/Cline"
204+
alias sync_ollama_models="${HOME}/git/sammcj/scripts/ollama/export_ollama_model.py"
201205
alias copilot="gh copilot suggest -t shell"
202206
alias copilot-explain="gh copilot explain"
203207
alias '??'='copilot'

5-exports.rc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export MU_REPO_SERIAL=false
1212
export EDITOR=vim
1313

1414
# colima / docker
15-
export DOCKER_HOST="unix://$HOME/.colima/docker.sock"
15+
# export DOCKER_HOST="unix://$HOME/.colima/docker.sock"
16+
# export DOCKER_HOST="unix:///Users/samm/.colima/default/docker.sock"
1617

1718
# Tells 'less' not to paginate if less than a page
1819
export LESS="-F -X $LESS"

9-functions.rc

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,9 @@ function ba() {
11091109
# link all ollama models to lm-studio
11101110
llamalink >>"${log_file}" 2>&1 &
11111111

1112+
# update vscode packages
1113+
code --update-extensions >>"${log_file}" 2>&1 &
1114+
11121115
# update homebrew and all apps
11131116
brew update >>"${error_log}" 2>&1
11141117

@@ -1416,18 +1419,61 @@ function touchid_sudo() {
14161419
}
14171420

14181421
a() {
1419-
# Run aria2c with the specified options
1420-
aria2c \
1421-
--split=12 \
1422-
--always-resume=true \
1423-
--enable-http-pipelining=true \
1424-
--http-accept-gzip=true \
1425-
--max-connection-per-server=10 \
1426-
--max-concurrent-downloads=8 \
1427-
--auto-file-renaming=false \
1428-
"$1"
1422+
# Extract filename from the URL (the part after the last slash)
1423+
local filename
1424+
filename=$(basename "$1")
1425+
1426+
# Base aria2c options
1427+
local aria_opts=(
1428+
--split=16
1429+
--always-resume=true
1430+
--max-tries=15
1431+
--retry-wait=3
1432+
--enable-http-pipelining=true
1433+
--http-accept-gzip=true
1434+
--max-connection-per-server=16
1435+
--max-concurrent-downloads=5
1436+
--min-split-size=10M
1437+
--auto-file-renaming=false
1438+
--content-disposition-default-utf8=true
1439+
--disk-cache=64M
1440+
--file-allocation=prealloc
1441+
--out="$filename"
1442+
)
14291443

1430-
echo "downloaded ${1}"
1444+
# Check if URL is from Huggingface
1445+
if [[ "$1" == *"huggingface.co"* ]] || [[ "$1" == *"hf.co"* ]]; then
1446+
# Check if HUGGINGFACE_TOKEN is set
1447+
if [ -z "${HUGGINGFACE_TOKEN}" ]; then
1448+
echo "Warning: HUGGINGFACE_TOKEN is not set. You may experience rate limiting."
1449+
else
1450+
# Verify token is valid by making a test request to the newer endpoint
1451+
echo "Verifying Huggingface token..."
1452+
local token_check
1453+
token_check=$(curl -s -I -H "Authorization: Bearer ${HUGGINGFACE_TOKEN}" "https://huggingface.co/api/whoami-v2" | grep -c "HTTP/2 200")
1454+
1455+
if [ "$token_check" -eq 1 ]; then
1456+
echo "✅ Huggingface token is valid."
1457+
aria_opts+=(--header="Authorization: Bearer ${HUGGINGFACE_TOKEN}")
1458+
else
1459+
echo "⚠️ Huggingface token appears to be invalid. Downloads may be rate limited."
1460+
echo "Note: If your token starts with 'hf_', this is expected format for newer tokens."
1461+
# shellcheck disable=SC2162
1462+
read -p "Continue anyway? (y/n): " confirm
1463+
if [[ "$confirm" != "y" ]]; then
1464+
echo "Download cancelled."
1465+
return 1
1466+
fi
1467+
# Add the token anyway as it might still work for downloads even if validation fails
1468+
aria_opts+=(--header="Authorization: Bearer ${HUGGINGFACE_TOKEN}")
1469+
fi
1470+
fi
1471+
fi
1472+
1473+
# Run aria2c with the assembled options
1474+
aria2c "${aria_opts[@]}" "$1"
1475+
1476+
echo "downloaded ${1} as ${filename}"
14311477
}
14321478

14331479
rename_files() {
@@ -1634,6 +1680,10 @@ function aws-sso() {
16341680
}
16351681
alias aws-ai="aws-sso aisandpit"
16361682

1683+
function aws-nas() {
1684+
/Users/samm/Library/Mobile\ Documents/com~apple~CloudDocs/Dropbox\ Import/dotfiles/shell_config/update-aws-creds.sh aisandpit
1685+
}
1686+
16371687
ollama_extend_models() {
16381688
local ctx_size=${1:-32768}
16391689

@@ -1666,3 +1716,11 @@ EOF
16661716
echo "Created extended model: $base_name-$ctx_size:$variant"
16671717
done
16681718
}
1719+
1720+
if_not_in_vscode() {
1721+
# if not running in vscode, run the rest of the arguments
1722+
# requires setting RUNNING_IN_VSCODE to true in vscode's terminal env settings
1723+
if [ -z "$RUNNING_IN_VSCODE" ]; then
1724+
"$@"
1725+
fi
1726+
}

zshrc

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
# shellcheck disable=SC2148 disable=SC1090 shell=bash
1+
# Amazon Q pre block. Keep at the top of this file.
2+
### q slow debugging ###
3+
# date
4+
# echo "STARTING: amazon q pre block loading from .zshrc"
5+
# # set zsh to echo verbose
6+
# set -x
7+
# ###
8+
# [[ -f "${HOME}/Library/Application Support/amazon-q/shell/zshrc.pre.zsh" ]] && builtin source "${HOME}/Library/Application Support/amazon-q/shell/zshrc.pre.zsh"
9+
# ### q slow debugging ###
10+
# date
11+
# # unset zsh to echo verbose
12+
# set +x
13+
# echo "DONE: amazon q pre block loaded from .zshrc"
14+
###
15+
## AMAZON Q MAKES EVERYTHING SLOWWWWWW
216

17+
# shellcheck disable=SC2148 disable=SC1090 shell=bash
318
# ~/.zshrc
419

520
# set +x
621

7-
set +m # Make jobs quiet by default
8-
22+
# only run set +m if we're interactive
23+
if [[ $- == *i* ]]; then
24+
set +m # Make jobs quiet by default
25+
fi
926
# There is an alias to jump to the directory with the various
1027
# included zsh configs, simply type `zshconfig` at the prompt.
1128

@@ -30,7 +47,7 @@ if [[ -d $HOME/Library/Mobile\ Documents/com\~apple\~CloudDocs/Dropbox\ Import/d
3047
fi
3148

3249
## Add ssh keys to agent if not already added
33-
ssh-add-keys
50+
# ssh-add-keys # TODO: disabled 2025-03-16 to see if it helps performance, reenable if ssh stops working
3451

3552
### Below are items added by installer scripts (usually homebrew) ####
3653

@@ -40,12 +57,15 @@ source /opt/homebrew/Cellar/fzf/*/shell/key-bindings.zsh
4057
# Enable direnv - https://direnv.net
4158
# eval "$(direnv hook zsh)"
4259

43-
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
60+
if_not_in_vscode bg_silent test -e "${HOME}/.iterm2_shell_integration.zsh" && bg_silent source "${HOME}/.iterm2_shell_integration.zsh"
4461

4562
zstyle ':completion:*' menu select
4663
fpath+=~/.zfunc
4764

48-
set -m # reenable job output
65+
# only run set -m if we're interactive
66+
if [[ $- == *i* ]]; then
67+
set -m # reenable job output
68+
fi
4969

5070
# >>> mamba initialize >>>
5171
# !! Contents within this block are managed by 'mamba init' !!
@@ -88,14 +108,29 @@ export PATH="$PATH:/Users/samm/Fltr"
88108

89109
# tabtab source for electron-forge package
90110
# uninstall by removing these lines or running `tabtab uninstall electron-forge`
91-
[[ -f /Users/samm/.npm/_npx/6913fdfd1ea7a741/node_modules/tabtab/.completions/electron-forge.zsh ]] && . /Users/samm/.npm/_npx/6913fdfd1ea7a741/node_modules/tabtab/.completions/electron-forge.zsh
92-
autoload -Uz compinit
111+
# [[ -f /Users/samm/.npm/_npx/6913fdfd1ea7a741/node_modules/tabtab/.completions/electron-forge.zsh ]] && . /Users/samm/.npm/_npx/6913fdfd1ea7a741/node_modules/tabtab/.completions/electron-forge.zsh
93112

94113
# Added by LM Studio CLI tool (lms)
95114
export PATH="$PATH:/Users/samm/.cache/lm-studio/bin"
115+
if [ -f "/Users/samm/.config/fabric/fabric-bootstrap.inc" ] && if_not_in_vscode; then . "/Users/samm/.config/fabric/fabric-bootstrap.inc"; fi
96116

97-
####### PROFILING #######
98-
# Uncomment below to enable debug timing
117+
fpath+=~/.zfunc
118+
119+
export PATH="/opt/homebrew/opt/tcl-tk@8/bin:$PATH"
120+
121+
# Amazon Q post block. Keep at the bottom of this file.
122+
# # The next line updates PATH for the Google Cloud SDK.
123+
if [ -f '/Users/samm/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/samm/Downloads/google-cloud-sdk/path.zsh.inc'; fi
124+
125+
# The next line enables shell command completion for gcloud.
126+
if [ -f '/Users/samm/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/samm/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
127+
128+
# # Amazon Q post block. Keep at the bottom of this file.
129+
# [[ -f "${HOME}/Library/Application Support/amazon-q/shell/zshrc.post.zsh" ]] && builtin source "${HOME}/Library/Application Support/amazon-q/shell/zshrc.post.zsh"
130+
131+
# ####### PROFILING #######
132+
# # Uncomment below to enable debug timing
99133
# zprof
100-
#### END PROFILING ######
101-
if [ -f "/Users/samm/.config/fabric/fabric-bootstrap.inc" ]; then . "/Users/samm/.config/fabric/fabric-bootstrap.inc"; fi
134+
# #### END PROFILING ######
135+
136+
# echo ".zshrc loaded now"

0 commit comments

Comments
 (0)