save
This commit is contained in:
277
in_progress/scripts/fedora_things_to_do.sh
Executable file
277
in_progress/scripts/fedora_things_to_do.sh
Executable file
@@ -0,0 +1,277 @@
|
||||
#!/bin/bash
|
||||
# "Things To Do!" script for a fresh Fedora Workstation installation
|
||||
|
||||
|
||||
|
||||
# Check if the script is run with sudo
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run this script with sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Funtion to echo colored text
|
||||
color_echo() {
|
||||
local color="$1"
|
||||
local text="$2"
|
||||
case "$color" in
|
||||
"red") echo -e "\033[0;31m$text\033[0m" ;;
|
||||
"green") echo -e "\033[0;32m$text\033[0m" ;;
|
||||
"yellow") echo -e "\033[1;33m$text\033[0m" ;;
|
||||
"blue") echo -e "\033[0;34m$text\033[0m" ;;
|
||||
*) echo "$text" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Set variables
|
||||
ACTUAL_USER=$SUDO_USER
|
||||
ACTUAL_HOME=$(eval echo ~$SUDO_USER)
|
||||
LOG_FILE="/var/log/fedora_things_to_do.log"
|
||||
INITIAL_DIR=$(pwd)
|
||||
|
||||
# Function to generate timestamps
|
||||
get_timestamp() {
|
||||
date +"%Y-%m-%d %H:%M:%S"
|
||||
}
|
||||
|
||||
# Function to log messages
|
||||
log_message() {
|
||||
local message="$1"
|
||||
echo "$(get_timestamp) - $message" | tee -a "$LOG_FILE"
|
||||
}
|
||||
|
||||
# Function to handle errors
|
||||
handle_error() {
|
||||
local exit_code=$?
|
||||
local message="$1"
|
||||
if [ $exit_code -ne 0 ]; then
|
||||
color_echo "red" "ERROR: $message"
|
||||
exit $exit_code
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to prompt for reboot
|
||||
prompt_reboot() {
|
||||
sudo -u $ACTUAL_USER bash -c 'read -p "It is time to reboot the machine. Would you like to do it now? (y/n): " choice; [[ $choice == [yY] ]]'
|
||||
if [ $? -eq 0 ]; then
|
||||
color_echo "green" "Rebooting..."
|
||||
reboot
|
||||
else
|
||||
color_echo "red" "Reboot canceled."
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to backup configuration files
|
||||
backup_file() {
|
||||
local file="$1"
|
||||
if [ -f "$file" ]; then
|
||||
cp "$file" "$file.bak"
|
||||
handle_error "Failed to backup $file"
|
||||
color_echo "green" "Backed up $file"
|
||||
fi
|
||||
}
|
||||
|
||||
echo "";
|
||||
echo "╔═════════════════════════════════════════════════════════════════════════════╗";
|
||||
echo "║ ║";
|
||||
echo "║ ░█▀▀░█▀▀░█▀▄░█▀█░█▀▄░█▀█░░░█░█░█▀█░█▀▄░█░█░█▀▀░▀█▀░█▀█░▀█▀░▀█▀░█▀█░█▀█░ ║";
|
||||
echo "║ ░█▀▀░█▀▀░█░█░█░█░█▀▄░█▀█░░░█▄█░█░█░█▀▄░█▀▄░▀▀█░░█░░█▀█░░█░░░█░░█░█░█░█░ ║";
|
||||
echo "║ ░▀░░░▀▀▀░▀▀░░▀▀▀░▀░▀░▀░▀░░░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░░▀░░▀░▀░░▀░░▀▀▀░▀▀▀░▀░▀░ ║";
|
||||
echo "║ ░░░░░░░░░░░░▀█▀░█░█░▀█▀░█▀█░█▀▀░█▀▀░░░▀█▀░█▀█░░░█▀▄░█▀█░█░░░░░░░░░░░░░░ ║";
|
||||
echo "║ ░░░░░░░░░░░░░█░░█▀█░░█░░█░█░█░█░▀▀█░░░░█░░█░█░░░█░█░█░█░▀░░░░░░░░░░░░░░ ║";
|
||||
echo "║ ░░░░░░░░░░░░░▀░░▀░▀░▀▀▀░▀░▀░▀▀▀░▀▀▀░░░░▀░░▀▀▀░░░▀▀░░▀▀▀░▀░░░░░░░░░░░░░░ ║";
|
||||
echo "║ ║";
|
||||
echo "╚═════════════════════════════════════════════════════════════════════════════╝";
|
||||
echo "";
|
||||
echo "This script automates \"Things To Do!\" steps after a fresh Fedora Workstation installation"
|
||||
echo "ver. 25.08 / 100 Stars Edition"
|
||||
echo ""
|
||||
echo "Don't run this script if you didn't build it yourself or don't know what it does."
|
||||
echo ""
|
||||
read -p "Press Enter to continue or CTRL+C to cancel..."
|
||||
|
||||
# System Upgrade
|
||||
color_echo "blue" "Performing system upgrade... This may take a while..."
|
||||
dnf upgrade -y
|
||||
|
||||
|
||||
# System Configuration
|
||||
# Set the system hostname to uniquely identify the machine on the network
|
||||
color_echo "yellow" "Setting hostname..."
|
||||
hostnamectl set-hostname hades
|
||||
|
||||
# Optimize DNF package manager for faster downloads and efficient updates
|
||||
color_echo "yellow" "Configuring DNF Package Manager..."
|
||||
backup_file "/etc/dnf/dnf.conf"
|
||||
echo "max_parallel_downloads=10" | tee -a /etc/dnf/dnf.conf > /dev/null
|
||||
dnf -y install dnf-plugins-core
|
||||
|
||||
# Enable and configure automatic system updates to enhance security and stability
|
||||
color_echo "yellow" "Enabling DNF autoupdate..."
|
||||
dnf install dnf-automatic -y
|
||||
sed -i 's/apply_updates = no/apply_updates = yes/' /etc/dnf/automatic.conf
|
||||
systemctl enable --now dnf-automatic.timer
|
||||
|
||||
# Replace Fedora Flatpak Repo with Flathub for better package management and apps stability
|
||||
color_echo "yellow" "Replacing Fedora Flatpak Repo with Flathub..."
|
||||
dnf install -y flatpak
|
||||
flatpak remote-delete fedora --force || true
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
sudo flatpak repair
|
||||
flatpak update
|
||||
|
||||
# Check and apply firmware updates to improve hardware compatibility and performance
|
||||
color_echo "yellow" "Checking for firmware updates..."
|
||||
fwupdmgr refresh --force
|
||||
fwupdmgr get-updates
|
||||
fwupdmgr update -y
|
||||
|
||||
# Enable RPM Fusion repositories to access additional software packages and codecs
|
||||
color_echo "yellow" "Enabling RPM Fusion repositories..."
|
||||
dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
|
||||
dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
dnf update @core -y
|
||||
|
||||
# Install multimedia codecs to enhance multimedia capabilities
|
||||
color_echo "yellow" "Installing multimedia codecs..."
|
||||
dnf swap ffmpeg-free ffmpeg --allowerasing -y
|
||||
dnf update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin -y
|
||||
dnf update @sound-and-video -y
|
||||
|
||||
# Install Hardware Accelerated Codecs for Intel integrated GPUs. This improves video playback and encoding performance on systems with Intel graphics.
|
||||
color_echo "yellow" "Installing Intel Hardware Accelerated Codecs..."
|
||||
dnf -y install intel-media-driver
|
||||
|
||||
# Configure power settings to prevent system sleep and hibernation
|
||||
color_echo "yellow" "Configuring power settings..."
|
||||
sudo -u $ACTUAL_USER gsettings set org.gnome.desktop.session idle-delay 0
|
||||
sudo -u $ACTUAL_USER gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
|
||||
sudo -u $ACTUAL_USER gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing'
|
||||
sudo -u $ACTUAL_USER gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
|
||||
sudo -u $ACTUAL_USER gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
|
||||
sudo -u $ACTUAL_USER gsettings set org.gnome.settings-daemon.plugins.power power-button-action 'suspend'
|
||||
|
||||
|
||||
# App Installation
|
||||
# Install essential applications
|
||||
color_echo "yellow" "Installing essential applications..."
|
||||
dnf install -y fastfetch unzip unrar git wget curl gnome-tweaks
|
||||
color_echo "green" "Essential applications installed successfully."
|
||||
|
||||
# Install Internet & Communication applications
|
||||
color_echo "yellow" "Installing Vivaldi..."
|
||||
flatpak install -y flathub com.vivaldi.Vivaldi
|
||||
color_echo "green" "Vivaldi installed successfully."
|
||||
color_echo "yellow" "Installing LibreWolf..."
|
||||
flatpak install -y flathub io.gitlab.librewolf-community
|
||||
color_echo "green" "LibreWolf installed successfully."
|
||||
color_echo "yellow" "Installing Signal Desktop..."
|
||||
flatpak install -y flathub org.signal.Signal
|
||||
color_echo "green" "Signal Desktop installed successfully."
|
||||
|
||||
# Install Office Productivity applications
|
||||
color_echo "yellow" "Installing LibreOffice..."
|
||||
dnf remove -y libreoffice*
|
||||
flatpak install -y flathub org.libreoffice.LibreOffice
|
||||
flatpak install -y --reinstall org.freedesktop.Platform.Locale/x86_64/24.08
|
||||
flatpak install -y --reinstall org.libreoffice.LibreOffice.Locale
|
||||
color_echo "green" "LibreOffice installed successfully."
|
||||
color_echo "yellow" "Installing WPS Office..."
|
||||
flatpak install -y flathub com.wps.Office
|
||||
color_echo "green" "WPS Office installed successfully."
|
||||
color_echo "yellow" "Installing Obsidian..."
|
||||
flatpak install -y flathub md.obsidian.Obsidian
|
||||
color_echo "green" "Obsidian installed successfully."
|
||||
color_echo "yellow" "Installing Bitwarden..."
|
||||
flatpak install -y flathub com.bitwarden.desktop
|
||||
color_echo "green" "Bitwarden installed successfully."
|
||||
|
||||
# Install Coding and DevOps applications
|
||||
color_echo "yellow" "Installing GitHub Desktop..."
|
||||
flatpak install -y flathub io.github.shiftey.Desktop
|
||||
color_echo "green" "GitHub Desktop installed successfully."
|
||||
color_echo "yellow" "Installing Docker..."
|
||||
dnf remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine --noautoremove
|
||||
dnf -y install dnf-plugins-core
|
||||
if command -v dnf4 &>/dev/null; then
|
||||
dnf4 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
|
||||
else
|
||||
dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
|
||||
fi
|
||||
dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
systemctl enable --now docker
|
||||
systemctl enable --now containerd
|
||||
groupadd docker
|
||||
usermod -aG docker $ACTUAL_USER
|
||||
rm -rf $ACTUAL_HOME/.docker
|
||||
echo "Docker installed successfully. Please log out and back in for the group changes to take effect."
|
||||
color_echo "green" "Docker installed successfully."
|
||||
# Note: Docker group changes will take effect after logging out and back in
|
||||
|
||||
# Install Media & Graphics applications
|
||||
color_echo "yellow" "Installing Stremio..."
|
||||
flatpak install -y flathub com.stremio.Stremio
|
||||
color_echo "green" "Stremio installed successfully."
|
||||
color_echo "yellow" "Installing Spotify..."
|
||||
flatpak install -y flathub com.spotify.Client
|
||||
color_echo "green" "Spotify installed successfully."
|
||||
color_echo "yellow" "Installing MPV..."
|
||||
dnf install -y mpv
|
||||
color_echo "green" "MPV installed successfully."
|
||||
|
||||
# Install Gaming & Emulation applications
|
||||
color_echo "yellow" "Installing Steam..."
|
||||
dnf install -y steam
|
||||
color_echo "green" "Steam installed successfully."
|
||||
|
||||
# Install Remote Networking applications
|
||||
color_echo "yellow" "Installing Mullvad VPN..."
|
||||
if command -v dnf4 &>/dev/null; then
|
||||
dnf4 config-manager --add-repo https://repository.mullvad.net/rpm/stable/mullvad.repo
|
||||
else
|
||||
dnf config-manager addrepo --from-repofile=https://repository.mullvad.net/rpm/stable/mullvad.repo
|
||||
fi
|
||||
dnf install -y mullvad-vpn
|
||||
color_echo "green" "Mullvad VPN installed successfully."
|
||||
color_echo "yellow" "Installing Tailscale..."
|
||||
dnf config-manager addrepo --from-repofile=https://pkgs.tailscale.com/stable/fedora/tailscale.repo
|
||||
dnf install tailscale -y
|
||||
systemctl enable --now tailscaled
|
||||
color_echo "green" "Tailscale installed successfully."
|
||||
|
||||
# Install System Tools applications
|
||||
color_echo "yellow" "Installing Flatseal..."
|
||||
flatpak install -y flathub com.github.tchx84.Flatseal
|
||||
color_echo "green" "Flatseal installed successfully."
|
||||
color_echo "yellow" "Installing Extension Manager..."
|
||||
flatpak install -y flathub com.mattjakeman.ExtensionManager
|
||||
color_echo "green" "Extension Manager installed successfully."
|
||||
color_echo "yellow" "Installing Bottles..."
|
||||
flatpak install -y flathub com.usebottles.bottles
|
||||
color_echo "green" "Bottles installed successfully."
|
||||
|
||||
|
||||
# Customization
|
||||
|
||||
|
||||
# Custom user-defined commands
|
||||
# Custom user-defined commands
|
||||
echo "Created with ❤️ for Open Source"
|
||||
|
||||
|
||||
# Before finishing, ensure we're in a safe directory
|
||||
cd /tmp || cd $ACTUAL_HOME || cd /
|
||||
|
||||
# Finish
|
||||
echo "";
|
||||
echo "╔═════════════════════════════════════════════════════════════════════════╗";
|
||||
echo "║ ║";
|
||||
echo "║ ░█░█░█▀▀░█░░░█▀▀░█▀█░█▄█░█▀▀░░░▀█▀░█▀█░░░█▀▀░█▀▀░█▀▄░█▀█░█▀▄░█▀█░█░ ║";
|
||||
echo "║ ░█▄█░█▀▀░█░░░█░░░█░█░█░█░█▀▀░░░░█░░█░█░░░█▀▀░█▀▀░█░█░█░█░█▀▄░█▀█░▀░ ║";
|
||||
echo "║ ░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░░░░▀░░▀▀▀░░░▀░░░▀▀▀░▀▀░░▀▀▀░▀░▀░▀░▀░▀░ ║";
|
||||
echo "║ ║";
|
||||
echo "╚═════════════════════════════════════════════════════════════════════════╝";
|
||||
echo "";
|
||||
color_echo "green" "All steps completed. Enjoy!"
|
||||
|
||||
# Prompt for reboot
|
||||
prompt_reboot
|
||||
20
in_progress/scripts/mullvad_tailscale.sh
Executable file
20
in_progress/scripts/mullvad_tailscale.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# ---
|
||||
# @file_name: mullvad_tailscale.sh
|
||||
# @version: 1.0.0
|
||||
# @description: Installs mullvad nft rules
|
||||
# @author: Jamie Albert (empty_produce)
|
||||
# @author_contact: <mailto:empty.produce@flatmail.me>
|
||||
# @license: GNU Affero General Public License v3.0 (Included in LICENSE)
|
||||
# Copyright (C) 2025, Jamie Albert
|
||||
# ---
|
||||
|
||||
nft_mullvad() {
|
||||
sudo cp /home/jamie/dao/cradle/firewall/mullvad_tailscale.conf /etc/nftables/
|
||||
echo "include \"/etc/nftables/mullvad_tailscale.conf\"" | sudo tee -a /etc/nftables.conf
|
||||
}
|
||||
|
||||
main() {
|
||||
nft_mullvad
|
||||
}
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user