Skip to content

Instantly share code, notes, and snippets.

View mrunkel's full-sized avatar

Marc Runkel mrunkel

  • plusForta, GmbH
  • Düsseldorf, Germany
View GitHub Profile
@mrunkel
mrunkel / installcert.sh
Last active March 15, 2018 12:26
acme.sh command for nginx
export DOMAIN=""
acme.sh --install-cert -d ${DOMAIN} --key-file /etc/ssl/private/${DOMAIN}-key.pem --fullchain-file /etc/ssl/certs/${DOMAIN}-cert.pem --reloadcmd "service nginx force-reload"
@mrunkel
mrunkel / dewebm.sh
Created March 5, 2018 14:36
dewebm script
#!/bin/sh
shopt -s nullglob
for f in *.webm
do
file=$(basename "$f")
ext="${file##*.}"
name="${file%.*}"
echo "Converting $file to mpeg4"
ffmpeg -hide_banner -v error -i "$file" "${name}.mp4" && rm $f
done
@mrunkel
mrunkel / checkpass
Created February 22, 2018 13:27
A simple command line script to check your password against the HIBP database.
#!env php
<?php
/**
* Generates a SHA1 hash of the password to be tested. Sends the first 5
* characters of said hash to HIBP.
*
* HIBP returns the remaining characters of any hashes in their database that
* matched ours.
*
@mrunkel
mrunkel / 0-hidden-service-subdomains.md
Created February 15, 2018 09:45 — forked from mtigas/0-hidden-service-subdomains.md
Example code for running a (HTTP/HTTPS) Tor hidden service supporting subdomains.

The following files show an example of how to create subdomains for onion site hidden services. (This hasn't been tested for hidden services for anything other than HTTP/HTTPS.)

(You might also want to read our blog post about ProPublica’s Tor hidden service, including a tutorial and notes on running a hidden service: https://www.propublica.org/nerds/item/a-more-secure-and-anonymous-propublica-using-tor-hidden-services )

In general, this works (maybe just in recent Tor clients) because Tor will handle the connection to www.xxxxxxxxxxxxxxxx.onion as a connection to xxxxxxxxxxxxxxxx.onion. The encapsulated HTTP/HTTPS connection contains the subdomain in the Host: header (and in the case of HTTPS, the SNI

@mrunkel
mrunkel / nginx
Last active November 17, 2017 15:02 — forked from bastianallgeier/nginx
nginx setup for local vagrant boxes
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/local;
access_log /var/log/nginx/kirby.log;
error_log /var/log/nginx/kirby.err.log;
index index.php;
@mrunkel
mrunkel / git-workflow.md
Created October 10, 2017 12:33 — forked from forest/git-workflow.md
Git Feature Branch Workflow

We subscribe to the Git Featrue Branch workflow, briefly described in that link.

In practice, it works as follows:

FEATURE DEVELOPMENT

Steps to Follow:

  1. Start with an updated local development branch -- by checking out the dev branch and pulling changes:
    git checkout development
    git pull origin development
everyone saying that Caddy made it simple for automated LE; I agree, but also, it's not that difficult to setup with NGINX:
Edit /var/nginx/ssl_common.conf
ssl_certificate /etc/letsencrypt/live/<site>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<site>/privkey.pem;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
allow all;
root /var/www/example;
auth_basic off;
@mrunkel
mrunkel / ebay.py
Created September 12, 2017 11:07
Some student's homework
#-----Preamble-------------------------------------------------------#
#
# This section imports necessary functions and defines constant
# values used for creating the drawing canvas. You should not change
# any of the code in this section.
#
# Import the functions needed to complete this assignment. You
# should not need to use any other modules for your solution.
@mrunkel
mrunkel / addhost.sh
Created August 2, 2017 20:27
simple bash shell script adds an A record and a PTR for the passed fqdn/ip pair
#!/bin/bash
# adds an A record and a PTR for the passed fqdn/ip pair
function printUsage () {
echo "usage: $0 fqdn ip"
echo
}
if [ $# -ne 2 ] ; then
printUsage
@mrunkel
mrunkel / s3-backup.sh
Last active April 2, 2022 16:04
A small script to backup files and directories to s3 using s3cmd
#!/bin/bash
# you can drop this in cron.hourly or cron.daily, or run it manually.
## relies on an installed and properly configured s3cmd.
## install python-magic to keep s3cmd from throwing warnings.
# set your bucket name here, it can be global for your org as we store any data
# under the hostname.
# note: bucket names are global, so you need to pick something nobody else already picked.