View prepare-network.sh
#!/bin/sh
set -e
IF=${IF:-eth0:avahi}
for i in $(seq 1 30); do
ip addr add "169.254.75.$i/16" dev $IF scope link || true
done
View embed.py
import numpy as np
def embed(x,y, dimension):
"""
embed 2 vectors
>>> embed([1,2,3], [4,5,6], 2)
array([[ 2., 5., 1., 4.],
[ 3., 6., 2., 5.]])
>>> embed([1,2,3], [4,5,6], 3)
array([[ 3., 6., 2., 5., 1., 4.]])
View .bashrc
#
# .bashrc - interactive shell configuration
#
# check for interactive
[[ $- = *i* ]] || return
export TTY=$(tty)
export GPG_TTY=$TTY
View dkms-update
#!/usr/bin/env ruby
kernel_package = ARGV[0] || "linux"
content = ""
args = ["pacman", "-Ql", kernel_package]
puts("$ #{args.join(" ")}")
IO.popen(args) {|io| content = io.read }
kernel = /\/usr\/lib\/modules\/(?<version>.*)\/kernel/.match(content)
abort "no kernel version found in package" unless kernel
View freifunk-vpn-setup.service
[Unit]
Description=Setup policy routing for vpn gateways
[Service]
Type=oneshot
# Set gateway for local connections.
# fwmark is set in iptables OUTPUT chain:
# $ iptables -t mangle -I OUTPUT -j MARK --set-xmark 0x2a/0xffffffff
# $ ip6tables -t mangle -I OUTPUT -j MARK --set-xmark 0x2a/0xffffffff
# for the default gateway rp_filter needs to be disabled
View 0001-fix-bison-compile-error.patch
From 09f5335decb99912eeb97b9bb2c5e1858c094d14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@higgsboson.tk>
Date: Tue, 15 Dec 2015 22:17:21 +0000
Subject: [PATCH] fix bison compile error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
---
View 90-evdev-trackpoint.conf
Section "InputClass"
Identifier "Clickpad"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
# Synaptics options come here.
#Option "TapButton1" "1"
#Option "TapButton2" "3"
#Option "TapButton3" "2"
Option "SoftButtonAreas" "60% 0 0 40% 40% 60% 0 40%"
View easy-ipsec.sh
#!/bin/sh
### LICENSE (BSD 2-Clause) // ###
#
# Copyright (c) 2014, Daniel Plominski (Plominski IT Consulting)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
View Kommunikationsnetze2.md

Datenkommunikation im lokalen Bereich

  • Adressierung: global eindeutige 48-bit lange MAC-Addresse

Classical Ethernet

  • Funktionsweise:
    • 10 Mbps
    • alle Teilnehmer passiv auf einem langen Koaxialkabel
    • Übertragung im Basisband mit digitalen Zeitmultiplex
View mitmproxy-loopback.py
from libmproxy.protocol.http import decoded
import socket
import select
import threading
TCP_IP = '127.0.0.1'
TCP_PORT = 10000
BUFFER_SIZE = 1024
listen = socket.socket(socket.AF_INET, socket.SOCK_STREAM)