Skip to content

Instantly share code, notes, and snippets.

View daanzu's full-sized avatar

David Zurow daanzu

View GitHub Profile
@daanzu
daanzu / run_finetune_tdnn_1a_daanzu.sh
Last active December 18, 2023 11:17
Kaldi Finetuning
# !/bin/bash
# Adapted from egs/aishell2/s5/local/nnet3/tuning/finetune_tdnn_1a.sh commit 42a673a5e7f201736dfbf2116e8eaa94745e5a5f
# This script uses weight transfer as a transfer learning method to transfer
# already trained neural net model to a finetune data set.
# Usage: /home/daanzu/kaldi_dirs/local/run_finetune_tdnn_1a_daanzu.sh --src-dir export/tdnn_f.1ep --num-epochs 5 --stage 1 --train-stage -10
# Required Inputs:
@daanzu
daanzu / blink1.py
Last active June 13, 2019 14:35
blink(1) driver utility class -- can use either a CLI util or a native USB HID driver
import subprocess
import time
import contextlib
class Blink1(object):
def __init__(self, args=None):
if not args: args = ['blink1-tool.exe', '-q']
self.args = args
self.color = (0,0,0)
@daanzu
daanzu / tv_rs232.py
Created June 6, 2016 06:53
Philips BDM4065UC tv/monitor RS232 control
# Philips BDM4065UC tv/monitor RS232 control
#
# Sabrent USB 2.0 to Serial (9-Pin) DB-9 RS-232 Adapter Cable 6ft Cable (FTDI Chipset) CB-FTDI: https://www.amazon.com/gp/product/B006AA04K0/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1
# SF Cable, DB9 Female to 3.5mm Serial Cable-6 Feet: https://www.amazon.com/gp/product/B004T9BBJC/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1
# Your Cable Store Serial Port 9 Pin Null Modem Adapter DB9 Male / Female RS232: https://www.amazon.com/gp/product/B005QE4YLQ/ref=oh_aui_detailpage_o07_s00?ie=UTF8&psc=1
# Artpot 2.5mm Male to 3.5mm Female Stereo Audio Jack Adapter Cable Black: https://www.amazon.com/gp/product/B00RLNA62Q/ref=oh_aui_detailpage_o08_s00?ie=UTF8&psc=1
import time, re
import traceback
@daanzu
daanzu / select_block.py
Last active April 24, 2016 02:39
Sublime Text plugin to select block at cursor, in various languages
# Sublime Text plugin to select block at cursor, in various languages
# https://gist.github.com/daanzu/4b0992715d461ded8b5f61fe776740d0
# view.run_command("select_block")
# view.settings().get('syntax')
import sublime, sublime_plugin
class SelectBlockCommand(sublime_plugin.TextCommand):
def run(self, edit):
@daanzu
daanzu / Python win32api virtual keystroke example
Last active December 1, 2015 04:03 — forked from chriskiehl/Vitual keystroke example
Python win32api simple Vitual keystroke example
#Giant dictonary to hold key name and VK value
VK_CODE = {'backspace':0x08,
'tab':0x09,
'clear':0x0C,
'enter':0x0D,
'shift':0x10,
'ctrl':0x11,
'alt':0x12,
'pause':0x13,
'caps_lock':0x14,
@daanzu
daanzu / throttle.py
Last active December 21, 2015 03:08 — forked from ChrisTM/throttle.py
Python decorator for throttling and ramping function calls.
from datetime import datetime, timedelta
from functools import wraps
class throttle(object):
"""
Decorator that prevents a function from being called more than once every
time period.
To create a function that cannot be called more than once a minute:
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'