Skip to content

Instantly share code, notes, and snippets.

@DirkHeinke
DirkHeinke / docker-compose.yaml
Created June 29, 2022 19:05
Factorio Server Manager with Traefik
version: "3"
services:
factorio-server-manager:
image: "ofsm/ofsm:latest"
container_name: "factorio-server-manager"
restart: "unless-stopped"
environment:
- "FACTORIO_VERSION=latest"
- "RCON_PASS"
volumes:
@DirkHeinke
DirkHeinke / docker-registry-list.sh
Created February 23, 2017 23:45
This script shows all repositories (images) from a docker registry (v2) with token auth (e.g. portus). Needs jq in the same folder.
TOKEN=$(curl --silent -u dirk:xxx https://portus.example.com/v2/token\?service\=docker.example.com\&scope\=registry:catalog:\* | ./jq -r .token)
curl --silent -H "Authorization: Bearer $TOKEN" https://docker.example.com/v2/_catalog | ./jq
@DirkHeinke
DirkHeinke / ssh-copy-id-root.sh
Last active June 6, 2016 14:34
Append your id_rsa.pub to the authorized_keys of the root user via sudo.
echo "Remote Server (e.g. example.com)"
read remote_server
# test if login already possible
ssh -q -o ConnectTimeout=3 -o PasswordAuthentication=no root@$remote_server echo "" > /dev/null
if [ $? -eq 0 ]
then
echo "You can already login!"
exit
fi
@DirkHeinke
DirkHeinke / gist:dfc14c8f0552212f1693
Last active August 21, 2021 14:05
gstreamer to twitch
# with sound and file
gst-launch-1.0 uridecodebin uri=file:///home/dirk/Videos/Clouds_67_Timelapse.mp4 ! video/x-raw,width=1280,height=720 ! queue ! x264enc threads=0 bitrate=400 tune=zerolatency key-int-max=30 ! queue ! flvmux name=flvmux ! queue ! rtmpsink location=rtmp://live-fra.twitch.tv/app/$APIKEY audiotestsrc ! faac ! flvmux.
@DirkHeinke
DirkHeinke / commands.conf
Created August 21, 2015 14:57
icinga2 slack
object NotificationCommand "slack-overlayr-host-notification" {
import "plugin-notification-command"
command = [ "/usr/local/bin/slack_nagios.pl" ]
arguments = {
"-field" = "slack_channel=#general"
}
env = {
ICINGA_HOSTALIAS = "$host.display_name$"
@DirkHeinke
DirkHeinke / xmobarrc
Created March 8, 2015 11:26
My xmonad config
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = BottomW L 100
, commands = [ Run Weather "EDDE" ["-t"," <tempC>C","-L","0","-H","30","--normal","green","--high","red","--low","lightblue"] 36000
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Date "%a %b %_d %H:%M" "date" 10
, Run StdinReader
]
@DirkHeinke
DirkHeinke / setup
Last active August 29, 2015 14:16
basic icinga2 on debian wheezy
wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add -
echo 'deb http://debmon.org/debmon debmon-wheezy main' >/etc/apt/sources.list.d/debmon.list
apt-get update
apt-get install -y icinga2 mysql-server mysql-client icinga2-ido-mysql apache2 git php5 libapache2-mod-php5 php5-mysql php5-intl php5-gd php5-imagick
icinga2 feature enable ido-mysql command
service icinga2 restart