Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion claude/config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"Bash(npm run test)",
"Bash(npm run lint)",
"Bash(npm run build)",
"Bash(gh issue view*)"
"Bash(gh issue view*)",
"Bash(gh pr view*)"
],
"deny": ["Bash(sed *)"]
}
Expand Down
1 change: 1 addition & 0 deletions git/gitconfig.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
cremit = commit --reedit-message=HEAD
sync = "!f() { remote=\"${GIT_UPSTREAM_NAME:-upstream}\"; branch=\"$(git rev-parse --abbrev-ref HEAD)\"; if [ \"$branch\" != \"main\" ] && [ \"$branch\" != \"master\" ]; then echo \"Error: Must be on main or master branch (currently on $branch)\"; return 1; fi; git fetch \"$remote\" --tags || return 1; if [ -n \"$1\" ]; then ref=\"$1\"; sync_branch=\"sync/${ref}\"; else git remote set-head \"$remote\" --auto 2>/dev/null; upstream_branch=\"$(git symbolic-ref \"refs/remotes/$remote/HEAD\" 2>/dev/null | sed \"s|refs/remotes/$remote/||\")\" || { echo \"Error: Could not determine default branch for $remote\"; return 1; }; ref=\"$remote/$upstream_branch\"; sync_branch=\"sync/$(date +%s)-${upstream_branch}\"; fi; git checkout -b \"$sync_branch\" && git merge \"$ref\" -m \"Merge upstream ${ref}\"; }; f"
fpush = push --force-with-lease
track = !git branch --set-upstream-to=origin/$(git symbolic-ref --short HEAD)
[pull]
default = current
rebase = true
Expand Down
2 changes: 2 additions & 0 deletions git/gitignore.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ venv
##########################
.claude
CLAUDE.md
CLAUDE.local.md
agents.local.md
12 changes: 12 additions & 0 deletions iterm/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,20 @@ printf "\e[32mConfiguring iTerm2\e[0m\n"
# ==============================================================================
# 1. Disable preference sync folder (if previously enabled)
# ==============================================================================
# iTerm2 rewrites its preferences from in-memory state on quit, which will
# clobber any `defaults write` we do here. If iTerm2 is running, warn the
# user — the settings below will only stick after a clean quit and relaunch.
if pgrep -xq iTerm2; then
printf "\e[33m⚠️ iTerm2 is currently running.\e[0m\n"
printf "\e[33m It will overwrite these preferences on quit.\e[0m\n"
printf "\e[33m Quit iTerm2 completely, then re-run this script.\e[0m\n"
fi

info "Disabling plist sync folder..."
defaults write com.googlecode.iterm2 "LoadPrefsFromCustomFolder" -bool false
# Clear the stale custom folder path so iTerm2 doesn't complain about a
# missing/malformed directory on next launch.
defaults delete com.googlecode.iterm2 "PrefsCustomFolder" 2> /dev/null || true

# ==============================================================================
# 2. Set up Dynamic Profiles
Expand Down
3 changes: 1 addition & 2 deletions iterm/profiles/Default.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"Profiles": [
{
"Name": "Default",
"Name": "Dotfiles Default",
"Guid": "dotfiles-default-profile",
"Dynamic Profile Parent Name": "Default",

"Working Directory": "~",
"Custom Directory": "Recycle",
Expand Down
29 changes: 29 additions & 0 deletions newsyslog/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -e
source ~/.dotfiles/lib/functions.sh

NEWSYSLOG_D="/etc/newsyslog.d"
DOTFILES_NEWSYSLOG=~/.dotfiles/newsyslog

check_exists "$NEWSYSLOG_D"

info "Configuring newsyslog"

for conf_file in "$DOTFILES_NEWSYSLOG"/*.conf; do
filename="$(basename "$conf_file")"
target="${NEWSYSLOG_D}/${filename}"

if [ -L "$target" ]; then
info "${filename} already symlinked"
else
if [ -e "$target" ]; then
warn "${filename} exists and is not a symlink, backing up"
sudo mv "$target" "${target}.backup"
fi
info "Symlinking ${filename} (requires sudo)"
sudo ln -s "$conf_file" "$target"
success "Symlinked ${filename}"
fi
done

success "newsyslog configured"
2 changes: 2 additions & 0 deletions newsyslog/postgresql.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/opt/homebrew/var/log/postgresql@14.log 644 2 51200 * JN
17 changes: 17 additions & 0 deletions postgresql/conf.d/logging.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Enable the logging collector (required for log rotation)
logging_collector = on

# Log directory (relative to data directory)
log_directory = 'log'

# Use day-of-week filenames so logs cycle weekly
log_filename = 'postgresql-%a.log'

# Rotate log files when they reach 50MB
log_rotation_size = 50MB

# Also rotate daily
log_rotation_age = 1d

# Overwrite same-named log files from previous weeks
log_truncate_on_rotation = on
50 changes: 48 additions & 2 deletions postgresql/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,58 @@ source ~/.dotfiles/lib/functions.sh

check_command brew

# Determine the PostgreSQL data directory
PG_DATA="$(brew --prefix)/var/postgres"
PG_CONF="${PG_DATA}/postgresql.conf"
CONF_D="${PG_DATA}/conf.d"
DOTFILES_CONF_D=~/.dotfiles/postgresql/conf.d

check_exists "$PG_CONF"

# Set up conf.d include directory
info "Configuring PostgreSQL conf.d"

if [ ! -d "$CONF_D" ]; then
mkdir -p "$CONF_D"
success "Created ${CONF_D}"
fi

# Enable include_dir in postgresql.conf if not already enabled
if ! grep -q "^include_dir = 'conf.d'" "$PG_CONF"; then
info "Enabling conf.d include directory in postgresql.conf"
echo "" >> "$PG_CONF"
echo "include_dir = 'conf.d'" >> "$PG_CONF"
success "Enabled conf.d include directory"
else
info "conf.d include directory already enabled"
fi

# Symlink config files from dotfiles conf.d into the PostgreSQL conf.d
for conf_file in "$DOTFILES_CONF_D"/*.conf; do
filename="$(basename "$conf_file")"
target="${CONF_D}/${filename}"

if [ -L "$target" ]; then
info "${filename} already symlinked"
else
if [ -e "$target" ]; then
warn "${filename} exists and is not a symlink, backing up"
mv "$target" "${target}.backup"
fi
ln -s "$conf_file" "$target"
success "Symlinked ${filename}"
fi
done

# Start (or restart) PostgreSQL to pick up config changes
info "Starting PostgreSQL service"

if brew services start postgresql; then
success "PostgreSQL service started"
else
warn "PostgreSQL service may already be running"
warn "PostgreSQL service may already be running, restarting"
brew services restart postgresql
success "PostgreSQL service restarted"
fi

# Since I always come here when psql is not working as expected
Expand All @@ -18,7 +64,7 @@ fi
# brew services restart -v postgresql
# brew services info -a
# brew postgresql-upgrade-database
# tail /opt/homebrew/var/log/postgres.log
# tail /opt/homebrew/var/postgres/log/
#
# If the postmaster.pid exists when it shouldn't (e.g. forced reboot)
# its location will be /opt/homebrew/var/postgres/postmaster.pid
2 changes: 1 addition & 1 deletion system/path.zsh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export PATH="$HOME/bin:$PATH"
export PATH="$HOME/.local/bin:$HOME/bin:$PATH"