Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
echo -n 'DNS'
NSTREINIP=`ip netns exec physical host www.nstrein.ns.nl | awk '/has address/ { print $4; }'`
echo -n '. curl'
REQ=`ip netns exec physical curl -sSH 'Host: www.nstrein.ns.nl' "http://${NSTREINIP}/?action=nstrein:main.internet"`
echo '.'
#!/bin/bash
WIDTH=160
HEIGHT=75
X=0
Y=30
XDIR="r"
YDIR="b"
XOFFSET=150
YOFFSET=65
  • OpenVPN server publicly accessible on 198.18.0.1.
  • IP-range for the VPN clients, statically configured via ccd: 10.88.88.0/24
    • vpn1: 10.88.88.10
    • vpn2: 10.88.88.22
    • vpn3: 10.88.88.30
  • IP-range of the "internal" network: 10.0.10.0/24.

Topology:

[ internet ] --- [198.18.0.1] vpn-serv
location /.well-known/acme-challenge/ {
alias /var/www/challenges/.well-known/acme-challenge/;
try_files $uri @forward_https;
}
location @forward_https {
return 301 https://$host$request_uri;
}
location / {
return 301 https://$host$request_uri;
}
@mrngm
mrngm / dnsmasq.conf
Created April 6, 2018 09:34
Simple DHCP configuration in dnsmasq
### Specify the interface
interface=enp0s25
### Specify the range
dhcp-range=192.168.10.50,192.168.10.150,12h
### Specify DNS servers (optional)
dhcp-option=6,8.8.4.4,8.8.8.8
@mrngm
mrngm / 00-wildcard.conf
Created January 27, 2018 19:21
Proxy wildcard domains to another port
server {
listen [::]:80;
server_name ~^(.+)$;
location / {
proxy_pass_request_headers on;
proxy_pass_request_body on;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
@mrngm
mrngm / list-vm-disks.sh
Created January 6, 2018 12:37
Shows Vdev->block device mappings for a Xen guest
#!/bin/bash
# Written in 2018 by Gerdriaan Mulder <hello[at]moeilijklastig(dot)nl>
# This tool shows the mapping between a Xen Vdev attached to a Xen guest.
# Example output that uses an LVM backend:
#
# # ./list-vm-disks myguest
# Domain -> ID: myguest -> 42
# Listing Vdev -> LV mappings...
[mrngm@kaakje nsafstanden]$ python tarieven.py
Van: nm, Naar: mt
Tarieven voor tariefafstand 173:
Tweede klas:
Vol tarief: 23,30
20% korting: 18,60
40% korting: 14,00
Eerste klas:
Vol tarief: 39,60
20% korting: 31,70
#!/bin/bash
#============================================================================
# ${XEN_SCRIPT_DIR}/vif-route
#
# Script for configuring a vif in routed mode.
# The hotplugging system will call this script if it is specified either in
# the device configuration given to Xend, or the default Xend configuration
# in ${XEN_CONFIG_DIR}/xend-config.sxp. If the script is specified in
# neither of those places, then vif-bridge is the default.
#
$ find . -iname \*.mp4 | sort
./33c3-7946-eng-Console_Hacking_2016.mp4
./33c3-7958-eng-Space_making_space_shaping.mp4
./33c3-7960-deu-eng-gsw-Fnord-Jahresrueckblick_hd.mp4
./33c3-8020-deu-eng-Methodisch_inkorrekt_hd.mp4
./33c3-8029-eng-deu-fra-The_Ultimate_Game_Boy_Talk_hd.mp4
./33c3-8061-eng-You_can_-j_REJECT_but_you_can_not_hide_Global_scanning_of_the_IPv6_Internet.mp4
./33c3-8062-eng-A_look_into_the_Mobile_Messaging_Black_Box.mp4
./33c3-8074-eng-Recount_2016_An_Uninvited_Security_Audit_of_the_US_Presidential_Election.mp4