Skip to content

Instantly share code, notes, and snippets.

@virtuald
virtuald / README.md
Last active October 1, 2016 19:46
Concept Map playlist visualization generated by Exaile 3.4 beta3

At work, I've been playing a little bit with visualization of data. After hours, I DJ at local Lindy Hop dance events, and it occurred to me recently that it could be interesting to visualize my playlists to understand more about what I actually played. Using Exaile, I'm able to easily add a lot of metadata to the tracks in my collection, and its plugin framework made it easy to take that data and do something interesting with it.

From that initial investigation, I've built in a playlist visualization templating engine plugin for Exaile that can do some very simple visualization stuff, and I'm planning on extending the types of things I can do with it. Here's an interesting one I created from a recent playlist. This visualization was inspired by The Concept Map, except the source code for this isn't minified. :)

The HTML/js was generated by Exaile 3.4-beta3.

@virtuald
virtuald / Dockerfile
Created July 23, 2014 05:47
Docker bug with ENTRYPOINT and CMD
FROM dockerfile/python
ADD / /build
ENTRYPOINT ["/build/foo.py"]
# output: args ['/build/foo.py', 'bash']
# None of these work as expected either
#CMD ['arg1']
#!/usr/bin/env python
from tornado import gen
from tornado.ioloop import IOLoop
from tornado import stack_context
import traceback
def broken(arg1, callback):
#!/usr/bin/env python
from tornado import gen
from tornado.ioloop import IOLoop
@gen.coroutine
def exception_gets_lost():
print 'got here'
@virtuald
virtuald / sshpass.py
Created December 20, 2014 19:49
Simple python wrapper to give SSH a password for automation purposes (with output capture)
#!/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
@virtuald
virtuald / robot.py
Created February 15, 2015 00:50
Command sample that works
import wpilib
from wpilib.buttons import JoystickButton
from wpilib.command import Command, CommandGroup, Scheduler
class DoTheThing(Command):
def __init__(self, robot):
super().__init__()
self.robot = robot
@virtuald
virtuald / README.md
Last active March 24, 2016 04:38
FRC mjpg-streamer scripts

NOTE: These scripts are obsolete, you should use the mjpg-streamer.ipk file published at https://github.com/robotpy/roborio-packages instead.


mjpg-streamer scripts for RoboRIO

This was very quickly put together... so not quite as polished as I would normally like. :)

We used these scripts to run two camera servers on our roboRIO. Very little CPU usage as far as we can see. Only tested with the Microsoft LifeCam 3000 cameras.

@virtuald
virtuald / index.html
Created April 28, 2015 04:35
Concept for jQuery extensions for pynetworktables2js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<!-- This starts the NetworkTables websocket, it can be accessed from multiple
pages simultaneously -->
<script src="/networktables/networktables.js"></script>
@virtuald
virtuald / debug.log
Last active August 29, 2015 14:22
GStreamer deadlock
0:00:00.000044940 24400 0xd5e720 INFO GST_INIT gst.c:499:init_pre: Initializing GStreamer Core Library version 1.4.5
0:00:00.000090481 24400 0xd5e720 INFO GST_INIT gst.c:500:init_pre: Using library installed in /usr/lib64
0:00:00.000100859 24400 0xd5e720 INFO GST_INIT gst.c:511:init_pre: Linux localhost.localdomain 3.19.3-200.fc21.x86_64 #1 SMP Thu Mar 26 21:39:42 UTC 2015 x86_64
0:00:00.000254496 24400 0xd5e720 INFO GST_INIT gstmessage.c:119:_priv_gst_message_initialize: init messages
0:00:00.000601084 24400 0xd5e720 INFO GST_INIT gstcontext.c:77:_priv_gst_context_initialize: init contexts
0:00:00.000787706 24400 0xd5e720 INFO GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000865813 24400 0xd5e720 INFO GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.000876420 24400
#
# 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.