View getopts.sh
#!/bin/bash | |
###################################################################### | |
#This is an example of using getopts in Bash. It also contains some | |
#other bits of code I find useful. | |
#Author: Linerd | |
#Website: http://tuxtweaks.com/ | |
#Copyright 2014 | |
#License: Creative Commons Attribution-ShareAlike 4.0 | |
#http://creativecommons.org/licenses/by-sa/4.0/legalcode |
View gpio.java
public class GPIO { | |
public String port; | |
public int pin; | |
//get direction of gpio | |
public String getInOut() | |
{ | |
String command = String.format("cat /sys/class/gpio/%s/direction",this.port); | |
try { |
View arducam_trigger.py
import cv2 | |
import numpy as np | |
from datetime import datetime | |
import array | |
import fcntl | |
import os | |
import argparse | |
from utils import ArducamUtils | |
import Jetson.GPIO as GPIO | |
from time import sleep |
View m5cam.yaml
esphome: | |
name: m5cam | |
platform: ESP32 | |
board: m5stack-core-esp32 | |
wifi: | |
ssid: "ssid" | |
password: "password" | |
# Enable logging |
View boot.py
# boot.py | |
# Set Circuit Playground Express flash chip to program writeable | |
# If toggle switch is right, | |
# flash is program writeable and file access is frozen | |
# If toggle switch is left, | |
# flash chip file access ok, file writes give an error | |
# via Dan Conley | |
# https://learn.adafruit.com/cpu-temperature-logging-with-circuit-python/ | |
# writing-to-the-filesystem | |
# 2018 Mike Barela for Getting Started with Circuit Playground Express |
View covid-19.service
[Unit] | |
Description=COVID-19 Tracker Service | |
After=multi-user.target | |
[Service] | |
User=pi | |
Type=simple | |
WorkingDirectory=/home/pi/CovidTracker | |
ExecStart=/usr/bin/python3 /home/pi/CovidTracker/main.py --update 3600 | |
Restart=on-failure |
View .bash_aliases
alias update='sudo apt update && sudo apt dist-upgrade -y --auto-remove' | |
alias adb_camera='adb shell am start -a android.media.action.IMAGE_CAPTURE' | |
alias adb_launch='adb shell am start -a android.intent.action.MAIN ' | |
alias adb_brightness='adb shell am broadcast -a com.enhancedworld.devicemanager.SET_BRIGHTNESS --ei com.enhancedworld.devicemanager.extra.LEVEL ' | |
alias adb_flash_boot='adb remount; adb sync; adb reboot bootloader; fastboot flash boot $OUT/boot.img; fastboot reboot' | |
alias adb_peripherals='adb shell dumpsys com.google.android.things.pio.IPeripheralManager' | |
alias cat='bat --theme zenburn' | |
alias ping='prettyping --nolegend' | |
alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules" | |
alias grep="grep -n -I --color" |
View init.lua
-- | |
-- Simple object avoider robot using the ESP8266/Nodemcu ESP-12 | |
-- Using a L9110s h-bridge and an hc-sr04 with a 1k resistor | |
-- on the ECHO pin. | |
-- | |
-- The current ESP only allows for 3 active pwms at any one time. | |
-- We get around this by the fact we only need 2 at any time. Each | |
-- direction change resets them pins used as pwm. | |
-- | |
-- Written by Scott Beasley 2015 |
View jupyter_lab.service
[Unit] | |
Description=Jupyter Notebook Service | |
[Service] | |
Type=simple | |
User=user | |
ExecStart=/bin/sh -c "jupyter lab --ip=0.0.0.0 --no-browser" | |
WorkingDirectory=/home/user | |
Restart=always |
View OscScreenGrabLAN.py
#!/usr/bin/env python3 | |
"""Take screen captures from DS1000Z-series oscilloscopes | |
This program captures either the waveform or the whole screen of a Rigol | |
DS1000Z series oscilloscope, then saves it on the computer as a CSV, PNG | |
or BMP file. | |
The program uses the LXI protocol, so the computer must have a LAN | |
connection with the oscilloscope. | |
""" |
NewerOlder