Skip to content

Instantly share code, notes, and snippets.

View aegis1980's full-sized avatar

Jon Robinson aegis1980

View GitHub Profile
@aegis1980
aegis1980 / xfoil.py
Last active November 26, 2023 02:53 — forked from helo9/xfoil.py
use python to run xfoil analysis
# -*- coding: utf-8 -*-
import os
import numpy as np
import subprocess as sp
import re
def polar(afile, re, *args,**kwargs):
"""calculate airfoil polar and load results
@aegis1980
aegis1980 / lora_gateway.ino
Created October 18, 2021 20:47
Duinotech XC4392 LoRa gateway
/*
Private LoRa protocol example :
Support Devices: LG01 Single Channel LoRa Gateway
This sketch is running in LG01. LG01 with firmware version v4.3.3 or above
Example sketch shows how to get sensor data from remote LoRa Sensor and Store the data into LG01.
The LG01 has daemon script to check the data periodically and update the data to IoT server.
The LoRa Protocol use here is private LoRa protocol which base on RadioHead Library.
Created 26 March 2018
by Dragino Tech <support@dragino.com>
@aegis1980
aegis1980 / mqtt_process.sh
Last active November 13, 2022 17:30
Quick fix for thingspeak MQTT daemon on Dragino LG01/ Duinotech XC4394
#!/bin/sh
#Check If we have set debug
DEBUG=`uci get iot-services.general.debug`
DEBUG=`echo $DEBUG| awk '{print int($0)}'`
UPDATE_INTERVAL=5
old=`date +%s`
@aegis1980
aegis1980 / config.txt
Last active August 13, 2022 03:44
My current OpenAuto Pro 'boot/config.txt' file
start_x=1
dtparam=spi=on
dtparam=i2c_arm=on
enable_uart=1
dtoverlay=w1-gpio
# turn off rpi rainbow
disable_splash=1
# for utronics 7" touchscreen
@aegis1980
aegis1980 / export_to_csv.sh
Created August 7, 2022 03:34 — forked from snorfalorpagus/export_to_csv.sh
Simple conversion utility for Microsoft Access databases (.mdb) to SQLite3.
#!/bin/bash
# usage: export_to_csv.sh <database.sqlite>
sqlite3 $1 "SELECT tbl_name FROM sqlite_master WHERE type='table' and tbl_name not like 'sqlite_%';" | while read table; do
echo $table
sqlite3 $1 <<!
.headers on
@aegis1980
aegis1980 / amp_power_control.ino
Last active July 21, 2022 13:19
Arduino sketch for controlling music amp power (via relay) from audio signal
/*
* 2020 Jon Robinson
* MIT License
* Arduino sketch which using envelope/peak detector circuit output signal to detect if music playing.
* Opens/ closes a relay accordingly - relay intended to switch amp on and off.
*/
// Two analog pins connected to envelope detector circuits
// one for left channel, one for right channel
@aegis1980
aegis1980 / openauto_button_gpio_controller_service.ini
Last active April 3, 2022 02:05
Openauto GPIO>Keyboard mapping controller service
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
; 7 - Resistive Buttons
Type=6
{
"anytime" : [
"Hey there sexy!"
],
"morning" : [
"Good morning, sunshine!",
"Who needs coffee when you have your smile?",
"Go get 'em, Tiger!"
],
"afternoon" : [
@aegis1980
aegis1980 / lora_node.ino
Created October 18, 2021 20:49
Lora node sketch for XC4392 Arduino shield
#include <dht.h>
#include <SPI.h>
#include <RH_RF95.h>
// Singleton instance of the radio driver
RH_RF95 rf95;
float frequency = 915.0; //frequency settings
dht DHT;
#define DHT11_PIN A0
float temperature,humidity,tem,hum;
@aegis1980
aegis1980 / TwoD_block_stir.jl
Last active August 8, 2021 04:44
Modified TwoD_block.jl example for Waterlilly.jl' CFD library.
using WaterLily
using StaticArrays
function block(L=2^5;Re=250,U=1,amp=0,ϵ=0.5,thk=2ϵ+√2)
# Set viscosity
ν=U*L/Re
# Create dynamic block geometry
function sdf(x,t)
# SDF defines form a paddle (a rectangle)