Skip to content

Instantly share code, notes, and snippets.

View reitermarkus's full-sized avatar

Markus Reiter reitermarkus

View GitHub Profile
#!/usr/bin/env bash
sudo apt-get install -y ifenslave
sudo sed -i '/^denyinterfaces eth0 wlan0 bond0$/d' /etc/dhcpcd.conf
cat <<EOS | sudo tee -a /etc/dhcpcd.conf
denyinterfaces eth0 wlan0 bond0
EOS
cat <<EOS | sudo tee /etc/modprobe.d/bonding.conf
brew install nut
brew tap reitermarkus/tap
brew install nut-notify
cat <<EOF > /usr/local/etc/nut/nut.conf
MODE=netclient
EOF
cat <<EOF > /usr/local/etc/nut/upsmon.conf
MONITOR [email protected] 1 upsmon_remote KMdyQNBbEVkNBz23 slave
@reitermarkus
reitermarkus / codecov.js
Last active April 30, 2020 21:10
CodeCov Status for SinusBot
registerPlugin({
requiredModules: ['http'],
name: 'CodeCov Status',
version: '1.0.0',
engine: '>= 1.0.0',
description: 'Check and display CodeCov status.',
author: 'Markus Reiter <[email protected]>',
vars: [{
name: 'interval',
indent: 0,
#!/usr/bin/env bash
set -euo pipefail
apt-get update
apt-get install -y strongswan strongswan-pki libcharon-extra-plugins
VPN_NAME='My VPN'
WIFI_SSID='My WiFi'
VPN_DOMAIN='vpn.example.com'
@reitermarkus
reitermarkus / proxmox-setup.sh
Last active November 23, 2021 07:50
Proxmox Setup
set -euo pipefail
# Reduce backup IO.
sed -i -E 's/^\s*#?\s*(ionice:).*/\1 7/' /etc/vzdump.conf
sed -i -E 's/^\s*#?\s*(bwlimit:).*/\1 32768/' /etc/vzdump.conf
tee /etc/cron.hourly/xfs_fsr <<EOF
#!/bin/sh
xfs_fsr -t 600

Keybase proof

I hereby claim:

  • I am reitermarkus on github.
  • I am reitermarkus (https://keybase.io/reitermarkus) on keybase.
  • I have a public key whose fingerprint is A550 5A66 5005 D487 EFD2 999A 7844 823D 1101 29B0

To claim this, I am signing this object:

@reitermarkus
reitermarkus / aws
Last active June 22, 2018 12:44
AWS Snippets
```bash
aws configure set aws_access_key_id {access_key_id}
aws configure set aws_secret_access_key {secret_access_key}
aws configure set default.region {region}
aws s3 cp '{file}' 's3://{bucket.name}'
```
#!/usr/bin/swift
import Cocoa
import Foundation
DispatchQueue.main.async {
let arguments = CommandLine.arguments.dropFirst()
let urls = arguments.map { URL(fileURLWithPath: $0) }
#if swift(>=4.0)
@reitermarkus
reitermarkus / apply.rb
Created March 27, 2017 08:22
Apply-Algorithm in Ruby
#!/usr/bin/env ruby
class Node
attr_accessor :label
attr_accessor :lo
attr_accessor :hi
def initialize(lo, label, hi)
@lo = lo
@label = label
@reitermarkus
reitermarkus / cod4.rb
Created March 27, 2017 00:19
Fetch CoD 4 server info and generate nice JSON output.
#!/usr/bin/env ruby
#
# Fetch CoD 4 server info and generate nice JSON output.
#
# Usage:
# `$0 0.0.0.0:00000`
require 'json'
require 'socket'