Skip to content

Instantly share code, notes, and snippets.

View dansteingart's full-sized avatar

Dan Steingart dansteingart

View GitHub Profile
#!/bin/bash
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
[[ "$devname" == "bus/"* ]] && exit
eval "$(udevadm info -q property --export -p $syspath)"
[[ -z "$ID_SERIAL" ]] && exit
#!/bin/bash
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
[[ "$devname" == "bus/"* ]] && exit
eval "$(udevadm info -q property --export -p $syspath)"
[[ -z "$ID_SERIAL" ]] && exit
@dansteingart
dansteingart / libkeithley.py
Created September 29, 2022 14:36
simple nodeforwarderded 2400 control
##Author:
##Date Started:
##Notes:
from time import *
import pandas as pd
import requests as req
import re
@dansteingart
dansteingart / install_ustreamer_systemd.sh
Created August 24, 2022 15:07
Install ustreamer as system service (port 9001, exposed)
#! /bin/bash
#first make start sh's
#ustreamer
echo "#!/bin/bash
./ustreamer -p 9001 -s 0.0.0.0" > ustart.sh
echo "[Unit]
Description=ustreamer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am dansteingart on github.
  • I am steingart (https://keybase.io/steingart) on keybase.
  • I have a public key ASC_Q64zAvx1GtTeV8iI5wXKqNrwBV9IA1pzdRNc1eZN0Qo

To claim this, I am signing this object:

@dansteingart
dansteingart / get_close_time.py
Created November 18, 2016 19:51
get_close_time.py
##Author:
##Date Started:
##Notes:
from pithy import *
import libMotorPhoton as lmp
from datetime import datetime as dt
import time
photon = lmp.motorPhoton("MischievousMelon")
@dansteingart
dansteingart / control.py
Created July 1, 2015 14:53
basic ardustat control in python / connect to nodeforwarder
from urllib import urlopen as uo
from time import *
url = "http://localhost:8888" #replace with whatever your port is
def read():
uo(url+"/write/s0000").read()
sleep(.1)
incoming = uo(url+"/read/").read()
return incoming.split("GO,")[-1].split(",ST")[0]
@dansteingart
dansteingart / nodeforwarder.js
Last active August 29, 2015 14:22
Nodeforwarder
/*
NodeForwader: an serial to http proxy driven by ghetto get calls
requirements
-- serialport -> npm install serialport
-- express -> npm install express
-- sleep -> npm install sleep
-- socket.io -> npm install socket.io
-- cors -> npm install cors
to start: node nodeforwader.js [HTTP PORT] [SERIAL PORT] [BAUD] [BUFFER LENGTH]
@dansteingart
dansteingart / quiner.py
Last active August 29, 2015 14:08
An attempt to have a "rational" whos() (ala matlab)
import __main__
def whos(lss):
fil = __main__.__file__
thisthinghere = open(fil).read().split("\n")
vs = []
for l in thisthinghere:
if l.find("=") > -1:
vs.append(l.split("=")[0].strip())
keys = lss.keys()
out = {}