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 / atlassian-confluence-docker-compose.yml
Last active March 27, 2023 15:46
A docker-compose file for the official Atlassian Confluence Server, using a postgres database and a separate reverse proxy, connected via docker network 'www-network'.
version: '3'
services:
confluence:
image: atlassian/confluence-server:6.11
restart: always
expose:
- 8090
volumes:
- ./confluence/:/var/atlassian/application-data/confluence
@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

Download RouterOS packages for CAPs on CAPsMAN

  1. Create the script download-caps-routeros. Add or remove packages, depeding on caps' hardware.

  2. Add a scheduler

/system scheduler
add name=download-caps-routeros on-event=":delay 120s\
 \n/system script run download-caps-routeros" start-time=startup
@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 / 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;
}
}
@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 / 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 / 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*
#!/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