Skip to content

Instantly share code, notes, and snippets.

View chriswoodle's full-sized avatar
🌴
Work from beach!

Chris Woodle chriswoodle

🌴
Work from beach!
View GitHub Profile
# Setup pi (Raspbian Stretch Lite 2018-03-13)
sudo apt update -y
sudo apt upgrade -y
sudo apt autoremove -y
sudo apt install git -y
# Install Nodejs
cd ~
wget https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-armv6l.tar.xz
tar -xvf node*
#!/usr/bin/sudo bash
# This script finds, downloads and installs the latest version of nodejs for linux x64.
# This script is designed to be safe to rerun.
sudo -v
VERSION="$(wget -q -O- https://nodejs.org/dist/latest/ | \
grep -o -E "node-v[0-9]+\.[0-9]\.[0-9]-linux-x64" | \
head -n1)"
echo Installing $VERSION\.\.\.
wget -q https://nodejs.org/dist/latest/$VERSION\.tar\.gz -P /tmp
const input = process.argv[2];
const test = process.argv[3];
if (!input) {
console.log('Missing input and test string');
console.log('Usage: node minimum-edit-distance.js <input> <test>');
process.exit(1);
}
if (!test) {
console.log('Missing test string')
console.log('Usage: node minimum-edit-distance.js <input> <test>');
const { exec } = require('child_process');
const express = require('express');
const app = express();
const port = 3000
const commandVisible = 'echo "hello Visible!"'
const commandIR = 'echo "hello IR!"'
app.get('/visible', (req, res) => {
@chriswoodle
chriswoodle / cam.py
Created December 2, 2018 16:19
Runs pi cam and displays as video
# From https://stackoverflow.com/questions/27805077/display-io-stream-from-raspberry-pi-camera-as-video-in-pygame
import picamera
import pygame
import io
# Init pygame
pygame.init()
screen = pygame.display.set_mode((320,240))
# Init camera
# From https://learn.adafruit.com/adafruit-amg8833-8x8-thermal-camera-sensor/raspberry-pi-thermal-camera
import os
import math
import time
import busio
import board
import numpy as np
import pygame
@chriswoodle
chriswoodle / setup.sh
Created February 11, 2019 19:22
Dragonboard setup.sh
#!/bin/bash
sudo apt update -y
sudo apt upgrade -y
sudo apt remove nodejs -y
sudo apt autoremove -y
sudo apt install gedit nano -y
# install NodeJs
cd ~
wget https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-arm64.tar.gz
tar -xvf node-v8.9.4-linux-arm64.tar.gz
@chriswoodle
chriswoodle / hacknyu2019-arduino-turnstile.ino
Created February 17, 2019 06:55
hacknyu2019-arduino-turnstile
// Chris Woodle, HackNYU2019
// Send an 'S' to toggle a servo open and closed
// Refrences:
// https://www.arduino.cc/en/tutorial/sweep
// https://www.arduino.cc/en/serial/read
const char SIGNAL = 'S';
#include <Servo.h>
@chriswoodle
chriswoodle / specgram_nist.m
Last active March 12, 2019 07:42
ECE 5526, HW1 For problem 2
function [th] = specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee)
%
% specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee)
%
% function to compute a spectrogram
%
% winlgh = window length in samples - 400
% framerate = frame rate in num frames per second - 200
% sampling_rate = samples/sec - 16000
% wavedir = directory of the nist files - 'd:/TIMIT/TRAIN/DR1/MCPM0'
@chriswoodle
chriswoodle / specgram_nist.m
Last active March 12, 2019 07:42
ECE 5526HW1 For Problem 3
function [th] = specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee)
%
% specgram_nist(winlgh, framerate, sampling_rate, wavedir, nist_file, ieee)
%
% function to compute a spectrogram
%
% winlgh = window length in samples - 400
% framerate = frame rate in num frames per second - 200
% sampling_rate = samples/sec - 16000
% wavedir = directory of the nist files - 'd:/TIMIT/TRAIN/DR1/MCPM0'