This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Usage: | |
# | |
# capture-audio.sh [ffmpeg args] | |
# | |
function get_default_sink_or_source() { | |
SINK_OR_SOURCE=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test -f JSON.sh || curl -O https://raw.githubusercontent.com/dominictarr/JSON.sh/master/JSON.sh | |
eval $(sed 's/^/MY_/' build.info) | |
ORIG_LAUNCH_CONFIG=$(cat my-app-service.json | bash ./JSON.sh | grep -F '["launchConfig"]' | sed -e 's/[^{]*//') | |
NEW_LAUNGH_CONFIG=$(echo $ORIG_LAUNCH_CONFIG |\ | |
sed "s/\(\"imageUuid\"\):\"[^\"]*\"/\1:\"docker:my-image:${MY_BUILD_NUMBER}\"/") | |
echo $NEW_LAUNGH_CONFIG |\ | |
xargs -d\\n -i_-_ curl -v -u "RANCHER_KEY:RANCHER_SECRET" \ | |
-X POST -H 'Content-Type: application/json' \ | |
-d '{"inServiceStrategy":{"launchConfig": _-_ }}' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -ti \ | |
--device=/dev/snd/controlC0 --device=/dev/snd/pcmC0D0p --device=/dev/sndpcmC0D1p --device=/dev/snd/timer \ | |
-p 4713:4713 \ | |
rpi-deb-pulse \ | |
/bin/bash -c "groupadd --gid $(ls -l /dev/snd/controlC0 | cut -d' ' -f4 | xargs getent group | cut -d: -f3) alsadev \ | |
&& gpasswd -a pulse alsadev \ | |
&& pulseaudio --system --high-priority --no-cpu-limit -v \ | |
-L 'module-alsa-sink device=hw:0,0' \ | |
-L 'module-native-protocol-tcp auth-ip-acl=10.2.0.0/24'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# vzdump hook script that handles mounting of [Hetzner] backup space | |
# [over SFTP] and then mounting an FS image stored there. | |
# After backup is done backup image is remounted to ensure data synced. | |
# Relies on /etc/fstab entries for backup mount points and pub key auth | |
# for SFTP. | |
# | |
# Corresponding fstab enties: | |
# [email protected]: /mnt/backup-space fuse.sshfs defaults,noauto,allow_root,_netdev 0 0 | |
# /mnt/backup-space/image /mnt/backup ext4 noauto,defaults,loop 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import dbus | |
import os | |
remote_bus = dbus.SessionBus() | |
out_connection = remote_bus.get_object('com.Skype.API', '/com/Skype') | |
out_connection.Invoke('NAME SkypeToggler') | |
out_connection.Invoke('PROTOCOL 5') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import sys | |
import traceback | |
import re | |
import dbus | |
import dbus.service | |
#for event loop | |
import gobject | |
from dbus.mainloop.glib import DBusGMainLoop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Net::DBus; | |
my $session = Net::DBus->session; | |
my $service = $session->get_service('com.Skype.API'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -name '*.java' | \ | |
while read f; do \ | |
target=$(grep '^package ' $f | sed -e 's/package \+//' -e 's/;$//' -e 's/\./\//g'); \ | |
newf="src/main/java/${target}/$(basename $f)"; \ | |
mkdir -p $(dirname $newf); \ | |
git mv $f $newf; \ | |
chmod 644 $newf; \ | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/a/12048161/679052 | |
$ git remote add Bar /path/to/bar | |
$ git merge -s ours --no-commit Bar/master | |
$ git read-tree --prefix=public/bar -u Bar/master:www/tools/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./*/src/main/java/ -type f ! -name *.java | xargs -n 1 -P 1 -I{} bash -c "newdir=\$(echo \"\$(dirname {})\" | sed 's/src\/main\/java/src\/main\/resources/'); mkdir -p \$newdir; git mv {} \$newdir" |