This file contains hidden or 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
| /* | |
| * Steve-Tech's custom SenseCAP T1000-A/B decoder for The Things Network | |
| * Designed with Traccar in mind, however not all fields are directly mappable. | |
| */ | |
| function getMacAddr(input, index) { | |
| let mac = ""; | |
| for (let i = 0; i < 6; i++) { | |
| mac += input.bytes[index + i].toString(16); | |
| if (i < 5) mac += ":"; |
This file contains hidden or 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
| # ESPHome Casablanca IR Light & Fan Remote Config | |
| # These remotes use the SM5021BL IC, the values are calculated as per the datasheet. | |
| # Add this to an existing config and change GPIO0 to whatever pin you have chosen to use. | |
| remote_transmitter: | |
| pin: GPIO0 | |
| carrier_duty_percent: 50% | |
| output: | |
| - platform: template |
This file contains hidden or 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
| // Casablanca IR Light & Fan Remote Arduino Program | |
| // These remotes use the SM5021BL IC, the values are calculated as per the datasheet. | |
| // This program also incorporates a DHT11 temp sensor and an LDR and prints the values over serial every 2 seconds. | |
| // This program was also written years ago so it might be broken now. | |
| #include <DHT.h> | |
| #define SEND_PWM_BY_TIMER | |
| #define DISABLE_CODE_FOR_RECEIVER | |
| #define EXCLUDE_EXOTIC_PROTOCOLS | |
| #define EXCLUDE_UNIVERSAL_PROTOCOLS |
This file contains hidden or 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
| // AMDResetStatus.cpp : Gets the reset reason on AMD systems | |
| // | |
| // Parts copied from https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=b343579de7b250101e4ed6c354b4c1fa986973a7 | |
| #include <iostream> | |
| #include <filesystem> | |
| #include <fstream> | |
| #include "Windows.h" | |
| #include "PawnIOLib.h" |
This file contains hidden or 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
| #include <assert.h> | |
| #include <drm/drm.h> | |
| #include <drm/i915_drm.h> | |
| #include <errno.h> | |
| #include <fcntl.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/ioctl.h> | |
| #include <unistd.h> |
This file contains hidden or 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
| # Requires portio and usually root access | |
| # If you're using a venv, run it something like `sudo .venv/bin/python ec-lpc-memmap.py` | |
| import portio | |
| EC_LPC_ADDR_MEMMAP = 0xE00 # will be 0x900 on most other models | |
| EC_MEMMAP_SIZE = 255 | |
| EC_MEMMAP_FAN = 0x10 | |
| if portio.ioperm(EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE, True): |
This file contains hidden or 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 json | |
| import mimetypes | |
| import subprocess | |
| import sys | |
| # Codec Reader for HTML Video Tags by Steve-Tech | |
| # Usage: python3 codec-reader.py [-d] file_name | |
| # Requires ffmpeg and ffprobe to be installed. | |
| # | |
| # Supported Codecs: |
This file contains hidden or 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
| // ==UserScript== | |
| // @name QUT Canvas++ | |
| // @namespace https://stevetech.me/ | |
| // @version 0.4.2 | |
| // @description Enhancements to the QUT Canvas, may work on other instances of Canvas by Instructure. | |
| // @author Steve-Tech | |
| // @match https://canvas.qut.edu.au/* | |
| // @icon https://instructure-uploads-apse2.s3.ap-southeast-2.amazonaws.com/account_218620000000000001/attachments/792/favicon.ico | |
| // @grant none | |
| // @run-at document-idle |
This file contains hidden or 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
| # Flight Recorder for BoardConnect (Lufthansa Systems GmbH & Co. KG) | |
| # Records flight data in a csv format, see the headers variable for the headers. | |
| import requests | |
| import csv | |
| from time import sleep | |
| header = ('utc', 'flightNumber', 'aircraftRegistration', 'aircraftType', 'callSign', 'altitude', 'groundSpeed', 'heading', 'lon', 'lat', 'distDest', 'temperature') | |
| first = True |
This file contains hidden or 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
| # Code modified from https://huggingface.co/CarperAI/stable-vicuna-13b-delta | |
| # in order to use Intel Extension for PyTorch (IPEX) to run on Intel Arc GPUs | |
| # and for fastchat-t5-3b-v1.0, since it can fit in 8GB of VRAM using BF16 | |
| # or 16GB of VRAM using FP32. IPEX/Arc does not seem to support bare FP16. | |
| # Follow the instructions here to install IPEX: | |
| # https://intel.github.io/intel-extension-for-pytorch/xpu/1.13.120+xpu/tutorials/installation.html | |
| # And remember to source setvars.sh before running this script: | |
| # `source {ONEAPI_ROOT}/setvars.sh` e.g. `source /opt/intel/oneapi/setvars.sh` |
NewerOlder