commit b6e4425b9bd23b6e954e2c024a73c815f730205c Author: Ryan Hamilton Date: Mon Jul 21 11:26:46 2025 -0500 init commit diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..c145caa --- /dev/null +++ b/.bash_aliases @@ -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' \ No newline at end of file diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..6201284 --- /dev/null +++ b/.bashrc @@ -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 diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..a928067 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,9 @@ +[user] + name = Ryan Hamilton + email = rhamilton@tulsacounty.org + +[color] + ui = auto + +[core] + editor = nano diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..604a853 --- /dev/null +++ b/.inputrc @@ -0,0 +1,5 @@ +# ~/.inputrc + +set completion-ignore-case on +set show-all-if-ambiguous on +TAB: menu-complete diff --git a/README.md b/README.md new file mode 100644 index 0000000..e23aac6 --- /dev/null +++ b/README.md @@ -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) diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..6953638 --- /dev/null +++ b/install.sh @@ -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."