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 / 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 / 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 / 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={
#!/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 / 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
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;'
#!/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

cd /docker/zabbix
source /etc/restic/repos/example.repo
source .env

CONTAINER=zabbix_mariadb_1
@sebastian13
sebastian13 / debian-install-btrbk.sh
Last active March 19, 2019 14:14
Install btrbk on Debian
#!/bin/bash
apt update
apt install make
curl https://digint.ch/download/btrbk/releases/btrbk-0.27.1.tar.xz -o /tmp/btrbk.tar.xz
tar xf /tmp/btrbk.tar.xz -C /tmp
make install -C /tmp/btrbk-0.27.1/
rm -r /tmp/btrbk*