Skip to content

Instantly share code, notes, and snippets.

View sq3's full-sized avatar
🚀
Raketen Style

Marc Schnitzius sq3

🚀
Raketen Style
View GitHub Profile
@sq3
sq3 / avahi-daemon.service
Last active January 13, 2018 09:53
Custom avahi-daemon Unitfile for nspawn Containers
# the option --no-rlimits makes the difference
[Unit]
Description=Avahi mDNS/DNS-SD Stack
Requires=avahi-daemon.socket
[Service]
Type=dbus
BusName=org.freedesktop.Avahi
# Debian path is /usr/sbin/avahi-daemon
@sq3
sq3 / nsswitch.conf
Created December 9, 2017 13:53
Arch Linux nsswitch.conf for mDNS
# Begin /etc/nsswitch.conf
# requires nss-mdns package
passwd: compat mymachines systemd
group: compat mymachines systemd
shadow: compat
publickey: files
hosts: files mdns4_minimal [NOTFOUND=return] !UNAVAIL=return] resolve dns
@sq3
sq3 / iptables-clear.sh
Last active October 27, 2017 08:03
Clear iptables rules
#!/bin/sh
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t nat -Z
@sq3
sq3 / autocommit.sh
Created April 27, 2017 12:41
Auto-commit on inotify change triggerd by systemd.path
#!/bin/bash
REPO_PATH=$1
cd $REPO_PATH
git=$(which git)
git add -A && git commit -m "Scripted auto-commit on change triggerd by systemd.path"
@sq3
sq3 / gist:713f388da8c8de53fae09c86282d6770
Created August 15, 2017 07:24
Download OpenJDK with aria2c via http Proxy
$ aria2c --max-connection-per-server=16 \
--min-split-size=1M \
--header="Cookie: oraclelicense=accept-securebackup-cookie" \
--http-proxy="http://1.2.3.4:3128" \
http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
08/15 09:22:34 [NOTICE] Downloading 1 item(s)
[#3114d1 176MiB/176MiB(99%) CN:3 DL:10MiB]
08/15 09:22:52 [NOTICE] Download complete: /tmp/tmp/jdk-8u144-linux-x64.tar.gz
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias l='ls -lahtr --color=auto --time-style="+ %F %H:%M │ "'
alias ll='ls -l --color=auto --time-style="+ %F %H:%M │ "'
alias grep='grep --color=auto'
export PS1="\[\u@$(hostname -f): \w\]\n\$ "
[ -e "/etc/DIR_COLORS" ] && DIR_COLORS="/etc/DIR_COLORS"
@sq3
sq3 / nspawn-plex.service
Created February 15, 2017 18:53
systemd-nspawn-plex example service file
[Unit]
Description=Container Plex
Documentation=man:systemd-nspawn(1)
PartOf=machines.target
Before=machines.target
After=network.target zfs-mount.service
[Service]
ExecStart=/usr/bin/systemd-nspawn \
--quiet \
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only root or user avahi can own the Avahi service -->
<policy user="avahi">
<allow own="org.freedesktop.Avahi"/>
</policy>
<policy user="root">
@sq3
sq3 / get-arch-iso-url.py
Last active January 20, 2017 14:58
Get .iso URL of the latest ArchLinux release
#!/usr/bin/env python
# coding=utf8
import re
import urllib2
matches = []
feed_url = 'https://www.archlinux.org/feeds/release/'
@sq3
sq3 / zfs-upgrade.sh
Last active July 21, 2016 11:10
Arch system and ZFS upgrade
#!/bin/bash
# colours
GREEN='\033[0;32m'
NC='\033[0m'
CWD=/tmp/zfs-$(date +%Y-%m-%d)
mkdir $CWD
cd $CWD