Skip to content

Instantly share code, notes, and snippets.

View csamsel's full-sized avatar

Christian Samsel csamsel

View GitHub Profile
@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="[email protected]"
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 / 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 / gist:d004b0242a98529353642d89b001bd55
Created February 22, 2018 11:02
delete broken symlinks in runlevel scripts
find -L /etc/runlevels -type l -delete
@csamsel
csamsel / wildcard.sh
Last active March 14, 2018 12:43
certbot command to request wildcard certificate, requires certbot => 0.22.0
certbot certonly --manual --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory -d *.domain.tld
@csamsel
csamsel / convert-ssl.sh
Last active September 26, 2024 03:36
convert ssl certificates from pem to crt/key
openssl rsa -outform der -in privkey.pem -out privkey.key
openssl x509 -outform der -in fullchain.pem -out fullchain.crt
openssl x509 -outform der -in cert.pem -out cert.crt
@csamsel
csamsel / btrfs-raid10-notes.txt
Last active March 23, 2018 09:45
notes on switching from Linux md RAID5 to btrfs RAID10
assumptions:
/dev/sd[bcde]1 in Linux md (/dev/md0) RAID5/RAID6 mounted as /storage.
Less space used then capacity of one drive.
1.
stop all services accessing the array first.
Remounting the array ro might be a good idea (mount /dev/md0 -o remount,ro).
2.
remove one disk from array
@csamsel
csamsel / raid-settings.sh
Created March 22, 2018 11:03
script to activate TLER and disable NCQ on raid member HDDs
for i in sdb sdc sdd sde
do
# activate TLER
smartctl -q errorsonly -l scterc,70,70 /dev/$i
# disable NCQ
echo 1 > /sys/block/$i/device/queue_depth
done

Keybase proof

I hereby claim:

  • I am csamsel on github.
  • I am csamsel (https://keybase.io/csamsel) on keybase.
  • I have a public key ASDHrm4CEkXQuramKWPKoiKtLQ3uQwSVlMwUW54NSAGNCwo

To claim this, I am signing this object:

@csamsel
csamsel / dnsmasq.conf
Created April 3, 2018 10:01
dnsmasq.conf for local dnscrypt-proxy using port 5300
server=127.0.0.1#5300
no-resolv
no-poll
dnssec
dnssec-check-unsigned
conf-file=/usr/share/dnsmasq/trust-anchors.conf
domain-needed
expand-hosts
no-negcache
local-ttl=600
@csamsel
csamsel / dnscrypt-proxy.toml
Last active April 3, 2018 10:03
dnscrypt-proxy configuration for use with dnsmasq and cloudflare
listen_addresses = ['127.0.0.1:5300']
...
dnscrypt_servers = false
doh_servers = true
...
cache = false
...
server_names = ['cloudflare', 'cloudflare-ipv6']