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 / 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
@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 / 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 / zfs-arch-install.sh
Last active May 16, 2018 08:19
setup zfs on arch
#!/bin/bash
# this script isntalls zfs via dkms and needs sudo package installed an
# configured for the user who runs this script.
#
# The zpools are named tank.
# Give the disk you want to use for the zpool as $1
#
# https://wiki.archlinux.org/index.php/ZFS
@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">
[[ $- != *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 / 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/'
# confirm you can access the internet
if [[ ! $(curl -Is http://www.google.com/ | head -n 1) =~ "200 OK" ]]; then
echo "Your Internet seems broken. Press Ctrl-C to abort or enter to continue."
read
fi
# make 2 partitions on the disk.
parted -s /dev/sda mktable msdos
parted -s /dev/sda mkpart primary 0% 100%
@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