Skip to content

Instantly share code, notes, and snippets.

@Mario-F
Mario-F / redis-migrate.sh
Last active June 20, 2022 07:19
Redis migration script
#!/bin/bash
set +x
SOURCE_HOST=$1
SOURCE_PORT=$2
SOURCE_PW=$3
SOURCE_DB=$4
SOURCE_ARGS=$5
TARGET_HOST=$6
TARGET_PORT=$7
@Mario-F
Mario-F / alias_cloud
Last active April 1, 2022 15:30
a shell alias file for cloudwork
# Get ALL resources from namespace
function kc-all {
if [ -z ${1+x} ]; then echo "please define a namespace"; return; fi
CMD="kubectl api-resources --verbs=list --namespaced -o name | grep -v events | xargs -n 1 kubectl get --show-kind --ignore-not-found -n $1"
if [ "$2" = "w" ]; then
echo "Starting watch, please wait each refresh can take some time..."
watch "$CMD"
else
eval $CMD
fi
@Mario-F
Mario-F / timelapse.sh
Last active April 14, 2020 14:12
Capture Timelapse on RPI with FTP Upload
#!/bin/bash
#
# Used to capture images on RaspberryPI and store on FTP Server
# German Blogpost: https://blog.fritschen.net/computer/raspberry/timelapse-langzeit-mit-raspberry-pi-zero/
#
# CONFIG - START
#
# FTP servers userdata
FTPSERVER=""
@Mario-F
Mario-F / ucs_create_catchall.py
Last active February 8, 2021 14:23
Creating dynamic catchall rule for Univention Corporate Servers
#!/usr/bin/env python
#
# This script creates catchall configuration with postfix and "Univention Coporate Server"
#
# Quick example:
# 1. Download and Run ucs_create_catchall (on UCS Server as root !):
# wget -O - https://gist.githubusercontent.com/Mario-F/15e43f39a6363bc2c890e1c2775fbc1f/raw/ff9d92823d8aa599d039fc3596bc0b18984bd1ef/ucs_create_catchall.py | python
# 2. Read the instructions output on successfull run.
#
import sys, optparse, re, subprocess, os