This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Gaming Setup Script for Arch Linux with Nvidia GPU | |
# Author: ph33nx | |
# Description: Installs all necessary packages and configurations for gaming on Arch Linux | |
# Update system and keyring | |
echo "Updating system and keyring..." | |
sudo pacman -Syu --needed --noconfirm archlinux-keyring |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Author: ph33nx | |
URL: https://github.com/ph33nx | |
Description: | |
This script automatically scans a directory (recursively) for video files and downloads the best matching subtitles using the `subliminal` library. | |
It avoids duplicate work by checking for existing `.srt` subtitle files and is suitable for organizing media libraries in homelab setups. | |
Key Features: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Author: ph33nx | |
URL: https://gist.github.com/ph33nx/861d9ff35721d56205c834c7f8308e0b | |
Description: | |
This script converts images from various formats (e.g., PNG, JPG, WebP) to either JPG or WebP for web optimization. | |
It preserves EXIF metadata, allows for optional parameter customization, and handles errors gracefully. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dnf update -y && sudo dnf autoremove -y | |
reboot | |
# Enable RPMFusion repos: https://docs.fedoraproject.org/en-US/quick-docs/rpmfusion-setup/ | |
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 | |
sudo dnf config-manager --enable fedora-cisco-openh264 | |
sudo dnf update @core | |
# If secure boot | |
sudo dnf install kmodtool akmods mokutil openssl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run cron jobs for all wordpress sites in a folder using WP CLI. | |
# Author: https://github.com/ph33nx | |
# !IMP: Change BASE_DIR below to the folder that has the wordpress sites. Ex: /var/www or /usr/share/nginx etc.. | |
BASE_DIR="/path_to_folder_that_has_wordpress_sites/" | |
# Check for wp-cli.phar existence in the system | |
if ! command -v wp &> /dev/null; then | |
echo "WP-CLI could not be found. Please install it first." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# backup_mysql_db.sh | |
# This script backs up each MySQL/MariaDB database into its own file daily. | |
# The backups are stored in /var/backups/mysql/<database_name>/<database_name>_<date_time>.sql | |
# Backups older than 30 days are automatically deleted. | |
# | |
# Author: Ph33nx | |
# GitHub: https://github.com/ph33nx | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is designed to update WordPress core, plugins, and themes, | |
# set correct file permissions, and restart Nginx and PHP-FPM services. | |
# Update www-data user to the filesystem user of WP. | |
# !IMP: Make sure WP CLI is installed: https://wp-cli.org/ | |
# | |
# Original script concept by https://github.com/ph33nx | |
# | |
# To schedule this script to run every Thursday at 4 AM, add the following line to your crontab: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On Fresh windows installation, open powershell or terminal and run the script as following: | |
# powershell.exe -executionpolicy bypass -file .\fresh-windows-dev-enviroment.ps1 | |
winget install Git.Git | |
winget install GitHub.GitLFS | |
git config --global core.autocrlf false | |
winget install Microsoft.VisualStudioCode | |
winget install OpenJS.NodeJS.LTS # NodeJS LTS | |
winget install Python.Python.3.12 # Python 3.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the current directory | |
$folder = Get-Location | |
# Delete hidden files recursively based on pattern | |
Get-ChildItem -Path $folder -Recurse -Force -File | Where-Object { $_.Name -like "._*" } | ForEach-Object { | |
# Remove any file attributes | |
Set-ItemProperty -Path $_.FullName -Name Attributes -Value 0 | |
# Attempt to delete the file | |
Remove-Item -Path $_.FullName -Force | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install Homebrew | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
brew analytics off |