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 / 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": [
#!/bin/bash
# Look for subdirectories starting with a letter
# and reset all containers
for d in [a-z]*
do
( cd "$d" && docker-compose down --remove-orphans && docker-compose up -d )
done
@sebastian13
sebastian13 / mikrotik-cap-button-slack.rsc
Last active December 17, 2021 11:03
Script to enable & disable wifi on a Mikrotik cAP Access Point managed by a CAPsMAN using the Mode Button
:log info message=("mode button was pressed");
:local i
:if ([/int wir cap get enabled] = true) do={
/interface wireless cap set enabled=no;
:global SlackMessage "Mode button was presssed. CAP is now disabled.";
:if ( [/int wir get 0 disabled ] = false ) do={
:foreach i in= [ /int wir find ] do={ :int wir disable $i };
}
} else={
@sebastian13
sebastian13 / zimbra-delete-all-accounts.sh
Last active August 1, 2019 13:23
Zimbra: Delete all Accounts
su zimbra
zmprov -l gaa | grep -v ^admin@.* > /tmp/all-accounts.txt
for i in `cat /tmp/all-accounts.txt`; do zmprov deleteAccount $i && echo $i $'\u2713'; done;
@sebastian13
sebastian13 / zimbra-disable-password-change.sh
Created August 2, 2019 11:02
Disable the password change option in Zimbra Webmail via the default COS. This is especially useful when using Active Directory authentication.
zmprov mc default zimbraFeatureChangePasswordEnabled FALSE
zmprov mc default zimbraPasswordLocked TRUE
zmprov mc defaultExternal zimbraFeatureChangePasswordEnabled FALSE
zmprov mc defaultExternal zimbraPasswordLocked TRUE
@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 / reset-zabbix-admin.sh
Created October 10, 2019 19:48
Reset a zabbix user password using mysql
# Access mysql console
mysql -u root -p
# Select Database
use zabbix;
# List existing users
select * from users;
# Update 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
@sebastian13
sebastian13 / mikrotik-wifi-button.rsc
Created May 14, 2021 20:43
Script to enable & disable wifi on a Mikrotik (standalone) Access Point using the Mode Button
:log info message=("mode button was pressed");
:local i
:if ( [/int wir get 0 disabled ] = true ) do={
:foreach i in= [ /int wir find ] do={ :int wir enable $i };
} else={
:foreach i in= [ /int wir find ] do={ :int wir disable $i };
}
@sebastian13
sebastian13 / nginx-redirect-to-first-servername.conf
Created October 4, 2021 08:09
Redirect any server_name to the first one defined
server {
listen 80;
listen [::]:80;
server_name example.com 1.example.com;
# Redirect all HTTP links to the matching HTTPS page
location / {
return 301 https://$host$request_uri;
}
}