Skip to content

Instantly share code, notes, and snippets.

@ansemjo
ansemjo / german_letter_template.tex
Created February 7, 2019 16:44
Deutscher DIN Brief für Umschläge mit Sichtfenster
% write a letter
\documentclass[
11pt, ngerman,
version=last,
firsthead=false,
firstfoot=false,
foldmarks=true,
DIV=15,
parskip=half,
locfield=wide,
@ansemjo
ansemjo / mozilla-send.yml
Last active November 15, 2021 06:34
simple docker compose to self-host the firefox send experiment
# add this to a crontab to tidy up expired uploads:
# 0 * * * * find /var/lib/send/ -type f -mmin +1450 -exec rm {} \;
version: "3"
services:
web:
# repository: https://gitlab.com/timvisee/send
image: registry.gitlab.com/timvisee/send:latest
restart: unless-stopped
@ansemjo
ansemjo / haveibeepwned.sh
Created January 17, 2019 19:23
check passwords for matches in haveibeenpwned database
#!/usr/bin/env bash
# script by reddit.com/u/zfa, with modifications to allow piping on stdin and change output format
# https://old.reddit.com/r/netsec/comments/agrrig/troy_hunt_the_773_million_record_collection_1/ee9jenv/
haveibeenpwned() {
printf '\033[1m%-40s\t%9s\t%s\033[0m\n' 'sha1 hash' '# hits' 'password'
while read -r password; do
@ansemjo
ansemjo / embed_ignition.sh
Created January 3, 2019 15:53
Embed CoreOS ignition configuration in the released OVA for easy deployment of multiple instances on VMware.
#!/usr/bin/env bash
# Copyright (c) 2019 Anton Semjonov
# Licensed under the MIT License
# This script embeds a transpiled ignition (JSON) config in the CoreOS OVA
# as guestinfo parameters, so you can deploy several machines with the
# same configuration easily.
# required arguments / inputs
@ansemjo
ansemjo / lxsetup.ps1
Created December 20, 2018 06:23
Install and update Lexware Warenwirtschaft premium via GPO startup scripts
# Install & update Lexware Warenwirtschaft Premium in server/client-setup at startup via GPO startup scripts.
# This should update the Lexware client whenever you update the server, without needing to login to every single
# computer in the domain with Administrator credentials.
# registry persistence path and Lexware setup path
$REG = "HKLM:\Software\myCorp"
$LEX = "\\LEXWARE\lexware_premium_setup"
$APP = "warenwirtschaft premium"
# get current version from payload xml
@ansemjo
ansemjo / seccheck.sh
Last active September 27, 2018 21:18
wrapper for slimm609/checksec.sh which displays nicer-formatted output
#!/usr/bin/env bash
# wrapper script for slimm609/checksec.sh for nicer output format
# download https://github.com/slimm609/checksec.sh/blob/master/checksec to PATH
# further requires jq and objdump in PATH
CHECKSEC=checksec
set -e
# version information
@ansemjo
ansemjo / openwrt_profile
Last active April 19, 2019 18:26
ash profile for OpenWRT devices
#!/bin/ash
# banners
[ -f /etc/banner ] && cat /etc/banner
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
fgrep -sq '/ overlay ro,' /proc/mounts && {
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
echo 'Please try to remove files from /overlay/upper/... and reboot!'
}
@ansemjo
ansemjo / gitlab-backup-to-minio.md
Last active March 5, 2024 23:30
upload gitlab omnibus backups to minio

setup Minio somewhere

Minio is an object storage server compatible with the S3 protocol. Head to https://minio.io/ to learn more.

Hint: You might want to use MINIO_WORM=on to pretect against accidental or malicious deletion of your backups.

seperate users with iam policies

Since RELEASE.2018-10-18T00-28-58Z minio supports seperate users with attached IAM policies. Instead of (or additionally to) using MINIO_WORM=on you could create a new user and attach a writeonly policy:

#!/usr/bin/env bash
# adb reference: https://developer.android.com/studio/command-line/adb.html
# start adb as root
# check device list
# adb pull /sdcard .
# adb backup ...
serial=YOUR_HEX_SERIAL # see `adb devices` list
#!/usr/bin/env bash
echo -e "$(cat <<TUX | sed \
-e 's/\([\/]\+\)/\\033[31m\1\\033[0m/g' \
-e 's/\([@#]\+\)/\\033[1m\1\\033[0m/g'
###################################
# #
# #
# #
# @@@@@ @@@@@ #