Skip to content

Instantly share code, notes, and snippets.

View chrisnew's full-sized avatar
👾
wat

Christian chrisnew

👾
wat
View GitHub Profile
@chrisnew
chrisnew / fastd-hofheim.conf
Last active January 1, 2022 00:36
`fastd -c fastd-hofheim.conf` und dann `tap0` von QEMU ins `br-hofheim` mit `brctl addif br-hofheim tap0`
# Log errors to stderr
log level error;
# Log warnings to a log file
log to syslog as "fastd-hofheim" level warn;
# Set the interface name
interface "fastd-hofheim";
# Disable encryption
@chrisnew
chrisnew / de.chrisnew.i-replacer.js
Last active February 9, 2017 16:24
Binnen-I-Remover User Script (Greasemonkey)
// ==UserScript==
// @name Binnen-I-Replacer
// @namespace de.chrisnew.i-replacer
// @version 5
// @match *://*/*
// ==/UserScript==
var preserveElements = ['style', 'script', 'pre', 'code'];
var matcher = /((?![a-zA-z]+)([*_]in|In)(nen)?|\/[Ii]n(nen)?)/g;
@chrisnew
chrisnew / hipache-connector.sh
Last active August 29, 2015 14:13
If you're using hipache as a reverse proxy and use docker container for different virtual hosts, you can use hipache-connector.sh as a supervisor program which automatically registers and unregisters itself from the given hipache server.
#!/usr/bin/env bash
SHUTDOWN=0
IP=127.0.0.1
VHOST="`hostname -f`"
SUBDOMAIN=www
HIPACHE=hipache
DEVICE=eth0
SCHEME=http
@chrisnew
chrisnew / postfix-wrapper.sh
Created January 21, 2015 14:18
postfix-wrapper.sh for supervisord in docker. Controls postfix as it gets controlled by supervisord.
#!/usr/bin/env bash
# postfix-wrapper.sh, version 0.1.0
#
# You cannot start postfix in some foreground mode and
# it's more or less important that docker doesn't kill
# postfix and its chilren if you stop the container.
#
# Use this script with supervisord and it will take
# care about starting and stopping postfix correctly.
#
@chrisnew
chrisnew / tlschecker.sh
Created January 18, 2015 22:17
A simple shell script which checks TLS server for certificate algorithm and supported ciphers using OpenSSL.
#!/usr/bin/env bash
# tlschecker.sh, version 0.1.0
# based on https://superuser.com/revisions/224263/3
#
# changelog:
# - added argument for hostname
# - made port optional
# - openssl uses SNI
# - displays subject, issuer, algorithm of certificate
# - some output tweaking
@chrisnew
chrisnew / json2csv.php
Created October 20, 2014 09:51
Convert a list of the same maps into a CSV file.
#!/usr/bin/php
<?php
// usage: cat some-output.json | ./json2csv.php > some-output.csv
function error($msg, $ret = 1) {
die('ERROR: ' . $msg . PHP_EOL);
exit($ret);
}
$data = json_decode(file_get_contents('php://stdin'), true);
@chrisnew
chrisnew / gist:69d82b8a55a5ea94dc8f
Created October 20, 2014 09:44
Script for getting contacts in a JSON string from his own account on XING.com
window.contacts = [];
$('#contacts-table > li').each(function(){
var elem = $(this);
var data = {
name: elem.find('.title > a[href^="/profile"]').text(),
position: $.trim(elem.find('.text').clone().children().remove().end().text()),
company: elem.find('.company > a').text()
};
@chrisnew
chrisnew / hd44780-lcd.js
Last active August 12, 2016 13:23
HD44780 LCD on a Raspberry Pi controlled by node.js with onoff and sleep.
var Gpio = require('onoff').Gpio;
var sleep = require('sleep');
var displayPorts = {
RS: 7,
E: 8,
D4: 25,
D5: 24,
D6: 23,
D7: 18,