Skip to content

Instantly share code, notes, and snippets.

View snappytux's full-sized avatar
🐔
Friends Not Food

iChamp snappytux

🐔
Friends Not Food
View GitHub Profile
@snappytux
snappytux / setup_ghost.sh
Last active May 23, 2025 03:23
Ubuntu Server Setup Script for Ghost CMS - Automates user creation, system packages, MySQL, Node.js and Ghost CLI installation
#!/bin/bash
# Ghost CMS Installation Script for Ubuntu
# This script will set up a new user, install necessary packages,
# configure MySQL, and prepare the environment for Ghost CMS
# Exit on error
set -e
# Function to display usage information
@snappytux
snappytux / delete_ds_store.sh
Created May 15, 2025 04:06
find and delete all .DS_Store files in a directory and its subdirectories
#!/bin/bash
# Script to delete all .DS_Store files in the current directory and subdirectories
echo "Starting to search for and delete .DS_Store files..."
# Find and count all .DS_Store files
found_files=$(find . -type f -name ".DS_Store")
count=$(echo "$found_files" | grep -c "^")
@snappytux
snappytux / text
Created December 27, 2017 04:54
Produce high CPU load on a Linux server?
for i in 1 2 3 4; do while : ; do : ; done & done
@snappytux
snappytux / rmFiles.sh
Last active May 23, 2025 03:27
rm all files except some
#!/bin/bash
# File removal script - removes all files except specified exceptions
# Add safety checks and better error handling
set -e # Exit on any error
# Define files to keep (you can modify this list)
KEEP_FILES=(
"*ignore"
@snappytux
snappytux / setup.sh
Last active May 15, 2025 07:36
First install docker in ubuntu 24.04
#!/bin/bash
# Check if running with root privileges
if [ "$(id -u)" -ne 0 ]; then
echo "Please run this script with root privileges (sudo)"
exit 1
fi
# Stop script immediately if a command fails
set -e
@snappytux
snappytux / rmOlder7days.sh
Created August 24, 2017 04:17
Remove file older 7 days
#!/bin/sh
find /root/* -mtime +7 -exec rm {} \;