Skip to content

Instantly share code, notes, and snippets.

Avatar

Schlomo Schapiro schlomo

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am schlomo on github.
  • I am schlomo (https://keybase.io/schlomo) on keybase.
  • I have a public key ASA9B4VcvlA8Bk1pvQvdH2iOwYXKcOLqKJBoOFvMYODqywo

To claim this, I am signing this object:

@schlomo
schlomo / aws-assume-role.sh
Last active Dec 15, 2020
Understanding AWS IAM Roles and useful scripts to assume a role. See http://blog.schlomo.schapiro.org/2017/06/understanding-iam-roles-in-amazon-aws.html for details.
View aws-assume-role.sh
#!/bin/bash -eu
die() { echo 1>&2 "ERROR: $*" ; exit 1 ; }
info() { echo 1>&2 "INFO: $*" ; }
test "${1:-}" || die "Usage: $0 <role-name | role ARN> [<role-name | role ARN> ...]"
while test "${1:-}" ; do
role="$1"
shift
View Dockerfile
# This is a demo for the problem in https://github.com/pleiszenburg/wenv/issues/14
#
# it builds yamlreader into an executable. First on Linux and then in wine.
#
# Building it in wine fails, I hope that this test case helps to extend wenv to support this sort of "cross building"
# to allow creating Windows executables from Python programs without actually running Windows, e.g. in a CI pipeline.
#
# Build like this: docker build .
#
# Optionally set the Pyhon version like this: docker build --build-arg PYTHONVERSION=3.8.1 .
@schlomo
schlomo / .gitignore
Last active Jun 25, 2020
Performance comparison between Iconify Inline SVG, Iconify Element and SVG Sprites.
View .gitignore
/node_modules
/.cache
/dist
@schlomo
schlomo / .gitignore
Last active Jun 21, 2020
Iconify.basic bug report
View .gitignore
/node_modules
/.cache
/dist
@schlomo
schlomo / grab.sh
Created Apr 20, 2020
video grabber script for PAL VHS video
View grab.sh
#!/bin/bash
#
# record from video grabber
VIDEO=${VIDEO:-/dev/video1}
AUDIO=${AUDIO:-hw:1}
AUDIO_RATE=48000
VIDEO_IN="-f video4linux2 -video_size 720x576 -thread_queue_size 1024 -framerate 25 -i $VIDEO -vsync 1"
AUDIO_IN="-f alsa -sample_rate $AUDIO_RATE -channels 2 -thread_queue_size 2048 -itsoffset 0.3 -i $AUDIO"
@schlomo
schlomo / autoexec.py
Created May 15, 2014
XBMC automatically play all videos in a permanent loop. Ideal for video presentations, digital signage or party mode.
View autoexec.py
# See also http://wiki.xbmc.org/index.php?title=Autoexec.py
# Put this into the userdata folder, see http://wiki.xbmc.org/index.php?title=Userdata for details where this is for each platform
import xbmc
xbmc.executebuiltin('xbmc.PlayMedia("/storage/videos/","isdir")')
xbmc.executebuiltin('xbmc.PlayerControl(repeatall)')
xbmc.executebuiltin("Action(Fullscreen)")
View test.html
<html>
<body>
<p>hello world</p>
</body>
</html>
<!-- licensed under the MIT -->
@schlomo
schlomo / video_converter
Last active Apr 13, 2018
Convert videos to MP4 with HandBrake (http://handbrake.fr)
View video_converter
#!/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 Mar 22, 2018
Files for demo of Kubernetes: Shifting the mindset from servers to containers talk
View deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
labels:
app: webdav
name: webdav
spec:
replicas: 1
revisionHistoryLimit: 0