Skip to content

Instantly share code, notes, and snippets.

@timfreund
timfreund / startrek.sh
Created May 3, 2018 16:40
Star Trek NG inspired white noise script
#!/usr/bin/env bash
play -c2 -n synth whitenoise band -n 100 24 band -n 300 100 gain +20 flanger
@timfreund
timfreund / labterm-demo.py
Created March 5, 2019 02:55
labterm-demo.py
import tornado.web
from tornado.ioloop import IOLoop
from terminado import TermSocket, SingleTermManager, UniqueTermManager
if __name__ == '__main__':
# term_manager = SingleTermManager(shell_command=['bash'])
term_manager = UniqueTermManager(shell_command=['/bin/login'])
handlers = [
(r"/websocket", TermSocket, {'term_manager': term_manager}),
(r"/()", tornado.web.StaticFileHandler, {'path':'index.html'}),
@timfreund
timfreund / cjs.js
Created May 6, 2019 18:25
Capture youtube views
function reportview(){
var length = $('.ytp-progress-bar')[0].getAttribute('aria-valuemax');
var title = $('h1.title')[0].innerText;
var payload = {};
payload['length'] = length;
payload['title'] = title;
jQuery.get("http://localhost:8000/youtube", payload);
}
setTimeout(reportview, 10000);
@timfreund
timfreund / democlient.py
Created April 26, 2025 17:59
pylxd demo script
from pylxd import Client
# change the following line and export it as an environment variable
# export REQUESTS_CA_BUNDLE=~/.config/incus/servercerts/YOURCLUSTER.crt
def create_instance(incus_client, name, image_alias):
iconfig = {'name': name,
'source': {'type': 'image',
'protocol':
'simplestreams',