Skip to content

Instantly share code, notes, and snippets.

@MaZderMind
MaZderMind / iptables.sh
Created July 22, 2017 00:13
iptables-rules, komptatibel mit kubernetes, zur Verwendung in der rc.local
for iptables in iptables; do
$iptables -A FORWARD -j ACCEPT
$iptables -F INPUT
$iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
$iptables -A INPUT -i lo -j ACCEPT
$iptables -A INPUT -p tcp --sport 1024:65535 --dport 22 -j ACCEPT -m comment --comment "allow ssh"
$iptables -A INPUT -p udp --sport 1024:65535 --dport 60000:60099 -j ACCEPT -m comment --comment "allow mosh"
$iptables -A INPUT -p tcp --sport 1024:65535 --dport 80 -j ACCEPT -m comment --comment "allow http"
#!/bin/sh
ffmpeg -y -v info -i /video/intros/SM//1337.ts -analyzeduration 20000000 -ss 64.04 -t 657.36 -i /video/fuse//play/3OG/1337/uncut.ts -analyzeduration 20000000 -i /video/intros/SM/outro.ts -filter_complex '[0:v:0] [0:v:0] [0:a:0] [1:v:0] [1:v:1] [1:a:0] [2:v:0] [2:v:0] [2:a:0] concat=n=3:v=2:a=1 [vd0] [vd1] [audio0_mix]; [vd0] hqdn3d [v0]; [vd1] hqdn3d [v1]' -analyzeduration 20000000 -map '[v0]' -map '[v1]' -c:v libx264 -pix_fmt:v yuv420p -crf:v 23 -profile:v high -level:v 4.1 -map '[audio0_mix]' -c:a:0 libfdk_aac -b:a:0 192k -ar:a:0 48000 -aspect 16:9 -movflags faststart -f mp4 /video/tmp/SM//1337-hd.mp4
@MaZderMind
MaZderMind / generate-multichannel-audio-testfile.sh
Created December 24, 2017 23:23
Generate a 4-track-stereo-testfile which helps to distinctively check audio channel mapping.
#!/bin/sh
# Generate a 4-track-stereo-testfile which helps to distinctively check audio channel mapping.
# Each stereo-pair contains the same phase-correct frequency on each ear
# (increasing frequency from lower to higher pairs), with brown noise overlayed
# on the right ear.
#
# When channels are swapped, the frequency on the left and on the right ear
# don't match which can be easily detected.
#
#!/bin/bash
ffmpeg -hide_banner -y -nostdin -f decklink -list_devices 1 -i dummy 2>&1 | head -n -1 | tail -n +2 | cut -c 31- | cut -c -1 | while read device; do
ffmpeg -hide_banner -y -nostdin -f decklink -list_formats 1 -i $device 2>&1 | head -n -1 | tail -n +4 | cut -c 2- | cut -f1 -d' ' | while read mode; do
for plug in sdi hdmi; do
desc="$device@$mode on $plug"
echo "-> /tmp/$desc.png"
ffmpeg -v warning -hide_banner -y -nostdin -f decklink -video_input $plug -format_code $mode\
-i "$device" \
-ss 1 -vframes 1 \
@MaZderMind
MaZderMind / example.cpp
Created March 4, 2018 20:15
Ideas of how the DMX-Processiung might be programed
#include <DmxProxy.h>
PmxProxy dmxProxy(processing_function);
void setup() {
}
boolean processing_function(DmxFrame* in, DmxFrame *out)
{
@MaZderMind
MaZderMind / 18-videos-hd.sh
Created March 7, 2018 21:31
18-videos-hd.sh
#!/bin/sh
gst-launch-1.0 \
videotestsrc pattern=ball foreground-color=0x00ff0000 ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x00ffff00 ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x0000ff00 ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
\
videotestsrc pattern=ball foreground-color=0x0000ffff ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x000000ff ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x00ff00ff ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
\
.ghx-issue-content {
position: relative;
}
.ghx-plan-extra-fields.ghx-row {
height: 0;
margin: 0
}
.ghx-plan-extra-fields .ghx-extra-field {
position: absolute;
top: 6px;
@MaZderMind
MaZderMind / backup-github-locally.sh
Created June 4, 2018 14:01
backup-github-locally.sh
#!/bin/bash
set -xe
source /bulk/data/Drittsysteme/_env.sh
DIR="$BASEDIR/github"
NAMES_TMP=/tmp/github-repo-names.tmp
NAMES=/tmp/github-repo-names
PAGE=1
rm -f $NAMES
while true;
@MaZderMind
MaZderMind / AnnotationUtil.java
Last active July 23, 2018 19:16
A Variant of the AuthenticationPrincipalArgumentResolver which injects an AuthenticationPrincipal merged into the correct EntityManager
package net.seibertmedia.team-rocket.someproject.configuration.mergedAuthenticationPrincipal;
import java.lang.annotation.Annotation;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.AnnotationUtils;
public class AnnotationUtil {
private AnnotationUtil() {
}
@MaZderMind
MaZderMind / carlmix.py
Created November 28, 2018 21:31
quick and dirty gstreamer videomixer, switching between 1 of 20 sources
#!/usr/bin/env python3
import logging
import random
import signal
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')