This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tox] | |
requires = tox>=4.4.10 | |
isolated_build = true | |
pass_env = PWD | |
tox_root = {env:PWD} | |
env_list = | |
coverage | |
lint | |
test | |
type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from contextlib import contextmanager | |
from typing import Iterator | |
@contextmanager | |
def timeout(seconds: float = 5) -> Iterator: | |
""" | |
A simple context manager to enable timeouts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#assuming you have some script you want to run with cron | |
FROM ubuntu:latest | |
WORKDIR /app | |
COPY . . | |
RUN apt-get update | |
RUN apt-get install -y cron | |
RUN echo "* * * * * ./app/some-script" >> /etc/cron.d/app | |
RUN chmod 0644 /etc/cron.d/app | |
RUN crontab /etc/cron.d/app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import paramiko | |
import time | |
from streamlit.report_thread import add_report_ctx | |
from getpass import getpass | |
ip = input("Please enter IP address: ") | |
user = input("Username: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this sketch was brutally hacked together by TJ Bruno --- https://medium.com/@tbruno25 | |
#include <mcp_can.h> | |
#include <SPI.h> | |
unsigned long int rxId; | |
unsigned char len = 0; | |
unsigned char rxBuf[8]; | |
bool displayOnce; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() | |
{ | |
if (!digitalRead(2)) | |
{ | |
CAN0.readMsgBuf(&rxId, &len, rxBuf); | |
delay(5); | |
if ((rxId == buttonId) && (rxBuf == buttonData)) | |
{ | |
buttonPress++; | |
if (buttonPress == 1) |