Skip to content

Instantly share code, notes, and snippets.

View csamsel's full-sized avatar

Christian Samsel csamsel

View GitHub Profile
@csamsel
csamsel / etc radvd.conf
Created February 20, 2018 10:37
radvd configuration to announce WAN route to local lan
interface eth1 # local network interface
{
AdvSendAdvert on;
MaxRtrAdvInterval 300;
MinRtrAdvInterval 30;
prefix ::/64 # derives prefix from interface IP
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
@csamsel
csamsel / etc conf.d net
Last active June 6, 2018 08:23
Gentoo router network configuration for NetAachen / NetCologne using Draytek VigorNIC 132
# PPPoE username and password as provided by NetAachen / NetCologne
username_ppp0="nc-XXXXXXX@netaachen.de"
password_ppp0="XXXXXX"
modules="tuntap ethtool pppoe arping dhcpcd iproute2 !ip6rd !wpa_supplicant !iwconfig !ssidnet !apipa !dhclient !pump !bond !bridge"
#LAN
config_eth1="192.168.2.1/24" # Router IP
vlans_eth1="12 20 34" # used VLANs, configure to your likings
config_eth1_12="192.168.12.1/24" # IoT
@csamsel
csamsel / openvpn-udp.conf
Created February 7, 2018 12:58
secure OpenVPN configuration using easy-rsa
dev vpn0
port 5000
tls-server
key /etc/openvpn/easy-rsa/pki/private/openvpn.key
cert /etc/openvpn/easy-rsa/pki/issued/openvpn.crt
ca /etc/openvpn/easy-rsa/pki/ca.crt
dh /etc/openvpn/easy-rsa/pki/dh.pem
tls-crypt /etc/openvpn/easy-rsa/pki/openvpn.tlsauth
crl-verify /etc/openvpn/easy-rsa/pki/crl.pem
@csamsel
csamsel / logrotate.conf
Last active March 2, 2023 15:42
use lzma for logrotate instead of gzip for better compression
# ...
# compress rotated log files.
compress
compresscmd lzma
uncompresscmd lzmadec
compressext .xz
delaycompress
# ...
@csamsel
csamsel / gist:4a45318fa94394acf124f7250e8fe31c
Created February 6, 2018 10:52
remove invalid VMs from ESXi inventory without vCenter
for a in $(vim-cmd vmsvc/getallvms 2>&1 |grep invalid |awk '{print $4}'|cut -d \' -f2);do vim-cmd vmsvc/unregister $a;done
@csamsel
csamsel / gist:a0001e604035886a1839f307473e8bbd
Created January 29, 2018 18:17
Increase btrfs gpt partition after enlarging the virtual drive
oxygen-system-vm ~ # fdisk -l /dev/sda
GPT PMBR size mismatch (41943039 != 62914559) will be corrected by w(rite).
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 10B93AE8-1045-434C-A36E-F7801B17CE32
Device Start End Sectors Size Type
@csamsel
csamsel / generate-ovpn.sh
Last active April 19, 2019 15:56
Generate ovpn file for mobile OpenVPN clients for easy-rsa directory
#/bin/sh
cp template.ovpn $1.ovpn
echo "<ca>" >>$1.ovpn
cat pki/ca.crt >>$1.ovpn
echo "</ca>" >>$1.ovpn
echo "<cert>" >>$1.ovpn
cat pki/issued/$1.crt >>$1.ovpn
echo "</cert>" >>$1.ovpn
echo "<key>" >>$1.ovpn
@csamsel
csamsel / syslog-ng.conf
Last active January 26, 2018 20:42
syslog-ng configuration for loghost (receive)
source s_extern {
network(
transport("udp")
);
network(
transport("tcp")
);
};
@csamsel
csamsel / syslog-ng.conf
Created January 7, 2018 20:52
syslog-ng configuration for loghost (send)
log { source(src); destination(d_extern); };
destination d_extern { tcp("192.168.2.15"); };
@csamsel
csamsel / dhcpcd-pd.conf
Last active February 20, 2018 12:56
dhcpcd configuration to get a prefix delegation from an external interface and distribute it to a lan
duid
noipv6rs
waitip 6
ipv6only
# dont run hooks
nohook resolv.conf, yp, hostname, ntp
interface ppp0 # WAN interface