- RPI4 - https://amzn.to/3LR1lFh
- (OR) odroid xu4 - https://amzn.to/3P5GoIo
- Alfa AC1900 WiFi Adapter - 1900 Mbps 802.11ac Long-Range Dual Band USB - https://amzn.to/3LU43to
- (optional) USB Ethernet Adapter - https://amzn.to/3vPjyNC
- (optional) Generic network switch - https://amzn.to/37sInpq
This file contains 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 wsl_shell | |
import simpleaudio as sa | |
import os | |
class GenerativeAudioService: | |
""" | |
Create and manage playback with text to speech audio files | |
""" |
This file contains 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
from bs4 import BeautifulSoup | |
import requests | |
import re | |
if __name__ == '__main__': | |
html = requests.get(r'https://news.ycombinator.com/item?id=37351667&p=1') | |
soup = BeautifulSoup(html.text,'html.parser') | |
all_spans = soup.find_all('span', class_='commtext') | |
for span in all_spans: | |
comment_content = span.text.strip() |
This file contains 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
public static async Task RecordAsync(Stream stream, string microphone, CancellationToken cancellationToken, Action<double> detectedSilenceCallback = null) | |
{ | |
// do this to get audio device with a mic | |
// ffmpeg -list_devices true -f dshow -i dummy | |
// pick one then add it to the audio device | |
// ffmpeg -f dshow -i audio="Microphone (HD Pro Webcam C920)" -ar 16000 output.wav | |
using var gracefulCts = new CancellationTokenSource(); | |
try | |
{ | |
// ffmpeg -f dshow -i audio="Microphone Array (Intel® Smart Sound Technology for Digital Microphones)" -ar 16000 -preset ultrafast -tune zerolatency -b 900k -f mpegts udp://127.0.0.1:9876 |
This file contains 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 shutil | |
import wmi | |
import os | |
from time import strftime, localtime | |
def copy(device_id): | |
""" Copy all files in camera directory to users directoy for human processing | |
""" | |
# bug only works for Windows | |
src = os.path.join(device_id, "\\", "DCIM", "100MSDCF") |
This file contains 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
const GPS = require("gps"); | |
const { SerialPort, ReadlineParser } = require('serialport') | |
const gps = new GPS; | |
// Use a `\r\n` as a line terminator | |
const parser = new ReadlineParser({ | |
delimiter: '\n', | |
}) | |
const port = new SerialPort({ |
This file contains 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
setInterval(function() { | |
// Define the parameters | |
var vpv = 18; // The solar panel's output voltage | |
var ipv = 2; // The solar panel's output current | |
var vbat = 14.8; // The battery's voltage (4-series lithium polymer battery) | |
var ibat = 0; // The battery's current | |
var vmax = 20; // The maximum power voltage of the solar panel | |
var imax = 2.5; // The maximum power current of the solar panel | |
var max_vbat = 16.8; // Maximum voltage of the 4-series lithium polymer battery | |
var min_vbat = 12.0; // Minimum voltage of the 4-series lithium polymer battery |
This file contains 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
// I've used a lot of libs including the popular ones for dotnet such as NAudio but all seem to be overly complicated or not cross platform. | |
// 1. install ffplay on your platform. for Windows `choco install ffplay`. Debian `apt install ffmpeg`. | |
// 2. install nuget pkg `CliWrap` | |
// 3. send your audio stream to the method. | |
public static async Task PlayAsync(Stream stream, CancellationToken cancellationToken) | |
{ | |
var result = await Cli.Wrap("ffplay") | |
.WithStandardInputPipe(PipeSource.FromStream(stream)) | |
.WithArguments($"-autoexit -nodisp -hide_banner -loglevel error -fs -") |
This file contains 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
Rule1 on power1#state=1 do backlog RuleTimer2 30; counter1 +1 endon on Rules#Timer=2 do power1 off endon | |
Rule1 on | |
Timer1 {"Enable":1,"Time":"4:00","Window":15,"Days":"SMTWTFS","Repeat":1,"Output":1,"Action":1} | |
Timers on | |
Timezone -8 | |
PowerOnState 0 |
https://tasmota.github.io/docs/DS18x20/
Arp request every 60 secs.
SetOption41 60
Check every 60
TelePeriod 60
NewerOlder