This Gist is about how I use PyAudio, NumPy, and Matplotlib to plot freqency spectrum of system sound or microphone.
You can read this blog post for more detail or watch this video:
#!/bin/sh -e | |
hostname=$1 | |
device=$2 | |
file=$HOME/.dynv6.addr6 | |
[ -e $file ] && old=`cat $file` | |
if [ -z "$hostname" -o -z "$token" ]; then | |
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]" | |
exit 1 | |
fi |
var ipp = require('ipp'); //get it from there - https://npmjs.org/package/ipp - $npm install ipp | |
var request = require('request'); //get it from there - https://npmjs.org/package/request - $npm install request | |
var fs = require('fs'); | |
function getPrinterUrls(callback) { | |
var CUPSurl = 'http://localhost:631/printers';//todo - change of you have CUPS running on other host | |
request(CUPSurl, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
var printersMatches = body.match(/<TR><TD><A HREF="\/printers\/([a-zA-Z0-9-^"]+)">/gm);//i know, this is terrible, sorry( | |
var printersUrls = []; |
Location | Name | Frequency | Duplex | Offset | Tone | rToneFreq | cToneFreq | DtcsCode | DtcsPolarity | Mode | TStep | Skip | Comment | URCALL | RPT1CALL | RPT2CALL | DVCODE | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 462.125000 | 0.000000 | TSQL | 88.5 | 69.3 | 023 | NN | FM | 5.00 | S | ||||||||
2 | 462.225000 | 0.000000 | 88.5 | 88.5 | 023 | NN | FM | 5.00 | S | |||||||||
3 | 462.325000 | 0.000000 | 88.5 | 88.5 | 023 | NN | FM | 5.00 | S | |||||||||
4 | 462.425000 | 0.000000 | TSQL | 88.5 | 103.5 | 023 | NN | FM | 5.00 | S | ||||||||
5 | 462.525000 | 0.000000 | TSQL | 88.5 | 114.8 | 023 | NN | FM | 5.00 | S | ||||||||
6 | 462.625000 | 0.000000 | TSQL | 88.5 | 127.3 | 023 | NN | FM | 5.00 | S | ||||||||
7 | 462.725000 | 0.000000 | TSQL | 88.5 | 136.5 | 023 | NN | FM | 5.00 | S | ||||||||
8 | 462.825000 | 0.000000 | TSQL | 88.5 | 162.2 | 023 | NN | FM | 5.00 | S | ||||||||
9 | 462.925000 | 0.000000 | DTCS | 88.5 | 88.5 | 023 | NN | FM | 5.00 | S |
from scipy.io.wavfile import read, write | |
from scipy.signal import find_peaks_cwt, firwin, lfilter, medfilt, resample, hamming | |
from scipy.optimize import fmin | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import argparse | |
class Tone: |
This Gist is about how I use PyAudio, NumPy, and Matplotlib to plot freqency spectrum of system sound or microphone.
You can read this blog post for more detail or watch this video:
This flow (and associated circuits/hardware) is designed to allow Node-RED to pass messages via radio waves in the same way as it passes messages via MQTT, using commonly-available, inexpensive handheld radios and the Raspberry Pi. The flow has been tested using Baofeng, Wouxun, and Quansheng handheld ham radios. In short, the goal is to allow packet-like transmissions between Node-RED systems over miles, while keeping the hardware costs down (or free for those hams who have surplus Baofengs hanging around). This could be used for a backup to MQTT when the Wifi is unreliable, or simply as a long-distance and network-agnostic message channel.
Prerequisites: Software
First, we need PulseAudio to make and receive sounds with our USB soundcard:
sudo apt-get install pulseaudio -y
int analogPin = 0; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(LED_BUILTIN, OUTPUT); | |
digitalWrite(LED_BUILTIN, LOW); | |
pinMode(4, OUTPUT); | |
digitalWrite(4, HIGH); | |
} |
**Create a Bing API key** | |
https://www.bingmapsportal.com/application/create/1354301 | |
**Download the plugins** | |
https://github.com/shramov/leaflet-plugins | |
```html | |
<!DOCTYPE html> | |
<html> | |
<head> |
{ | |
"key_events": { | |
"key_unknown": "adb shell input keyevent 0", | |
"key_soft_left": "adb shell input keyevent 1", | |
"key_soft_right": "adb shell input keyevent 2", | |
"key_home": "adb shell input keyevent 3", | |
"key_back": "adb shell input keyevent 4", | |
"key_call": "adb shell input keyevent 5", | |
"key_endcall": "adb shell input keyevent 6", | |
"key_0": "adb shell input keyevent 7", |
-- MTPhreak IMEI changer and randomizer for MediaTek NVRAM | |
-- This version is adapted specifically for the Sigma sKai and other MT6572 based phones | |
-- Usage: lua mtphreak-6572.lua NVRAMfile [imei1 [imei2]] | |
-- If no IMEIs are passed, they are randomized (with respect to Luhn checksum) | |
function parseImei(imeistr) -- imei string to 12-byte table | |
local imeiTbl = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | |
for i = 1, 15 do | |
local digit = tonumber(imeistr:sub(i,i)) |