Skip to content

Instantly share code, notes, and snippets.

View tschaefer's full-sized avatar

Tobias Schäfer tschaefer

View GitHub Profile
@tschaefer
tschaefer / linux-error.c
Created April 9, 2014 07:57
glibc linux error list
#include <stdio.h>
#include <string.h>
#include <errno.h>
int main(void) {
struct error {
int code;
char *define;
};
@tschaefer
tschaefer / linux-error.txt
Created April 9, 2014 08:00
glibc linux error list
code[1] define[EPERM] str[Operation not permitted]
code[2] define[ENOENT] str[No such file or directory]
code[3] define[ESRCH] str[No such process]
code[4] define[EINTR] str[Interrupted system call]
code[5] define[EIO] str[Input/output error]
code[6] define[ENXIO] str[No such device or address]
code[7] define[E2BIG] str[Argument list too long]
code[8] define[ENOEXEC] str[Exec format error]
code[9] define[EBADF] str[Bad file descriptor]
code[10] define[ECHILD] str[No child processes]
@tschaefer
tschaefer / config.yaml
Created August 24, 2015 16:20
~/.config/beets/config.yaml
directory: /storage/media/music
import:
write: no
copy: no
move: no
resume: no
autotag: no
plugins: store fetchart
fetchart:
auto: no
"nics": [
{
"nic_tag": "admin",
"ips": ["10.19.80.225/24", "addrconf"],
"gateways": ["10.19.80.1"],
"allow_ip_spoofing": true
}
]
@tschaefer
tschaefer / config.ovpn
Last active August 30, 2016 18:49
OpenVPN MacOS DNS
...
script-security 2
up bin/up.sh
down bin/down.sh
...
@tschaefer
tschaefer / fastcgi-perl-wrapper.service
Created September 26, 2016 20:12
FastCGI Perl Wrapper Systemd Unit File
[Unit]
Description=FastCGI Perl Wrapper
After=network.target
[Service]
Type=forking
TimeoutStopSec=0
User=www-data
Group=www-data
ExecStart=/usr/local/bin/fastcgi-perl-wrapper
#!/bin/bash
export PERL5OPT=-MDevel::Cover
MOJO_CLIENT_DEBUG=1 prove -l lib -v --merge t/
unset PERL5OPT
cover
@tschaefer
tschaefer / last.service
Created February 22, 2017 09:14
last systemd service in target
[Unit]
Description=Last Stuff
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/bin/do-last
RemainAfterExit=yes
[Install]
#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
#
# Note: This script does calculation for all shared memory
# segments available when the script is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
@tschaefer
tschaefer / README.md
Last active June 9, 2019 17:34 — forked from mikoim/README.md
WireGuard example configuration for VPN

Server

iptables -A FORWARD -i wg0 -o YOUR_INTERFACE -s 10.200.200.0/24 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o YOUR_INTERFACE -s 10.200.200.0/24 -j MASQUERADE

Client

wg-quick up `pwd`/client.conf