init commit

This commit is contained in:
2025-07-21 11:26:46 -05:00
commit b6e4425b9b
6 changed files with 117 additions and 0 deletions

23
.bash_aliases Normal file
View File

@@ -0,0 +1,23 @@
# ~/.bash_aliases
alias ll='ls -alF --color=auto'
alias la='ls -A --color=auto'
alias l='ls -CF --color=auto'
alias h='history'
alias grep='grep --color=auto'
alias d='docker'
alias dc='docker compose'
alias dotpull='echo "🔄 Updating dotfiles..." && git -C ~/.dotfiles pull && echo "✅ Done."'
alias reloadbash='source ~/.bashrc && echo "Bash config reloaded."'
linkdocker() {
if [ -e ~/docker ] && [ ! -L ~/docker ]; then
echo "~/docker exists and is not a symlink. Not replacing."
return 1
fi
ln -sf /opt/docker ~/docker
}
alias install_tailscale='curl -fsSL https://tailscale.com/install.sh | sh'
alias hs_connect='sudo tailscale up --login-server https://headscale.portal.tulsacounty.org --accept-routes'

25
.bashrc Normal file
View File

@@ -0,0 +1,25 @@
# ~/.bashrc - loaded during interactive shells
# Source global definitions if available
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Source user aliases
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# Color prompt
PS1='\[\e[0;36m\]\u@\h \[\e[0;33m\]\w\[\e[0m\] \$ '
# History settings
HISTSIZE=10000
HISTFILESIZE=20000
HISTCONTROL=ignoredups:erasedups
shopt -s histappend
# Enable bash completion if available
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

9
.gitconfig Normal file
View File

@@ -0,0 +1,9 @@
[user]
name = Ryan Hamilton
email = rhamilton@tulsacounty.org
[color]
ui = auto
[core]
editor = nano

5
.inputrc Normal file
View File

@@ -0,0 +1,5 @@
# ~/.inputrc
set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete

8
README.md Normal file
View File

@@ -0,0 +1,8 @@
# Ryan's Dotfiles
Minimal Bash dotfiles for SSH and remote environments.
## Install
```bash
bash <(curl -sL https://portal.tulsacounty.org/dotfiles_ryan)

47
install.sh Normal file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
set -euo pipefail
DOTFILES_REPO="https://gitea.portal.tulsacounty.org/rhamilton/dotfiles"
DOTFILES_DIR="$HOME/.dotfiles"
declare -A FILES_TO_LINK=(
[".bashrc"]="$HOME/.bashrc"
[".bash_aliases"]="$HOME/.bash_aliases"
[".inputrc"]="$HOME/.inputrc"
[".gitconfig"]="$HOME/.gitconfig"
)
# Clone or update the repo
if [ -d "$DOTFILES_DIR/.git" ]; then
echo "Updating existing dotfiles repo..."
git -C "$DOTFILES_DIR" pull --quiet
else
echo "Cloning dotfiles into $DOTFILES_DIR..."
git clone "$DOTFILES_REPO" "$DOTFILES_DIR"
fi
# Symlink each file safely
for file in "${!FILES_TO_LINK[@]}"; do
target="${FILES_TO_LINK[$file]}"
source="$DOTFILES_DIR/$file"
if [ -L "$target" ]; then
echo "✔ Symlink already exists: $target"
elif [ -e "$target" ]; then
echo "⚠️ Backing up existing file: $target -> ${target}.bak"
mv "$target" "${target}.bak"
ln -s "$source" "$target"
echo "🔗 Linked: $source$target"
else
ln -s "$source" "$target"
echo "🔗 Linked: $source$target"
fi
done
# Optionally source the new bashrc
if [[ $- == *i* ]]; then
echo "Reloading Bash config..."
source ~/.bashrc
fi
echo "✅ Dotfiles install complete."