Skip to content

Instantly share code, notes, and snippets.


Schlomo Schapiro schlomo

View GitHub Profile
schlomo / DEB Repo Management
Last active Mar 12, 2018
Create and maintain a DEB repo with reprepro Support GPG signing and waiting for DropBox sync. Autoconfiguration from conf/distributions
View DEB Repo Management
Some scripts to help with DEB Repo Management.
See for how to use this.
View ... SSH PKI Test Suite & Demo
Moved to
schlomo / video_converter
Last active Apr 13, 2018
Convert videos to MP4 with HandBrake (
View video_converter
# search for .m2ts, .mov, .mp4 files and convert them to .m4v files with HandBrake
# search in current dir or in files/folders given as args
if [[ "$*" == *--help* ]] ; then
cat <<EOF
Usage: $0 [path or file] ...
Convert all .m2ts, .mov, .mp4 videos in given paths or files
schlomo /
Last active Feb 20, 2018
rsh wrapper that correctly returns the exit code of the remote command, just like ssh does. This wrapper installs itself as rsh and calls the real rsh. Written for Bash.
# This rsh wrapper supports reporting the exit code of the remote program.
# Assumes that remote shell is Bash or compatible and that you don't call
# exit directly (that would yield a return 127 regardless of the remote
# exit code!)
# Written by Schlomo Schapiro @ ImmobilienScout24
# Licensed under the GNU General Public License, see for full text
function rsh {
local res=$(
schlomo / udp_stream_recorder.conf
Last active Jan 2, 2016
Simple Upstart Service to record incoming UDP streams into time-stamped files.
View udp_stream_recorder.conf
# Service definition for Upstart, put into /etc/init
description "Record TS stream from VGADVIRecorder"
start on started autofs
stop on stopping autofs
# who else will have access
umask 0000
schlomo /
Created Jan 15, 2014
Simple Video Tricks: Concatenate
# concatenate several SOURCE_CONCAT_FILE_NAMES files into a mp4
# FIRST_NAME and second argument are file names or parts of a filename. All files inbetween will be concatenated.
START="$1" ; shift
END="$1" ; shift
# find all input files
schlomo / sshrc
Last active Aug 29, 2015
SSH RC script that helps me with reconnected screen sessions and deploys my personal environment
View sshrc
# xauth handling, code adapted from sshd(8)
if type -p xauth >/dev/null && read proto cookie && [[ "$DISPLAY" ]]; then
if [[ "${DISPLAY:0:10}" = 'localhost:' ]] ; then
# X11UseLocalhost=yes
#echo add unix:"${DISPLAY:11}" $proto $cookie #### egrehm changed to :10 because seems to be broken on rhel6 and clones
echo add unix:"${DISPLAY:10}" $proto $cookie
# X11UseLocalhost=no
echo add "$DISPLAY" $proto $cookie
sed -i -f - /etc/ssh/sshd_config <<EOF
i # this content comes from the %{name}-%{version}-%{release} package
i AddressFamily inet
i Protocol 2
i LogLevel VERBOSE
i HostbasedAuthentication yes
i IgnoreUserKnownHosts yes
i IgnoreRhosts yes
i Banner /etc/ssh/banner.txt
schlomo /
Created May 2, 2014
Replace httpd.conf with list of includes
if ! echo '# HTTPD conf framework. Will be overwritten to this content on each install of the rpm package!!!
# This file is managed by %{name}-%{version}-%{release}
ServerRoot "/etc/httpd"
Include conf/basic/*.conf
Include conf/main/*.conf
Include conf/other/*.conf
' >/etc/httpd/conf/httpd.conf ; then
logger -p user.err -s -t %name -- "ERROR: Could not replace content of '/etc/httpd/conf/httpd.conf'"
schlomo /
Created May 15, 2014
XBMC automatically play all videos in a permanent loop. Ideal for video presentations, digital signage or party mode.
# See also
# Put this into the userdata folder, see for details where this is for each platform
import xbmc
You can’t perform that action at this time.