Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
mkdir -p /run/apache2
rm -f /run/apache2/httpd.pid
echo "Waiting for database"
DB_READY=0
for i in {1..60}; do
/**
* D0 - output ok
* D5 - output ok
* D6 - output ok
* D7 - output ok
*
* D3 - output ok
* D4 - output ok, internal LED is inverse
*
* D3 - pullup input ok, bootet nicht wenn LOW
@micw
micw / rules.v4
Last active November 8, 2018 13:47
Minimal iptables for rancher 2 agent/kubernetes
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
# Masquerading all outgoing routet traffic
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
@micw
micw / build_with_docker.sh
Created September 22, 2018 07:02
Build aports with docker
#!/bin/sh
if [ "$#" -ne 2 ]; then
echo "USAGE: $0 ARCH REPO/PACKAGE"
echo "EXAMPLE $0 armhf main/busybox"
exit 1
fi
BASE=$( cd $( dirname $0 ); pwd)
/exports 127.0.0.1(fsid=0,async,ro)
/exports/vol1 *(async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)
/exports/vol2 *(async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)
@micw
micw / create docker network
Last active July 3, 2019 05:26
Setup macvlan device to use with docker
docker network create --driver=macvlan --subnet=192.168.1.0/24 --gateway 192.168.1.210 -o parent=eno1 -o macvlan_mode=bridge macvlan0
@micw
micw / README.md
Created May 24, 2018 11:21
Use letsencrypt cert generated by froxlor in postfix and dovecot
  • requires ansible to be installed
  • run periodically with:
ansible-playbook -i hosts.ini playbook.yml
@micw
micw / nginx_auth1.conf
Last active April 27, 2018 09:49
Nginx auth with login-form passthrough
# This variant uses the same endpoint for the check and the login form
server {
listen 80;
server_name localhost;
location = /internal-nginx-auth-endpoint {
internal;
proxy_pass http://172.17.0.1:8080/;
}
@micw
micw / update_config.py
Last active January 23, 2024 16:59
Python script to replace ${PLACEHOLDER} in config files with content from environment variables
#!/usr/bin/env python
#
# Replaces ${placeholder} in a config file by it's corresponding environment variable.
# Fails if a variable is missing.
#
# The latest version of this script can be found at https://gist.github.com/micw/d7c0e34aee751e81c5aa952b29b8631b
#
import argparse,re
from os import environ
#!/bin/bash
set -e
pkgs=(libclamav7 libclamav-dev clamav-base clamav-daemon clamav-dbg clamav-docs clamav-freshclam clamav-milter clamav-testfiles clamav)
installed_pkgs=( $( dpkg-query -f '${binary:Package}\n' -W | grep clamav ) )
update_pkgs=()
for p1 in "${pkgs[@]}"; do
for p2 in "${installed_pkgs[@]}"; do