Skip to content

Instantly share code, notes, and snippets.

View mattrude's full-sized avatar

Matt Rude mattrude

View GitHub Profile
@mattrude
mattrude / build-nginx.md
Created March 20, 2023 19:45
Build Nginx from Source

Download Latest Nginx Version from http://nginx.org/download/

mkdir -p /var/src/
cd /var/src/
wget http://nginx.org/download/nginx-1.23.3.tar.gz
tar -xzf nginx-1.23.3.tar.gz
cd nginx-1.23.3

Then Build the software

@mattrude
mattrude / build-libreelec.sh
Last active January 21, 2023 18:31
A simple build scrip for LibreELEC.tv
#!/bin/bash
buildDIR='/mnt/public/LibreELEC.tv'
httpDIR='/var/www/html'
builds="master libreelec-11.0"
GITURL="https://github.com/LibreELEC/LibreELEC.tv.git"
######################################################################################
scriptName=$(basename -- "$0")
@mattrude
mattrude / PIC16F15214-stoplight.c
Last active February 5, 2022 09:13
PIC16F15214 - A simple program that simulates a standard traffic stop light with 3 LEDs.
/* File: PIC16F15214-stoplight.c
* Hardware: PIC16F15214
* Build software: MPLAB X IDE v6.00 & XC8 v2.32
* Author: Matt Rude <[email protected]>
* Created on February 3, 2022, 1:11 AM
*
* ----------------------------------------------------------------------------
* Description:
*
* A simple program that simulates a standard traffic stop light with 6 LEDs.
@mattrude
mattrude / PIC16F877A_KnightRider_scanner.c
Last active February 6, 2022 18:28
PIC16F877A - Knight Rider scanner bar
/*
* File: KnightRider.c
* Author: Matt Rude <[email protected]>
*
* Created on February 4, 2022, 6:33 PM
*/
#define _XTAL_FREQ 4000000
#pragma config FOSC = HS
#!/bin/python
# Python code for writing eeprom data to a 25AA128
data = bytearray([
# Set ABP Byte (1-byte)
0x01,
# TTN Device Address, 4 Bytes, MSB
0xCB, 0x4B, 0xCC, 0x18, # devaddr
@mattrude
mattrude / 6502.md
Last active December 6, 2021 23:14

First start by installing the needed software on your computer.

apt -y install build-essential pkg-config git libusb-1.0-0-dev

Next download, compile, & install the minipro software

cd &amp;&amp; rm -rf minipro
@mattrude
mattrude / frequency-plans.yml
Created June 28, 2021 18:18
The Things Network frequency-plans.yml file
- id: US_902_928_FSB_2
name: United States 902-928 MHz, FSB 2 (Default, use this one)
description: The Community Network frequency plan for the United States and Canada, using sub-band 2
base-frequency: 915
country-codes: [ca, cr, ec, gy, mx, pa, pr, us]
file: US_902_928_FSB_2.yml
- id: US_902_928_FSB_1
name: United States 902-928 MHz, FSB 1
description: Default frequency plan for the United States and Canada, using sub-band 1
@mattrude
mattrude / global_conf.json
Created June 10, 2021 20:17
The global_conf.json for TTN Stack
{
"SX1301_conf": {
"lorawan_public": true,
"clksrc": 1,
"antenna_gain": 0,
"radio_0": {
"enable": true,
"type": "SX1257",
"freq": 904300000,
"rssi_offset": -166.0,
@mattrude
mattrude / traccar-v2.php
Last active February 9, 2021 04:21
A helper file to transmit locations from TheThingsNetwork to Traccar
<?php
$json = file_get_contents('php://input');
$data = json_decode($json, true);
$id = $data["dev_id"];
$lat = $data["payload_fields"]["latitude"];
$lon = $data["payload_fields"]["longitude"];
$altitude = $data["payload_fields"]["altitude"];

To run:

curl -Ls "https://gist.githubusercontent.com/mattrude/4195d155c5deb53b628055a5f83fd5e3/raw/raspi-build.sh" |sh -