Skip to content

Instantly share code, notes, and snippets.

@cdpb
cdpb / gist:fd2dbecdb4a08d79da6c08d8a65dd97c
Last active December 17, 2023 21:37
Vivaldi (Chrome) and KeePassXC Flatpak Integration for Browser

Inspired by this

# modify keepassxc browser path
In the KeePassXC UI.
- Tools
  - Settings
    - Browser Integration
      - General
        - Enable Browser Integration
@cdpb
cdpb / Dockerfile
Created December 3, 2017 17:04
Generate useless random docker names and make it available via http
FROM alpine
COPY names-generator /
EXPOSE 8080
CMD ["/names-generator"]
@cdpb
cdpb / log_dynamic_dns.sh
Created December 2, 2017 09:58
Log dynamic dns records
#!/bin/bash
# first A record, second authoritive DNS
RECORDS=(example.com ns.example.com mustermann.de ns.google.de)
LOGPATH="/var/log/iplog"
COUNTER=1
for RECORD in ${RECORDS[@]}; do
if [[ ! $(($COUNTER % 2)) -eq 0 ]]; then
DOMAIN=$RECORD
@cdpb
cdpb / mkimage.sh
Created November 5, 2016 09:34
Build Debian / Raspbian ARM - Raspberry
#!/bin/bash
# Usage: ./mkimage.sh jessie
MIRROR="http://archive.raspbian.org/raspbian"
RELEASE="$1"
TAG="debian:$RELEASE"
DIR=$(mktemp -d)
debootstrap --variant=minbase $RELEASE $DIR $MIRROR
tar --numeric-owner -C $DIR -c . | docker import - $TAG
# Generate SSL
openssl req -newkey rsa:2048 -nodes -keyout domain.key -x509 -days 365 -out domain.crt
# Generate DH
openssl dhparam -out dhparam.pem 4096
ssl_certificate /etc/nginx/ssl/domain.crt;
ssl_certificate_key /etc/nginx/ssl/domain.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
@cdpb
cdpb / nginx.conf
Last active March 28, 2016 08:37
OBSOLET Radicale Alpine dev
# Radicale Dockerfile
#
# VERSION 0.3
FROM alpine:latest
# Base packages
RUN apk update && apk upgrade
RUN apk add ca-certificates python nginx py-setuptools apache2-utils
@cdpb
cdpb / gist:9f57735839b369197ed6
Created February 17, 2016 08:44
Radicale Alpine
# Radicale Dockerfile
#
# VERSION 0.3
FROM alpine:latest
# Base packages
RUN apk update && apk upgrade
RUN apk add ca-certificates git python python-dev py-setuptools py-pip build-base libffi-dev
@cdpb
cdpb / gist:7aabf3f0d600e794ee19
Created February 16, 2016 08:58
Block scan servers persistent OpenBSD pf
#!/bin/ksh
LOG="/tmp/access_pot.log"
BLACKLIST="/root/config/pf/persistent-block.list"
set -A RFCS 10 172 192
while true; do
if [[ -a $LOG ]]; then
tail -f $LOG | while read LINE; do
@cdpb
cdpb / gist:f899f8adbcd643eb9bb2
Created February 16, 2016 08:41
simple iptables to secure docker from host
#!/bin/bash
# for coreos with flannel ...
# Example use ./iptables.sh --source 172.16.23.0/24 --destination 172.16.23.1 --local 10.2.0.2 --dry-run true
while [[ $# > 1 ]]
do
ARGS="$1"
case $ARGS in
-s|--source)
@cdpb
cdpb / gist:a637932a4af906b0dbf7
Last active February 20, 2016 14:26
Automatic Docker Clean
#!/bin/bash
echo "clean containers ..."
docker ps --filter status=exited -aq | xargs --no-run-if-empty docker rm -vf
echo "clean images ..."
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f
docker images | grep old | awk '{ print $1 " " $2 }' | while read LINE
do
IMAGE=$(echo $LINE | cut -d' ' -f1)