This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## add me to /etc/bash_completion.d/ | |
## cp FILE /etc/bash_completion.d/ | |
## reload completion | |
## exec bash | |
_available_commands() | |
{ | |
bin/console list --raw | awk '{print $1}' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hello.py | |
import sys | |
from django.conf.urls import url | |
from django.core.wsgi import get_wsgi_application | |
from django.http import HttpResponse | |
from django.conf import settings | |
# Django Konfiguration | |
settings.configure( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gen key | |
if ! [ -a ./${DOMAIN}.key ]; then | |
PASSPHRASE=$(apg -m 255) | |
echo ${PASSPHRASE} | openssl genrsa -des3 -out ${DOMAIN}.key -passout stdin 4096 | |
echo ${PASSPHRASE} | openssl rsa -in ${DOMAIN}.key -out ${DOMAIN}.key -passin stdin | |
fi | |
openssl req -new -key ${DOMAIN}.key -sha256 -nodes \ | |
-subj "/C=${COUNTRY}/ST=${STATE}/L=${CITY}/O=${ORGANIZATION}/OU=${OU}/CN=${DOMAIN_NAME}/emailAddress=${ADMIN_MAIL}/subjectAltName=DNS.1=m.${DOMAIN}" > ${DOMAIN}.csr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef ct | |
_ct() { | |
local -a commands | |
IFS=$'\n' | |
commands=(${(f)"$(ct list --raw | sed 's/:/\\:/g' | awk -F" " '{print $1}')"}) | |
if (( CURRENT == 2 )); then | |
_describe -t commands 'commands' commands | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## add me to /etc/bash_completion.d/ | |
## cp FILE /etc/bash_completion.d/ | |
## reload completion | |
## exec bash | |
_available_commands() | |
{ | |
ct list --raw | awk '{print $1}' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from datetime import datetime, timedelta | |
from dateutil import parser | |
import re | |
from sys import exit | |
import caldav | |
# time offset | |
time_offset = 2 | |
# user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for DATABASE in $(mysql -NBqe 'show databases' | grep -Ev "(information_schema|performance_schema)"); do | |
mysqldump --events ${DATABASE} | gzip > /srv/backup/$(date +%Y%m%d_%H%M)_${DATABASE}.gz; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -z ${1} ] || [ -z ${2} ]; then | |
echo "USAGE: ${0} <IP-TO-MONITOR> <PIVOT-DAYS>" | |
exit 1 | |
fi | |
PIVOTDAYS=35 # how often should the failover be checked?(in days) | |
IP_TO_MONITOR=${1} | |
FAILOVER_IP=$(ip addr sh | grep -v "127.0.0.1" | grep "inet " | cut -d/ -f1 | awk '{print $2}' | grep -Fx ${IP_TO_MONITOR}) |