Skip to content

Instantly share code, notes, and snippets.

View krisstakos's full-sized avatar
🦧

Kristian Kosev krisstakos

🦧
View GitHub Profile
@alwynallan
alwynallan / Makefile
Last active June 21, 2024 18:53
Hardware PWM Controller for the Raspberry Pi 4 Case Fan
CC = gcc
RM = rm -f
INSTRUMENT_FOR_PROMETHEUS := false
ifeq ($(INSTRUMENT_FOR_PROMETHEUS),true)
CFLAGS = -Wall -DINSTRUMENT_FOR_PROMETHEUS
LIBS = -lbcm2835 -lprom -lpromhttp -lmicrohttpd
else
CFLAGS = -Wall

Shell Motorsport Bluetooth Remote Control

Shell Motorsport collection

Shell Oil Company in its gas station offers loyalty program under name Shell ClubSmart. Members collect points which can be later used to get rewards. In 2020 they have offered a collection of die-cast car models under name Shell Motorsport. All models of the colletion are equipped with electrical motor. One of the models - Nissan Formula E Gen 2 Car - contains a battery that can be used to control a model remotely over Bluetooth. In some markets a battery with

@tstellanova
tstellanova / setup_rpi_openocd.md
Last active June 25, 2021 01:02
Setup rpi0 with openocd for flashing nrf52

Instructions for setting up a Raspberry Pi Zero for running OpenOCD specifically for the purpose of disabling Access Port Protection on nrf52 boards.

Build OpenOCD with CMSIS-DAP and GPIO support

The below script builds natively on the RPi0, and will take a very long time.

sudo apt install wget git autoconf libtool make pkg-config libusb-1.0-0 libusb-1.0-0-dev libhidapi-dev libftdi-dev libhidapi-dev telnet
git clone https://github.com/ntfreak/openocd
cd openocd
./bootstrap
@eduardofilo
eduardofilo / gist:eced05b5fcafb86178834f4d708dcfa9
Last active June 7, 2022 16:39
abraha2d's OpenAuto fork compilation
Starting point is release "NG Alpha-5 2019-06-08" of Crankshaft (https://github.com/opencardev/crankshaft/releases/tag/csng-alpha5). Tested on Raspberry Pi3 Model B and Model B+.
1. Activate DEV mode in Crankshaft. See this guide: https://github.com/opencardev/crankshaft/wiki/Dev-Mode-and-Debug-Mode
I used first method changing DEV_MODE=1 in /boot/crankshaft/crankshaft_env.sh mounting the microSD in my computer.
2. Attach Ethernet cable to Raspberry/Crankshaft, boot, find out IP and login through SSH (user: pi; pwd: raspberry).
3. Update distribution and install some packages:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install -y libboost-all-dev libusb-1.0.0-dev cmake libprotobuf-dev protobuf-c-compiler protobuf-compiler librtaudio-dev
@skywodd
skywodd / dmm4.py
Last active February 15, 2023 10:52
Serial protocol decoder for UNI-T UT61C (GS)
"""
Serial protocol decoder for UNI-T UT61C (GS).
"""
import serial
BV = lambda x: 1 << x
FLAGS = {
BV(0): 'BPN', # Bargraph rule
@Rawze
Rawze / ana_i2c_tinyslave.ino
Last active June 22, 2023 21:59
Arduino Attiny85 as 2-channel ana in + 1 chan pwm I2C slave device.
/*
ATtiny85 as 2-channel Analog + 1 PWM Output I2C Slave by Rawze. 05-16-2017
Default I2C adress = 0x04.
Program written and tested with ATTiny85 Arduino 8MHz internal clock bootloader.
Don't forget to select 8-Mhz internal clock and flash the bootloader on new hardware before first use.
@MightyPork
MightyPork / usb_hid_keys.h
Last active September 15, 2024 05:38
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@Lazza
Lazza / README.md
Last active June 19, 2024 05:52
VPNGate Python script

This script is NOT MAINTAINED

This snippet of code was posted in 2014 and slightly revised in 2016 and 2017. It was more of a quick'n'dirty script than a polished tool. It is made only for Linux and in Python 2, which has since become outdated.

I currently do not use it, and I suggest you avoid it as well. Please do not expect support for using this script.

🔥 If you need an alternative, @glaucocustodio has kindly suggested EasyVPN in this comment.

The rest of the README is left for historical purposed.