Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Script by cPFence Team, https://cpfence.app
#
# Description:
# This script performs routine server maintenance tasks:
# - Truncates user error logs larger than 5MB and server logs larger than 100MB, keeping only the last entries using `sponge` (ensure `sponge` is installed on the server).
# - Retains only the last 10 days of system journal logs.
# - Updates and upgrades packages non-interactively and checks if a reboot is required.
# - Clears APT cache to save space.
@kapatheus
kapatheus / README.md
Created October 2, 2022 19:01 — forked from dhensby/README.md
Unattended provisioning of CS:GO LinuxGSM cloud server using Cloud Init / User Data

CS:GO LinuxGSM Server with Cloud Init

This cloud-init config will provision a CS:GO server using LinuxGSM without the need for any manual intervention.

Usage

When provisioning a cloud server with providers such as Digital Ocean, you can provide "user data" to help provision cloud servers.

This configuration allows you to make use of the "user data" to automatically provision the CS:GO server.

@kapatheus
kapatheus / upgrade.sh
Created April 29, 2022 07:20 — forked from bocharsky-bw/upgrade.sh
Shell Script for Upgrade Ubuntu via APT in one step
#!/bin/bash
TEXT_RESET='\e[0m'
TEXT_YELLOW='\e[0;33m'
TEXT_RED_B='\e[1;31m'
sudo apt-get update
echo -e $TEXT_YELLOW
echo 'APT update finished...'
echo -e $TEXT_RESET
@kapatheus
kapatheus / _README.md
Created March 30, 2021 05:52
Bash General-Purpose Yes/No Prompt Function ("ask")

This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default answer. It keeps repeating the question until it gets a valid answer.