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/env python3 | |
import os | |
import sys | |
_b = sys.version_info[0] < 3 and (lambda x:x) or (lambda x:x.encode('utf-8')) | |
def ssh_exec_pass(password, args, capture_output=False): | |
''' | |
Wrapper around openssh that allows you to send a password to |
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/env python | |
''' | |
Simple program that uses the 'bpmdetect' GStreamer plugin to detect | |
the BPM of a song, and outputs that to console. | |
Requires GStreamer 1.x, PyGObject 1.x, and gst-plugins-bad | |
Copyright (C) 2015 Dustin Spicuzza | |
This program is free software; you can redistribute it and/or modify |
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
# | |
# Playbin bug: Play 2 flac files (presumably of any length), and play | |
# 2 mp3 files, using gapless playback, and weirdness happens | |
# | |
# On GST 1.4.5, track4.mp3 stalls for ~10s or so without playing, but | |
# there is no audio for track3 or track4. Other tests I've conducted | |
# track3 does have audio, but there is still a pause. | |
# | |
# On GST 1.5.2, there is no volume for track3 or track4.mp3, but no | |
# stall occurs. Seems like a bug. |
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
''' | |
This is significantly derived from StackContext, Apache 2.0 license | |
''' | |
from tornado.stack_context import StackContextInconsistentError, _state | |
class ContextLocal(object): | |
''' | |
Implements a threadlocal-like mechanism that can be used to track data | |
across tornado asynchronous calls. This is very similar to (and based |
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
(function (riot, route) { | |
'use strict'; | |
// | |
// Modified version of the riot-router tags | |
// | |
// - Intended to be used recursively. You can even use multiple routers in a tag and they'll work | |
// - Each 'route' event receives the parent container, and any arguments that it would normally get | |
// - Child tags receive an attribute 'route_path' which contains the current routing | |
// - Adding a '/@@' to the end of a route allows the route to have subordinate routers |
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
package anyerr | |
// portions derived from golang context package, BSD license | |
import ( | |
"github.com/hashicorp/go-multierror" | |
"sync" | |
) | |
// closedchan is a reusable closed channel. |
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
$serverScript = <<-SCRIPT | |
sudo apt-get update | |
sudo apt-get -y install nfs-kernel-server | |
sudo mkdir -p /exports/share | |
sudo chown -R vagrant:vagrant /exports | |
echo "/exports 192.168.50.0/24(rw,fsid=0,no_subtree_check,sync,sec=sys)" > /etc/exports |
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
{ | |
"slow-forward": [ | |
[21.084223, 12.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], | |
[21.104242, 12.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], | |
[21.124327, 12.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], | |
[21.144219, 12.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], | |
[21.164237, 12.0, 0.001, 0.012, 0.012, 0.0, 0.0, 0.0, 0.0], | |
[21.184224, 12.0, 0.001, 0.012, 0.012, 0.0, 0.0, 0.0, 0.0], | |
[21.204217, 12.0, 0.002, 0.012, 0.012, 0.0, 0.0, 0.0, 0.0], | |
[21.224186, 12.0, 0.002, 0.024, 0.024, 0.0, 0.0, 0.0, 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
# | |
# monkeypatch to add 'globmatch' function to PurePath, which implements | |
# the same style of matching that glob supports (which is different | |
# from what match supports) | |
# | |
# Same license as pathlib2 (MIT license) | |
# | |
from __future__ import print_function | |
from pathlib2 import PurePath,PurePosixPath |
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
set clock timezone 0 | |
set vrouter trust-vr sharable | |
set vrouter "untrust-vr" | |
exit | |
set vrouter "trust-vr" | |
unset auto-route-export | |
exit | |
set service "TCP_123" protocol tcp src-port 0-65535 dst-port 123-123 | |
set auth-server "Local" id 0 | |
set auth-server "Local" server-name "Local" |
NewerOlder