Skip to content

Instantly share code, notes, and snippets.

@esurdam
esurdam / gist:8ef712e8e74f2f539c8f99a6233cbd1b
Created September 21, 2024 09:12 — forked from ShipkaChalk/gist:629fdc42dad781776d2007fc502188f3
Plex Hetzner workaround using Docker.

Hey, here is how you can route all plex traffic via wireguard out of another VPS, this can be used for any container but was inspired by the recent Hetzner block Plex put in place.

And no not all of us are using it for nefarious means, sometimes people don't have room for a home server.

Why docker? I prefer it as it keeps items separated and cleaned. It also allows for quickly moving configurations around from server to server if need be.

  1. Get yourself a VPS. ( If your VPS has a built in firewall like IONOS (but don't use Ionos), then you need to allow through the ports specified in the VPS docker compose)
  2. Install docker ( Do not use snap, follow their offical directions otherwise you may have docker related issues. )
  3. Create this docker-compose.yml
@esurdam
esurdam / install-ffmpeg-amazon-linux.sh
Last active May 25, 2019 04:35 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@esurdam
esurdam / nginx.default.conf
Last active May 19, 2017 01:41 — forked from sumardi/nginx.default.conf
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php70-fpm
# Install PHP extensions
sudo yum install -y php70-devel php70-mysql php70-pdo \
php70-pear php70-mbstring php70-cli php70-odbc \
@esurdam
esurdam / bm.rb
Created December 21, 2016 23:38 — forked from thejefflarson/bm.rb
poor man's benchmark
def measure
t = Time.now
yield
puts Time.now - t
end
@esurdam
esurdam / work
Last active September 14, 2016 04:09
py.py
output = popen("/usr/local/bin/ffprobe -v error -show_format -show_streams %s" % self._audio).read()
for spec in {'sample_rate', 'channels'}:
eval(u'{0:s} = popen("echo "{0:s}" | grep {0:s}).read().replace("{0:s}=", "").rstrip("\n")'.format(spec))
# sample_rate = popen("echo \"%s\" | grep sample_rate" % output).read().replace("sample_rate=", "").rstrip('\n')
# channels = popen("echo \"%s\" | grep channels" % output).read().replace("channels=", "").rstrip('\n')
if int(sample_rate) > 16000 or int(channels) > 1:
filename, extension = self._audio.split('.')
output_file = ".%s_mono.%s" % (filename, extension)
@esurdam
esurdam / runner.py
Last active September 4, 2016 03:50
sample
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from facebookads.objects import (
AdUser,
@esurdam
esurdam / MIU.agda
Created August 3, 2016 02:05 — forked from gergoerdi/MIU.agda
The "MI to MU" puzzle from GEB
module MIU where
data Symbol : Set where
I : Symbol
U : Symbol
open import Data.List
Word : Set
Word = List Symbol
@esurdam
esurdam / MIU.agda
Created August 3, 2016 02:05 — forked from gergoerdi/MIU.agda
The "MI to MU" puzzle from GEB
module MIU where
data Symbol : Set where
I : Symbol
U : Symbol
open import Data.List
Word : Set
Word = List Symbol
@esurdam
esurdam / cache_class_methods.rb
Last active July 26, 2016 09:42
Magic Sauce Caching ;)
module CacheClassMethods
def has_serializer
if self.instance_eval "Object.const_defined? #{self.class.name}Serializer.to_s"
self.instance_eval "#{self.class.name}Serializer"
end
end
def hash_key(source = nil)
"#{self.class.name.to_s.downcase}:#{source.to_s.downcase}"
@esurdam
esurdam / awslogs.conf
Last active January 12, 2018 09:18
AWSlogs config file
[general]
state_file = /var/lib/awslogs/agent-state
[messsages]
datetime_format = %b %d %H:%M:%S
file = /var/log/messages
buffer_duration = 5000
log_stream_name = {hostname} - {instance_id}
initial_position = start_of_file
log_group_name = messages