Skip to content

Instantly share code, notes, and snippets.

@chrwei
chrwei / ds18.ino
Created May 4, 2017 00:46
esp8266 + 2 x ds12b20
#include <OneWire.h>
#include <DallasTemperature.h>
//pin definitions
const int pin1wire = D3;
//ds18b20 stuff
const int ds18Resolution = 12;
const int ds18count = 2;
DeviceAddress ds18addr[] = {
// action shot https://i.imgur.com/kpAiXTV.gifv
#include <Adafruit_NeoPixel.h>
#define N_LEDS 60
#define PIN 8
Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
void setup() {
Serial.begin(115200);
Serial1.begin(115200);
}
void loop() {
if(Serial.available()) {
Serial1.write(Serial.read());
}
if(Serial1.available()) {
var SerialPort = require("serialport").SerialPort
var serialPort = new SerialPort("/home/root/tty1", {
baudrate: 115200
});
var count = 0;
serialPort.on("open", function () {
console.log('open');
serialPort.on('data', function(data) {
/*
* Serial echo for verifying communication with a PC based program
* On Galileo or Edison this can talk to a process on the host
* if you setup socat to create some devices.
*/
//Galileo or Edison, setup ring buffer and TTYUARTClass
RingBuffer rx_buffer_S1;
TTYUARTClass mySerial(&rx_buffer_S1, 3, false);
/*
* Serial echo for verifying communication with a PC based program
* On Galileo or Edison this can talk to a process on the host
* if you setup socat to create some devices.
*/
#if defined(__ARDUINO_X86__)
//Galileo or Edison, setup ring buffer and TTYUARTClass
RingBuffer rx_buffer_S1;
TTYUARTClass mySerial(&rx_buffer_S1, 3, false);
@chrwei
chrwei / gist:42f8bbb687290b04b598
Last active January 27, 2020 03:21
How To install SCST on Ubutuntu 15.04 with in-tree kernel patches

These instructions are for SCST trunk as of 5/25/2015 and Ubuntu server 15.04 with 3.19.0-18-generic amd64 kernel. adjust paths as needed

SCST official site

commands all relative to the build dir of your choice and mostly dependent on the command above it

get latest SCST:

 svn co https://scst.svn.sourceforge.net/svnroot/scst/trunk scst

make kernel patch:

if ((Get-PSSnapin "VMware.VimAutomation.Core" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin "VMware.VimAutomation.Core"
}
Connect-VIServer 'vcenter'
$vmlist = @()
$vmlist += "vncproxy"
$vmlist += "vma"
#!/bin/bash
# our variables
BMOVL="/tmp/bmovl"
CTL="/tmp/ctl"
MYNICK="arsubs"
MYCHAN="#archreactor"
SUBFILE="/tmp/sub.tga"
# setup our sockets