Skip to content

Instantly share code, notes, and snippets.

@casperklein
casperklein / extensions.json
Last active September 28, 2024 20:03
test
[
{
"id": "aaron-bond.better-comments",
"name": "better-comments",
"publisher": "aaron-bond",
"version": "3.0.2"
},
{
"id": "DavidAnson.vscode-markdownlint",
"name": "vscode-markdownlint",
#!/bin/bash
[ $# -lt 2 ] && echo "Usage: $0 <env file> <binary> [args]" && exit 1
# Mark variables which are modified or created for export.
set -a
# source env file
source "$1"
@casperklein
casperklein / compose.yml
Last active November 28, 2023 02:49
MariaDB replication + phpmyadmin
# https://github.com/MariaDB/mariadb-docker/blob/master/examples/compose-replication.yml
version: "3"
services:
master:
image: mariadb:latest
command: --log-bin --log-basename=mariadb
environment:
- MARIADB_ROOT_PASSWORD=password
- MARIADB_USER=testuser
@echo off
REM Run bash scripts in WSL with up to 8 arguments on double click. First argument is the file name.
REM Registry: "Computer\HKEY_CLASSES_ROOT\sh_auto_file\shell\open\command" --> D:\Scripts\BashLauncherV2.bat "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"
REM Source: https://superuser.com/a/1702441/563747
REM https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/call
REM %~1 --> Expands %1 and removes surrounding quotation marks. --> This allows calling bash scripts with quoted arguments: ./travel.sh "New York"
#!/bin/bash
[ $# -lt 2 ] && echo "Usage: $0 <env file> <binary> [args]" && exit 1
# Mark variables which are modified or created for export.
set -a
# source env file
source "$1"
@casperklein
casperklein / docker-compose.yml
Last active December 31, 2023 16:02
powerdns-auth, powerdns-recursor and powerdns-admin playground
# # ? Initial Config
# mkdir -p ./data/powerdns-{auth,auth-secondary,recursor,admin}
# # get initial powerdns db
# docker create --name pdns powerdns/pdns-auth-master
# docker cp pdns:/var/lib/powerdns/pdns.sqlite3 ./data/powerdns-auth/pdns.sqlite3
# docker cp pdns:/var/lib/powerdns/pdns.sqlite3 ./data/powerdns-auth-secondary/pdns.sqlite3
# docker rm pdns
# printf '%s\n' '#forward-zones=example.com=10.10.10.10:53' '#trace=on' '#dnssec=off' '#dnssec=process-no-validate' > ./data/powerdns-recursor/custom.conf
services:
hemmelig:
image: hemmeligapp/hemmelig:bleeding-edge #latest
hostname: hemmelig
init: true
volumes:
- ./data/hemmelig/:/var/tmp/hemmelig/upload/files
environment:
- SECRET_REDIS_HOST=redis
- SECRET_DISABLE_USERS=true
FROM debian:12-slim AS build
ENV PACKAGES="make ca-certificates curl gnupg lsb-release jq python3 curl git iptables sudo file parallel"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y upgrade \
@casperklein
casperklein / cloudSettings
Last active September 20, 2024 23:21
VSCode
{"lastUpload":"2024-09-20T23:20:36.401Z","extensionVersion":"v3.4.3"}
#!/bin/bash
# wrapper for 'sed -i': fail if file was not modified by sed
set -ueo pipefail
HASHTOOL="sha1sum"
if [ $# -lt 1 ]; then
echo "Error: No file given."