Skip to content

Instantly share code, notes, and snippets.

View moritzheiber's full-sized avatar

Moritz Heiber moritzheiber

View GitHub Profile
@moritzheiber
moritzheiber / gist:0045c6512a8472b8fcf47e6041dab07c
Created February 10, 2024 11:25
Pocketbook's email server is ancient
❯ nmap -sV --script ssl-enum-ciphers -pT:25,587 mail.pocketbook-int.com
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-02-10 12:17 CET
Nmap scan report for mail.pocketbook-int.com (109.72.149.55)
Host is up (0.012s latency).
PORT STATE SERVICE VERSION
25/tcp open smtp Microsoft Exchange smtpd
| ssl-enum-ciphers:
| SSLv3:
| ciphers:
@moritzheiber
moritzheiber / cleanup_gcr.sh
Created July 28, 2021 14:57
A small script to delete all images within Google Container Registry in a specific project
#!/bin/bash
set -Eeu -o pipefail
REPOSITORY="${1:-}"
delete_images() {
local repository
repository=${1:-}
@moritzheiber
moritzheiber / sqlite2pg.sh
Last active January 11, 2018 20:52 — forked from eclubb/sqlite2pg.sh
Script to import SQLite3 database into PostgreSQL
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
SQLITE_DB_PATH=$1
PG_DB_NAME=$2
PG_USER_NAME=$3
@moritzheiber
moritzheiber / defaults_main.yml
Created April 17, 2017 15:15
Ansible example
ubuntu:
packages:
- package: "libssl-dev"
- package: "zlib1g-dev"
- package: "git-core"
- package: "build-essential"
- package: "libxml2-dev"
- package: "libxslt1-dev"
- package: "imagemagick"
- package: "nodejs"
-----BEGIN PGP MESSAGE-----
hQEMA9X0O2Qy6nfzAQgAvt0Wedg6HdzSlHu/wVOlIbeHKPpOLx4tKjRAdaxhKvnb
LgYz8UHzhOXACEmZJVG41w9imYf54I9MhdVOPFsnRkzqYAySTjfZML+kscoo0p9N
7zIGyWVA5MYjqbGFPw8ZbF0djGNBeyW00vZzJOjoa+B1qlcbU7agmr+hrJn3M3Nb
teY+h5t747ce0+47x8s37s02KRR47Qp//a366rDWKLslXTsXYzwxw9bOrCMcpHaf
cxhsQSxJ/9MhySaR1DZqBRdRHb5d1xytMUQQjzsGBBt3+vmMPdHq5D/xqAN2W2wV
2R81fJhMc53KwRZOY5FwdVofEPfNKcTVT4K7Ihc0ANLqAUdb3elbynoYhIB7KHN4
JOAqN36fTlNtBhOLsdd4Dfb8vs8vX1y1Tcwy11gciez6NTxdNc3HYaPeAJKl1hDy
t1vBOhYA2rUhBpPxuLVRI7oG+DkEw2jeDnuCJPLAsSbIMjtSlTxCCM2FnPClHrUl
@moritzheiber
moritzheiber / crash.log
Created September 12, 2016 09:34
Terraform crash log
-----BEGIN PGP MESSAGE-----
hQEMA9X0O2Qy6nfzAQf/RTwCGoVX6uX+Hd6aRE4mjxR3cUIMuWhvEbNUHfNIZlF7
XD5CGx/3dC/bGVatS4g5MeWOz43Sb9jAuvrTYgsSuWRwIocZNRIhpQndBOORCTdb
IO4mp05KjpaXueg8YN/T7W8cCNnMfaexIlmh1ellcm8bHQglf1gQVyyfgJ7+Xv2m
v16B3a3sRvGACLyulXKwHf9xoEfE0OjEisxuU0NbiA/MQVo95hFhot+B9ArRhvhb
6+Iox6yF94wW9HbRESoxDS3Q+CajEfpGlFXmt+eSHUpqRpozauwECbLyXn+dTPW8
DYbQxUbFg9FWXMsX0NfdO4Y1cpP76L2cAPWMUBROMtLtAd7d9csinNDF+ZmFNi5V
xXLrc4ztgxHCedaZRkdbtdWj8dZGdznMLlnIufuN2u7LH3SaVd4NQoIvMMozuD2Z
yM5w1zNoxyP/TUJMvKnMdu5UahgZK7vYMEIRZb95VNzruayx0veFp4s+IuK3aRfH
@moritzheiber
moritzheiber / docker_cleanup.sh
Created June 24, 2016 08:58
Cleaning up your Docker environment
#!/bin/bash
set -ex
# Remove containers
docker ps -q -f status=exited | xargs --no-run-if-empty docker rm
# Remove volumes
docker volume ls -qf dangling=true | xargs --no-run-if-empty docker volume rm
@moritzheiber
moritzheiber / renew_certs.sh
Created March 6, 2016 14:31
Renew domains with Let's Encrypt
#!/bin/bash
set -xeu
declare -a DOMAINS
DOMAINS=(enter your domains here) # separated by spaces
DIR="/tmp/letsencrypt-auto"
LETSENCRYPT="/home/moe/letsencrypt"
URL="https://acme-v01.api.letsencrypt.org/directory"
@moritzheiber
moritzheiber / duplicity-backup.sh
Last active October 27, 2022 05:37
Duplicity backup script
#!/bin/bash
#The MIT License (MIT)
#
#Copyright (c) 2014 Moritz Heiber <[email protected]>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
@moritzheiber
moritzheiber / csv-import.rb
Created July 1, 2014 15:15
Importing users listed in a CSV file into a Samba4 AD
require 'csv'
SAMBA_TOOL='/usr/bin/samba-tool'
raise "You need to specify a csv file" if ARGV[0].nil? || !File.exists?(ARGV[0])
CSV::Converters[:blank_to_nil] = lambda do |field|
field && field.empty? ? nil : field
end