Skip to content

Instantly share code, notes, and snippets.

View schlomo's full-sized avatar

Schlomo Schapiro schlomo

View GitHub Profile
@schlomo
schlomo / video_converter
Last active April 13, 2018 10:46
Convert videos to MP4 with HandBrake (http://handbrake.fr)
#!/bin/bash
#
# 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
schlomo / deployment.yaml
Last active March 22, 2018 15:53
Files for demo of Kubernetes: Shifting the mindset from servers to containers talk
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
labels:
app: webdav
name: webdav
spec:
replicas: 1
revisionHistoryLimit: 0
@schlomo
schlomo / DEB Repo Management
Last active March 12, 2018 17:19
Create and maintain a DEB repo with reprepro Support GPG signing and waiting for DropBox sync. Autoconfiguration from conf/distributions
Some scripts to help with DEB Repo Management.
See http://blog.schlomo.schapiro.org/2013/04/how-to-create-debianubuntu-repository.html for how to use this.
@schlomo
schlomo / rsh_with_remote_exit_code.sh
Last active February 20, 2018 11:13
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 http://www.gnu.org/licenses/gpl.html for full text
#
function rsh {
local res=$(
@schlomo
schlomo / ...README.md
Last active July 21, 2017 14:30
Demo for UI testing with selenium based on Zalenium, see http://blog.schlomo.schapiro.org/2017/07/web-ui-testing-made-easy-with-zalenium.html for details
@schlomo
schlomo / LICENSE.txt
Last active June 9, 2017 08:41
Simple daily cron job as Kubernetes container image. See http://blog.schlomo.schapiro.org/2017/06/using-kubernetes-with-multiple.html for details.
Copyright 2017 Schlomo Schapiro / Zalando SE
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE O
@schlomo
schlomo / Vagrantfile
Created May 2, 2017 19:45
Vagrantfile to show the autorelabel bug with centos/7 Vagrant images. See https://github.com/rear/rear-workshop-osbconf-2016/issues/4 and https://bugs.centos.org/view.php?id=13213
# BUG proof for VirtualBox vagrant with centos/7 failing to run autorelabel
#
# before starting install the reload plugin with: vagrant plugin install vagrant-reload
#
# see the bug: vagrant up
# destroy VM: vagrant destroy -f
# see the fix (disable serial console): FIX=1 vagrant up
#
# destroy VM: vagrant destroy -f
@schlomo
schlomo / aws_mfa.sh
Created September 18, 2014 09:03
Helper Bash function to set up temporary AWS credentials for MFA protected accounts.
function aws_mfa {
if [[ -z "$AWS_ACCESS_KEY_ID" ]] ; then
echo "Please set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY"
return 1
fi
if [[ -z "$REAL_AWS_ACCESS_KEY_ID" ]] ; then
REAL_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
REAL_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
fi
@schlomo
schlomo / amazon-id.conf
Created September 10, 2014 15:34
Amazon ID plugin for YUM. This will add 2 headers to the HTTP requests. With these headers the YUM repo server can identify the EC2 instance. These files come from the rh-amazon-rhui-client RPM package found on RHEL EC2 instances, probably part of the Red Hat Update Infrastructure (https://access.redhat.com/products/red-hat-update-infrastructure/)…
[main]
enabled=1

Keybase proof

I hereby claim:

  • I am schlomo on github.
  • I am schlomo (https://keybase.io/schlomo) on keybase.
  • I have a public key whose fingerprint is EAE2 A8B2 C84B 7F63 9914 C80E 6D97 452D AD64 9AF2

To claim this, I am signing this object: