Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
! we use the Caps_Lock and Return keys for both space and carriage return
! unshifted is space, shifted is carriage return (fortunately, neither has
! a shifted meaning on a normal keyboard)
! space bar
keycode 65 = Mode_switch
! caps lock key
keycode 66 = space space Return Return
! Return key
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import openfst
from scipy.ndimage import measurements,filters
from collections import defaultdict
from pylab import *
import unicodedata
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmbdev
tmbdev / gist:aa444af92091b9f9211f
Created July 29, 2015 23:45
installing latexsuite on Ubuntu
sudo apt-get install vim-latexsuite
vim-addons install latex-suite
# A tmux configuration file with some smallish modifications that make it work better
# for Emacs users. Main difference is that the escape key is C-\ instead of C-b
set-option -g prefix 'C-\'
unbind C-b
unbind r
bind r source-file ~/.tmux.conf
set-option -g mouse-select-pane on
set-option -g mode-mouse off
set-option -g mode-keys emacs
unbind 'C-\'
# This goes into ~/.vnc/xstartup
# You need packages: tightvncserver, xtightvncviewer, and icewm
# Start Server: tightvncviewer -geometry 1440x900 :1
# Set Password: vncpasswd
# Start Viewer: xtightvncviewer :1
# Start Viewer (ssh): xtightvncviewer -encodings tight -via host.with.vnc.server localhost:1
# make this file executable
# these help with Emacs
@tmbdev
tmbdev / webcam.sh
Created December 29, 2014 05:27
simple webcam server in Shell
#!/bin/bash
port=8899
send_header() {
cat <<EOF
HTTP/1.0 200 OK
Content-Type: image/jpeg
Refresh: 10
Connection: Close
#! /bin/sh
### Must have Gcloud sdk installed and configured
###Create a micro instance as ansible master
gcloud compute --project "civil-topic-622" instances create "ansible" --zone "us-central1-b" --machine-type "f1-micro" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --no-boot-disk-auto-delete
###or a centos like in the tutorial
gcloud compute --project "civil-topic-622" instances create "ansible-master" --zone "us-central1-b" --machine-type "g1-small" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/userinfo.email" "https://www.googleapis.com/auth/compute" "https://www.googleapis.com/auth/devstorage.full_control" --tags "http-server" "https-server" --image "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20140926" --no-boot-disk
@tmbdev
tmbdev / usb0
Created June 13, 2013 10:00
Use expect to connect to a serial port (e.g., for Arduino)
#!/usr/bin/expect -f
# device
set modem /dev/ttyUSB0
# keep it open
exec sh -c "sleep 3 < $modem" &
# serial port parameters
exec stty -F $modem 9600 raw -clocal -echo -istrip -hup