Skip to content

Instantly share code, notes, and snippets.

View hvanmegen's full-sized avatar

Henry van Megen hvanmegen

View GitHub Profile
@hvanmegen
hvanmegen / cleanup.py
Last active February 8, 2024 21:11
cleanup script for ceph
#!/usr/bin/python3
import os
import sys
import time
import argparse
import shutil
import math
try:
from tqdm import tqdm
@hvanmegen
hvanmegen / backupdb.sh
Created December 3, 2022 14:32
MySQL database backup script
#!/bin/bash
# MySQL database backup script
# settings:
SCRIPTNAME=$(basename $0)
USER="root"
OUTPUTDIR="/root/dbbackups/$(date +%Y-%m-%d)"
RETENTION_DAYS=7
COMPRESSION_ENABLED=1
COMPRESSION_COMMAND="/usr/bin/gzip"
apiVersion: apps/v1
kind: Deployment
metadata:
name: factorio
spec:
replicas: 1
selector:
matchLabels:
app: factorio
template:
@hvanmegen
hvanmegen / findmail.sh
Created February 12, 2020 14:40
findmail shell script
#!/bin/bash
scriptname=`basename ${0}`
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
# Check if an argument was set
if [ -z "$1" ]; then
#!/bin/bash
tabs 4
# Touch either one of these two files to disable this terminal addition
if [ ! -f ~/.config/no_niceterm ] && [ ! -f ~/.no_niceterm ]; then
if [ -x /sbin/ip ]; then
EXT_IP=$(ip route get 8.8.8.8 | awk -v ORS="" '{print $7}')
fi
if [ -x /bin/hostname ]; then
# to run: docker-compose run
#
# Create a .evn file in the same folder as this file and change the variables.
# MOUNT_POINT=/tmp/
# VPN_PROVIDER=changeme
# VPN_CONFIG=changeme
# VPN_USERNAME=changeme
# VPN_PASSWORD=changeme
#
#