Skip to content

Instantly share code, notes, and snippets.

View sebastian13's full-sized avatar

Sebastian Plocek sebastian13

  • Vienna, Austria
View GitHub Profile
@sebastian13
sebastian13 / enum-enc-shares.sh
Last active April 7, 2024 16:41
List any encrypted but not mounted volume on a Synology NAS
#!/bin/bash
#
# List any encrypted but not mounted volume on a Synology NAS
#
# Author: Sebastian Plocek
# https://gist.github.com/sebastian13/81f4b6124e8d7d0551c1b3e2ffb2c609
#
dsm="https://<your-nas-domain>:<your-dsm-port>"
@sebastian13
sebastian13 / fix-wordpress-permissions.sh
Last active April 7, 2024 16:40
Set WordPress' file permissions when using docker compose
#!/bin/bash
# https://gist.github.com/sebastian13/c57fb8f62863112825b7b1b912b9a2d8
#
# This script sets WordPress' file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
# and https://stackoverflow.com/a/23755604/8940679
#
# Idea from https://github.com/mconigliaro/notes/blob/master/wordpress/permissions.md
#
# To use this script run:
@sebastian13
sebastian13 / minio-backwpup.json
Created February 4, 2019 12:14
This is a working IAM Policy for the wordpress plugin BackWPup to use with minio s3 storage.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": [
@sebastian13
sebastian13 / synology-commands.sh
Created August 30, 2019 18:14
Collection of useful terminal commands for Synology DS.
# Renew Let's Encrypt Certificates
/usr/syno/sbin/syno-letsencrypt renew-all
# Disable Firewall
/usr/syno/bin/synofirewall --disable
@sebastian13
sebastian13 / AdminPrinterDeploy.ps1
Last active February 16, 2024 14:44
How to install printers post PrintNightmare patch
# Deploy this via PDQ Deploy or run once as admin
# Delete all Network Printers
Get-WmiObject -Class Win32_Printer | where{$_.Network -eq 'true'} | ForEach-Object {$_.Delete()}
# Add Driver to the Store
# ... example for Sharp 1910a - 9.1.18.47
pnputil.exe /a "\\nas01\tools\drivers\_Printers\MX_D54_PCL6_PS_1910a_German_64bit\German\PCL6\64bit\su0emdeu.inf"
# Install the Driver
@sebastian13
sebastian13 / $mikrotik-backup-and-upgrade.md
Last active January 2, 2024 17:02
Backup & Auto Upgrade Mikrotik RouterOS

Backup & Auto Upgrade Mikrotik Routers

  1. Set SMTP
/tool e-mail
set address=smtp.gmail.com from=___@gmail.com port=587 tls=starttls \
    user=___@gmail.com password=___
#!/bin/bash
# Change to the script's directory & create directory
cd $(dirname "$(readlink -f "$0")")
mkdir -p ./dbdumps
# Start mysql service
docker --log-level=error compose up -d mysql
# Wait
#!/bin/bash
# Change to the script's directory & create directory
cd $(dirname "$(readlink -f "$0")")
mkdir -p ./dbdumps
# Load database name + root password
source .env
# Check if variables were provided
#!/bin/bash
set -e
# Change to the script's directory & create directory
cd $(dirname "$(readlink -f "$0")")
mkdir -p ./pgdumps
# Start postgres service
docker --log-level=error compose up -d postgres
#!/bin/bash
# Start mysql service of your compose file
docker compose up -d mysql
# Load DB_PASS
source .env
docker compose exec mysql /usr/bin/mysql -u root --password=${MYSQL_ROOT_PASSWORD} -e 'show databases;'