Skip to content

Instantly share code, notes, and snippets.

View corny's full-sized avatar

Julian Kornberger corny

View GitHub Profile
@corny
corny / README.md
Last active May 31, 2024 00:14
Install Ubuntu 24.04 via PXE on PC Engines APU Board

Preparing Mikrotik Router

/ip dhcp-server network
add address=192.168.180.0/24 boot-file-name=pxelinux.0 dns-server=192.168.180.1 gateway=192.168.180.1 next-server=192.168.180.55

Preparing PXE files

Download the Ubuntu 24.04 Netboot tarball and extract it to /srv/tftp.

FROM --platform=linux/amd64 alpine:latest
RUN apk add --update \
7zip \
curl \
wine
ARG QAAC_VERSION=2.80
ENV WINEDEBUG=-all
@corny
corny / customers.xml
Created February 11, 2022 15:46
Noasys XML Import
<?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 October 21, 2020 06:50
Ansible module to read or generate a WireGuard keypair
#!/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 June 15, 2020 13:17
Wireguard with Ansible and networkd
---
- 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 18:13
journald-nftables blacklist script for Caddy
#!/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 March 1, 2019 14:15
Sytemd unit for OTRS
[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 February 26, 2019 21:44
Notes to Upgrade OTRS 2.2 to 4.0
#/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 August 27, 2021 22:54 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
@corny
corny / dynv6.py
Created February 14, 2018 02:29
dynv6 python script
#!/usr/bin/env python2
import subprocess
import re
import urllib2
import os
hostname = "xxx.dynv6.net"
token = "your-secret-token"