test
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
template = ~/.config/git/template
|
||||
gpgsign = true
|
||||
|
||||
[tag]
|
||||
forceSignAnnotated = true
|
||||
|
||||
[core]
|
||||
autocrlf = input # keep newlines as in input
|
||||
compression = 9 # trade cpu for network
|
||||
|
||||
Executable
+97
@@ -0,0 +1,97 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Git Backup Script for All Projects in /mnt/bulk/source
|
||||
# Usage: ./git_backup.sh [project_name] (optional - backup specific project)
|
||||
|
||||
# Configuration
|
||||
BACKUP_DIR="/mnt/nas/Jake/git_backups"
|
||||
TEMP_DIR="/tmp/git_backup_$(date +%Y%m%d)"
|
||||
REPO_SOURCE="/mnt/bulk/source"
|
||||
|
||||
# Find all git projects in /mnt/bulk/source
|
||||
find_git_projects() {
|
||||
local projects=()
|
||||
|
||||
# Find directories that contain .git folder
|
||||
while IFS= read -r -d '' project; do
|
||||
if [ -d "$project/.git" ]; then
|
||||
projects+=("$project")
|
||||
fi
|
||||
done < <(find "$REPO_SOURCE" -type d -print0)
|
||||
|
||||
echo "${projects[@]}"
|
||||
}
|
||||
|
||||
# Function to backup a single project
|
||||
backup_project() {
|
||||
local project_path="$1"
|
||||
local project_name=$(basename "$project_path")
|
||||
local temp_dir="${TEMP_DIR}_${project_name}"
|
||||
|
||||
echo "Backing up: $project_path"
|
||||
|
||||
# Check if HEAD exists (repository has commits)
|
||||
if ! git -C "$project_path" rev-parse HEAD > /dev/null 2>&1; then
|
||||
echo "Warning: $project_path has no commits, skipping..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Create temporary directory
|
||||
mkdir -p "$temp_dir"
|
||||
|
||||
# Archive the git project (excluding ignored files)
|
||||
git -C "$project_path" archive --format=tar --output="$temp_dir/backup.tar" HEAD
|
||||
|
||||
# Sync files to NAS
|
||||
rsync -az "$temp_dir/" "${BACKUP_DIR}/${timestamp}/${project_name}/"
|
||||
|
||||
# Clean up temporary files
|
||||
rm -rf "$temp_dir"
|
||||
}
|
||||
|
||||
# Main backup function
|
||||
main_backup() {
|
||||
local timestamp=$(date +%Y%m%d)
|
||||
|
||||
echo "Starting git backup for all projects..."
|
||||
|
||||
# Create dated backup directory on NAS
|
||||
mkdir -p "${BACKUP_DIR}/${timestamp}"
|
||||
|
||||
# Get all git projects
|
||||
local projects=($(find_git_projects))
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
# Backup all projects
|
||||
if [ ${#projects[@]} -eq 0 ]; then
|
||||
echo "No git projects found in $REPO_SOURCE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for project in "${projects[@]}"; do
|
||||
backup_project "$project"
|
||||
done
|
||||
else
|
||||
# Backup specific project
|
||||
local target_project="$1"
|
||||
if [ -d "$target_project" ] && [ -d "$target_project/.git" ]; then
|
||||
backup_project "$target_project"
|
||||
else
|
||||
echo "Project not found or not a git repository: $target_project"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Keep only 7 most recent backups
|
||||
cd "${BACKUP_DIR}" && ls -1d * | head -n -7 | xargs rm -rf
|
||||
|
||||
echo "Backup completed successfully!"
|
||||
}
|
||||
|
||||
# Run main backup function
|
||||
main_backup "$@"
|
||||
|
||||
# Clean up temporary directory if it exists
|
||||
if [ -d "$TEMP_DIR" ]; then
|
||||
rm -rf "$TEMP_DIR"
|
||||
fi
|
||||
Executable
+69
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Git Restore Script for Latest Backup
|
||||
# Usage: ./restore_git_backup.sh [project_name] (optional - restore specific project)
|
||||
|
||||
# Configuration
|
||||
BACKUP_DIR="/mnt/nas/Jake/git_backups"
|
||||
REPO_SOURCE="/mnt/bulk/temp"
|
||||
|
||||
# Function to restore a single project from latest backup
|
||||
restore_project() {
|
||||
local project_name="$1"
|
||||
local latest_backup=$(find "$BACKUP_DIR" -maxdepth 1 -type d -name "*" | sort -r | head -n 1)
|
||||
|
||||
if [ -z "$latest_backup" ]; then
|
||||
echo "Error: No backups found in $BACKUP_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local project_backup_path="${latest_backup}/${project_name}"
|
||||
|
||||
if [ ! -d "$project_backup_path" ]; then
|
||||
echo "Error: Backup for project '$project_name' not found in latest backup"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Restoring $project_name from latest backup..."
|
||||
|
||||
# Create the project directory if it doesn't exist
|
||||
mkdir -p "$REPO_SOURCE/$project_name"
|
||||
|
||||
# Extract the backup to the source directory
|
||||
tar -xf "${project_backup_path}/backup.tar" -C "$REPO_SOURCE/$project_name"
|
||||
|
||||
echo "Successfully restored $project_name from backup"
|
||||
}
|
||||
|
||||
# Main restore function
|
||||
main_restore() {
|
||||
local latest_backup=$(find "$BACKUP_DIR" -maxdepth 1 -type d -name "*" | sort -r | head -n 1)
|
||||
|
||||
if [ -z "$latest_backup" ]; then
|
||||
echo "Error: No backups found in $BACKUP_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Latest backup directory: $latest_backup"
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
# Restore all projects from latest backup
|
||||
echo "Restoring all projects from latest backup..."
|
||||
|
||||
# Get list of project directories in the backup
|
||||
local projects=($(ls "$latest_backup"))
|
||||
|
||||
for project in "${projects[@]}"; do
|
||||
restore_project "$project"
|
||||
done
|
||||
else
|
||||
# Restore specific project
|
||||
local target_project="$1"
|
||||
restore_project "$target_project"
|
||||
fi
|
||||
|
||||
echo "Restore completed successfully!"
|
||||
}
|
||||
|
||||
# Run main restore function
|
||||
main_restore "$@"
|
||||
+52
-25
@@ -1,15 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Fedora package bootstrap script
|
||||
# Author: Jake Pullen
|
||||
# Date : 2025-08-15
|
||||
#
|
||||
# Usage:
|
||||
# chmod +x fedora-setup.sh
|
||||
# sudo ./fedora-setup.sh
|
||||
# Fedora System Set Up Script
|
||||
# ------------------------------------------------------------
|
||||
# list all packages we want from dnf
|
||||
|
||||
# ============================================================
|
||||
# PACKAGE LISTING
|
||||
# ============================================================
|
||||
# List all packages we want from dnf
|
||||
package_list=(
|
||||
"kitty"
|
||||
"fastfetch"
|
||||
@@ -19,13 +17,15 @@ package_list=(
|
||||
"code"
|
||||
"just"
|
||||
)
|
||||
# list all the platpaks we want to install
|
||||
|
||||
# List all the flatpaks we want to install
|
||||
flatpacks_to_install=(
|
||||
"com.discordapp.Discord"
|
||||
"com.spotify.Client"
|
||||
"app.zen_browser.zen"
|
||||
)
|
||||
# list all the folders we want to link from our dotifles foler to our .config folder
|
||||
|
||||
# List all the folders we want to link from our dotfiles folder to our .config folder
|
||||
folders_to_link=(
|
||||
# "alacritty"
|
||||
"git"
|
||||
@@ -34,33 +34,47 @@ folders_to_link=(
|
||||
"starship.toml"
|
||||
)
|
||||
|
||||
# -------------------------------------------------
|
||||
|
||||
# ============================================================
|
||||
# SCRIPT SETUP
|
||||
# ============================================================
|
||||
set -euo pipefail # safer shell behaviour
|
||||
shopt -s expand_aliases # if you use aliases inside the script
|
||||
|
||||
# 1. Update system first
|
||||
# ============================================================
|
||||
# SYSTEM UPDATE
|
||||
# ============================================================
|
||||
echo "==> Updating Fedora base packages..."
|
||||
|
||||
sudo dnf upgrade --refresh -y
|
||||
|
||||
# 2. Install RPM‑Fusion repos (free & non‑free)
|
||||
# ============================================================
|
||||
# REPOSITORY SETUP
|
||||
# ============================================================
|
||||
echo "==> Enabling RPM-Fusion repositories..."
|
||||
sudo dnf install \
|
||||
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
|
||||
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm \
|
||||
-y
|
||||
|
||||
# prep for vs-code install
|
||||
# Prep for vs-code install
|
||||
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
||||
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
|
||||
|
||||
# ============================================================
|
||||
# PACKAGE INSTALLATION
|
||||
# ============================================================
|
||||
|
||||
# Create a string of packages
|
||||
package_string=$(IFS=' ' ; echo "${package_list[@]}")
|
||||
|
||||
# 3. Install packages listed
|
||||
# Install packages listed
|
||||
echo "==> Installing dnf Packages..."
|
||||
sudo dnf install $package_string -y --skip-unavailable
|
||||
|
||||
# ============================================================
|
||||
# FLATPAK SETUP
|
||||
# ============================================================
|
||||
|
||||
# 5. Install Flatpak (if not present) and set up Flathub
|
||||
if ! command -v flatpak &>/dev/null; then
|
||||
echo "==> Installing Flatpak..."
|
||||
@@ -71,11 +85,13 @@ echo "==> Adding Flathub repository..."
|
||||
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
flatpack_string=$(IFS=' ' ; echo "${flatpacks_to_install[@]}")
|
||||
# 6. Install Flatpak Apps
|
||||
echo "==> Installing Discord..."
|
||||
echo "==> Installing flatpaks..."
|
||||
flatpak install -y flathub $flatpack_string
|
||||
|
||||
# 7. Install stuff from around the web that we want
|
||||
# ============================================================
|
||||
# WEB INSTALLATION
|
||||
# ============================================================
|
||||
|
||||
# UV for Python Dev
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
@@ -85,30 +101,41 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
# Bazecore for the Dygma Keyboard
|
||||
./bazecore_grab.sh
|
||||
|
||||
# Starship because command line
|
||||
# Starship because command line glory
|
||||
curl -sS https://starship.rs/install.sh | sh
|
||||
|
||||
# sim link config
|
||||
# ============================================================
|
||||
# SYMBOLIC LINKING
|
||||
# ============================================================
|
||||
|
||||
for folder in "${folders_to_link[@]}"; do
|
||||
config_path="$HOME/dotfiles/$folder"
|
||||
target_path="$HOME/.config/$folder"
|
||||
ln -s "$config_path" "$target_path"
|
||||
done
|
||||
|
||||
# sym link other bits.
|
||||
# Sym link other bits.
|
||||
ln -s $HOME/dotfiles/git/gitconfig $HOME/.gitconfig
|
||||
ln -s $HOME/dotfiles/.justfile $HOME/.justfile
|
||||
|
||||
# untested zshrc sym link
|
||||
# slightly tested zshrc sym link
|
||||
sudo rm -f /etc/zshrc
|
||||
sudo ln -s /etc/zshrc $HOME/dotfiles/zsh/.zshrc
|
||||
|
||||
# nvim set up likely needs work
|
||||
# ============================================================
|
||||
# NVIM SETUP
|
||||
# ============================================================
|
||||
# Untested nvim kickstart clone
|
||||
git clone https://github.com/Jake-Pullen/kickstart.nvim.git $HOME/.config/nvim
|
||||
|
||||
# ============================================================
|
||||
# SHELL SETUP
|
||||
# ============================================================
|
||||
chsh -s /bin/zsh
|
||||
|
||||
# 9. Clean up (optional)
|
||||
# ============================================================
|
||||
# CLEANUP
|
||||
# ============================================================
|
||||
echo "==> Cleaning up package cache..."
|
||||
sudo dnf clean all
|
||||
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Ubuntu System Set Up Script
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# ============================================================
|
||||
# PACKAGE LISTING
|
||||
# ============================================================
|
||||
# List all packages we want from apt
|
||||
package_list=(
|
||||
"kitty"
|
||||
"fastfetch"
|
||||
"zsh"
|
||||
"btop"
|
||||
"steam"
|
||||
"code"
|
||||
"just"
|
||||
)
|
||||
|
||||
# List all the flatpaks we want to install
|
||||
flatpacks_to_install=(
|
||||
"com.discordapp.Discord"
|
||||
"com.spotify.Client"
|
||||
"app.zen_browser.zen"
|
||||
)
|
||||
|
||||
# List all the folders we want to link from our dotfiles folder to our .config folder
|
||||
folders_to_link=(
|
||||
# "alacritty"
|
||||
"git"
|
||||
"zsh"
|
||||
"kitty"
|
||||
"starship.toml"
|
||||
)
|
||||
|
||||
# ============================================================
|
||||
# SCRIPT SETUP
|
||||
# ============================================================
|
||||
set -euo pipefail # safer shell behaviour
|
||||
shopt -s expand_aliases # if you use aliases inside the script
|
||||
|
||||
# ============================================================
|
||||
# SYSTEM UPDATE
|
||||
# ============================================================
|
||||
echo "==> Updating Ubuntu base packages..."
|
||||
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
|
||||
# ============================================================
|
||||
# REPOSITORY SETUP
|
||||
# ============================================================
|
||||
echo "==> Enabling RPM-Fusion repositories..."
|
||||
# For Ubuntu, we'll skip RPM-Fusion since it's Fedora-specific
|
||||
|
||||
# Prep for vs-code install # TODO: needs testing / tewaking
|
||||
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
|
||||
|
||||
# ============================================================
|
||||
# PACKAGE INSTALLATION
|
||||
# ============================================================
|
||||
|
||||
# Create a string of packages
|
||||
package_string=$(IFS=' ' ; echo "${package_list[@]}")
|
||||
|
||||
# Install packages listed
|
||||
echo "==> Installing apt Packages..."
|
||||
sudo apt install $package_string -y --no-install-recommends
|
||||
|
||||
# ============================================================
|
||||
# FLATPAK SETUP
|
||||
# ============================================================
|
||||
|
||||
# 5. Install Flatpak (if not present) and set up Flathub
|
||||
if ! command -v flatpak &>/dev/null; then
|
||||
echo "==> Installing Flatpak..."
|
||||
sudo apt install flatpak -y
|
||||
fi
|
||||
|
||||
echo "==> Adding Flathub repository..."
|
||||
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
flatpack_string=$(IFS=' ' ; echo "${flatpacks_to_install[@]}")
|
||||
echo "==> Installing flatpaks..."
|
||||
flatpak install -y flathub $flatpack_string
|
||||
|
||||
# ============================================================
|
||||
# WEB INSTALLATION
|
||||
# ============================================================
|
||||
|
||||
# UV for Python Dev
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
# Rust, because we all love rust
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
|
||||
# Bazecore for the Dygma Keyboard
|
||||
./bazecore_grab.sh
|
||||
|
||||
# Starship because command line glory
|
||||
curl -sS https://starship.rs/install.sh | sh
|
||||
|
||||
# ============================================================
|
||||
# SYMBOLIC LINKING
|
||||
# ============================================================
|
||||
|
||||
for folder in "${folders_to_link[@]}"; do
|
||||
config_path="$HOME/dotfiles/$folder"
|
||||
target_path="$HOME/.config/$folder"
|
||||
ln -s "$config_path" "$target_path"
|
||||
done
|
||||
|
||||
# Sym link other bits.
|
||||
ln -s $HOME/dotfiles/git/gitconfig $HOME/.gitconfig
|
||||
ln -s $HOME/dotfiles/.justfile $HOME/.justfile
|
||||
|
||||
# slightly tested zshrc sym link
|
||||
sudo rm -f /etc/zshrc
|
||||
sudo ln -s /etc/zshrc $HOME/dotfiles/zsh/.zshrc
|
||||
|
||||
# ============================================================
|
||||
# NVIM SETUP
|
||||
# ============================================================
|
||||
# Untested nvim kickstart clone
|
||||
git clone https://github.com/Jake-Pullen/kickstart.nvim.git $HOME/.config/nvim
|
||||
|
||||
# ============================================================
|
||||
# SHELL SETUP
|
||||
# ============================================================
|
||||
chsh -s /bin/zsh
|
||||
|
||||
# ============================================================
|
||||
# CLEANUP
|
||||
# ============================================================
|
||||
echo "==> Cleaning up package cache..."
|
||||
sudo apt clean
|
||||
|
||||
echo "===================================================="
|
||||
echo "All done! Give the system a reboot!"
|
||||
+6
-9
@@ -11,13 +11,6 @@ bindkey "^[[H" beginning-of-line
|
||||
bindkey "^[[F" end-of-line
|
||||
bindkey "^[[3~" delete-char
|
||||
|
||||
# Enable colors and change prompt:
|
||||
autoload -U colors && colors
|
||||
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
|
||||
# time at right hand side
|
||||
RPROMPT='%F{15}(%F{166}%D{%H:%M}%F{15})%f'
|
||||
|
||||
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
export EDITOR=nvim
|
||||
export GIT_EDITOR=nvim
|
||||
@@ -31,10 +24,14 @@ setopt histignorealldups
|
||||
alias ..='cd ..'
|
||||
alias la='ls -la'
|
||||
|
||||
alias wake_up='cd source/ai_web && ./run.sh & ~/AppImages/LM-Studio.AppImage &'
|
||||
alias updatepls='~/dotfiles/updater.sh'
|
||||
alias wake_up='cd source/ai_web && ./run.sh >/dev/null 2>&1 & ~/AppImages/LM-Studio.AppImage >/dev/null 2>&1 &'
|
||||
alias kill_ai='pkill -f "open-webui" && pkill -f "LM-Studio"'
|
||||
|
||||
alias mklink='ln -s "$(pwd)" ~/$(basename "$(pwd)")'
|
||||
|
||||
alias merlin='(cd ~/source/merlin && uv run merlin) && cd ~'
|
||||
alias vlc_web='vlc --http-host=0.0.0.0 --http-port=6080 --http-password=banana'
|
||||
alias update_mp3='rsync -av /home/devin/music/ /run/media/devin/3761-3261'
|
||||
|
||||
eval "$(starship init zsh)"
|
||||
fastfetch
|
||||
|
||||
Reference in New Issue
Block a user