Skip to content

Instantly share code, notes, and snippets.

View sgdc3's full-sized avatar

Gabriele C. sgdc3

View GitHub Profile
@sgdc3
sgdc3 / restream.sh
Last active September 21, 2022 03:09
Restream: a simple bash script to split an rtmp video stream by using ffmpeg.
#!/bin/bash
LISTEN_URL='rtmp://0.0.0.0:5555'
# Youtube stream
YT_URL='rtmp://a.rtmp.youtube.com/live2'
YT_VIDEO_ARGS='-c:v copy'
YT_AUDIO_ARGS='-c:a copy'
# Keys
@mnebuerquo
mnebuerquo / kill-idle-vnc.sh
Created June 24, 2016 11:46
place in /etc/cron.hourly and it will kill any idle vnc sessions
#!/bin/bash
# http://serverfault.com/a/767361/33170
displays=`ps aux | grep Xvnc | grep -v 'grep\|sed' | sed -r 's|.*(Xvnc :[0-9]*).*|\1|' | cut -d' ' -f 2`
limit=30
date
echo "Checking for inactive sessions!"
while read -r d; do