This file contains hidden or 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 | |
## 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' |
This file contains hidden or 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
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: |
This file contains hidden or 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
#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, |
This file contains hidden or 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
# 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): |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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) |
This file contains hidden or 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 | |
# 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: |