Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian Kornberger corny

View GitHub Profile
@corny
corny / customers.xml
Created Feb 11, 2022
Noasys XML Import
View customers.xml
<?xml version="1.0"?>
<customers>
<customer>
<!-- Kundennummer -->
<number>1234</number>
<!-- Debitorennummer, wenn abweichend von Kundennummer -->
<debtorNumber>10512</debtorNumber>
<!-- m=Herr | f=Frau -->
@corny
corny / wg_key
Last active Oct 21, 2020
Ansible module to read or generate a WireGuard keypair
View wg_key
#!/usr/bin/python
EXAMPLES = '''
# Reads or generates a wireguard key
- wg_key: path=/etc/wireguard/site/secret.conf
'''
from ansible.module_utils.basic import AnsibleModule
import os
import re
@corny
corny / wireguard.yml
Created Jun 15, 2020
Wireguard with Ansible and networkd
View wireguard.yml
---
- name: Install wireguard
apt: name=wireguard
- name: Read private key
slurp:
src: /etc/systemd/network/99-wg0.netdev
register: netdev
ignore_errors: yes
@corny
corny / blacklist.py
Created May 19, 2020
journald-nftables blacklist script for Caddy
View blacklist.py
#!/usr/bin/python3 -u
import select
import re
import subprocess
from systemd import journal
from datetime import timedelta
from collections import defaultdict
@corny
corny / otrs.service
Created Mar 1, 2019
Sytemd unit for OTRS
View otrs.service
[Unit]
Description=OTRS daemon
After=network.target
Requires=mysql.service
[Service]
Type=forking
ExecStart=/opt/otrs/bin/otrs.Daemon.pl start
User=otrs
Restart=on-failure
@corny
corny / upgrade.sh
Created Feb 26, 2019
Notes to Upgrade OTRS 2.2 to 4.0
View upgrade.sh
#/bin/sh
host="otrs.example.com"
pass="topsecret"
rsync -av $host:/var/lib/mysql /var/lib/ --exclude usr_\* --exclude confixx --delete
rsync $host:/etc/mysql/debian.cnf /etc/mysql/
# Perl-Pakete für OTRS
apt install --no-install-recommends libtimedate-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl libsoap-lite-perl libgd-text-perl libtext-csv-xs-perl libjson-xs-perl libgd-graph-perl libapache-dbi-perl libcrypt-eksblowfish-perl libarchive-zip-perl libtemplate-perl libyaml-libyaml-perl
@corny
corny / sshtunnel.go
Last active Aug 27, 2021 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
View sshtunnel.go
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
@corny
corny / dynv6.py
Created Feb 14, 2018
dynv6 python script
View dynv6.py
#!/usr/bin/env python2
import subprocess
import re
import urllib2
import os
hostname = "xxx.dynv6.net"
token = "your-secret-token"
@corny
corny / event.go
Last active Apr 16, 2018
Golang observer for devd.pipe
View event.go
package devd
import "strings"
const (
NotifyEvent = iota
DeviceAttached
DeviceDetached
Unknown
)
@corny
corny / dhcp_discover.go
Created Oct 28, 2017
DHCP discover with Go and raw sockets
View dhcp_discover.go
package main
import (
"log"
"math/rand"
"net"
"os"
"os/signal"
"syscall"