Skip to content

Instantly share code, notes, and snippets.

View storm-legacy's full-sized avatar

storm-legacy storm-legacy

View GitHub Profile
@storm-legacy
storm-legacy / .my.cnf
Last active February 6, 2023 11:55
MySQL backup and restore with Makefile
[mysqldump]
user = [database_backup_user]
password = [database_backup_password]
[mysql]
user = [database_user]
password = [database_password]
@storm-legacy
storm-legacy / dump_remote_databases.sh
Last active January 11, 2023 18:14
Dump backups stream over SSH.
#!/bin/bash
# Executed on remote server
# List all databases
mysql -u root -p -e "SHOW DATABASES" > database_list.txt
# Execute on local machine
for x in "$(cat database_list.txt)"; do
sshpass -p[ssh_password] ssh [user]@[target_server] "mysqldump -u root --single-transaction -p[mysql_root_password] ${x}" > ${x}.sql
done
@storm-legacy
storm-legacy / daemon.json
Created December 15, 2022 08:25
Docker production configuration
{
"storage-driver": "overlay2",
"log-driver": "local",
"log-opts": {
"max-size": "250m",
"max-file": "5"
}
}
@storm-legacy
storm-legacy / dst.docker-compose.yml
Created December 1, 2022 21:45
Don't Starve Together Dedicated Server - docker-compose.yml for fast deploy.
version: "3"
services:
dst-overworld:
image: steamcmd/steamcmd:ubuntu-20
hostname: dst-overworld-container
tty: true
restart: on-failure
entrypoint: [ "/bin/bash", "-c" ]
command: |
#!/bin/bash
# Get certificate
certbot certonly --standalone --preferred-challenges http
@storm-legacy
storm-legacy / Makefile
Last active February 9, 2023 10:49
GFS Rotating scripts
# This one differs from gfs-rotate.sh, because it splits backups into directories and it's just a basic rotation based on date
BAK_DIR_RECENT = /backups/recent
BAK_DIR_DAY = /backups/daily
BAK_DIR_WEEK = /backups/weekly
BAK_DIR_MONTH = /backups/monthly
DATE_WEEK = $(shell date +%W)
DATE_DAY = $(shell date +%d)
DATE_MONTH = $(shell date +%m)
DATE_DAY_OF_WEEK = $(shell date +%u)
@storm-legacy
storm-legacy / pg.docker-compose.yml
Last active December 15, 2022 18:21
Docker projects for easier deployment for applications.
version: "3"
networks:
db_net:
ipam:
config:
- subnet: 10.10.0.0/16
gateway: 10.10.0.1
volumes:
#!/usr/bin/env sh
docker run --rm --name phpmyadmin -d \
-e PMA_ARBITRARY="1" \
-e UPLOAD_LIMIT="512M" \
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
--network=<my_network> \
-p 8080:80 \
phpmyadmin:5
@storm-legacy
storm-legacy / script.sh
Created September 6, 2021 14:00
Httpasswd generating script
#!/usr/bin/env bash
cd /home/user/Desktop
RO_FILE='auth.ro'
RW_FILE='auth.rw'
SCRIPTNAME='script'
HTPASSWD='/usr/bin/docker run httpd htpasswd -BbnC 12'
@storm-legacy
storm-legacy / $Dotfiles.md
Last active November 1, 2021 16:06
Dotfiles

Dotfiles:

  • .bashrc
  • .zsh
  • .tmux.conf
  • aliases.sh
  • alacritty.yml
  • smb.conf
  • iptables script