Skip to content

Instantly share code, notes, and snippets.

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

Language as Fixed Point
... test ...

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@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
#! /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 / 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
# 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
# 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-\'
@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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.