Skip to content

Instantly share code, notes, and snippets.

View xslim's full-sized avatar

Taras Kalapun xslim

View GitHub Profile
@maxme
maxme / raspberry-power-supply-check.sh
Last active May 14, 2025 02:37
Check your Raspberry pi power supply and USB cable
#!/bin/bash
# Before running this script, make sure you have sysbench installed:
# sudo apt-get install sysbench
#
# This script helps you check if your Raspberry pi is correctly powered.
# You can read more about Raspberry pi powering issues here: https://ownyourbits.com/2019/02/02/whats-wrong-with-the-raspberry-pi/
# If you're pi is correctly powered (stable power supply and quality cable), after running the script, you should get something like:
# define our method
def replace_all(text, dic):
for i, j in dic.iteritems():
text = text.replace(i, j)
return text
navtex = 'navtex string here'
# our dictionary with our key:values.
dic = {'BACK':'Backing','KMH':'Km/h','QUAD':'Quadrant','BECMG':'Becoming','KT':'Knots','RPDY':'Rapidly','BLDN':'Building','LAT/LONG':'Latitude/Longitude','SCT':'Scattered','C-FRONT':'Cold front','LOC':'Locally','SEV':'Severe','SVR':'Severe','DECR':'Decreasing','M':'Metres','SHWRS':'Showeres','SH':'showers','DPN':'Deepening','MET':'Meteo','SIG':'Significant','EXP':'Expected,''MOD':'Moderate','SLGT':'slight','SLT':'Slight','FCST':'Forecsat','MOV':'moving/move','MVG':'Moving/Move','SLWY':'Slowly','FLN':'Filling','NC':'No change','STNR':'Stationary','FLW':'Following','NM':'Nautical miles','STRG':'Strong','FM':'From','NOSIG':'No significant change','TEMPO':'Temporarily/Temporary','FRQ':'Frequent/frequency','NXT':'Next','TEND':'Further Outlooks','HPA':'HectoPascal','OCNL':'Ocasionally','VEER':'Veering','HVY':'Heavy'
@hsiboy
hsiboy / NASA_Marine_navtex.txt
Last active June 4, 2021 19:50
Interface Specification for NASA Marine PC Navtex Pro
Interface Specification for NASA Marine PC Navtex Pro
1 - Electronic Interface
Power input: +10Volts to + 16Volts.
RS232 interface:
data format: 8 bits, 1 start bit, no parity, 1 stop bit.
Connector: 9-pin D-type socket mounted on the board.
pin 2: 38,400 Baud output from Engine to PC
pin 3: 38,400 Baud input to Engine from PC
@moorer2k
moorer2k / rtlsdr-decoder-setup.sh
Last active February 25, 2025 17:46
Automated setup created for DietPi on an RPI2 for RTL-SDR pager decoding using mutlimon-ng and pagermon. Uses version managers for node and python to keep it isolated + correctly compiled.
#DietPi setup script for RTL-SDR/Multimon-ng/Pagermon for decoding pager messages(FLEX/POCSAG etc.)
cat <<EOF >no-rtl.conf
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
EOF
mv no-rtl.conf /etc/modprobe.d/
@nakov
nakov / secp256k1-example.js
Last active April 9, 2024 16:32
ECDSA in JavaScript: secp256k1-based sign / verify / recoverPubKey
let elliptic = require('elliptic');
let sha3 = require('js-sha3');
let ec = new elliptic.ec('secp256k1');
// let keyPair = ec.genKeyPair();
let keyPair = ec.keyFromPrivate("97ddae0f3a25b92268175400149d65d6887b9cefaf28ea2c078e05cdc15a3c0a");
let privKey = keyPair.getPrivate("hex");
let pubKey = keyPair.getPublic();
console.log(`Private key: ${privKey}`);
console.log("Public key :", pubKey.encode("hex").substr(2));
@Everlanders
Everlanders / backlight.sh
Created March 6, 2018 15:16
Script to Change the Backlight brightness on the Official Raspberry Pi 7" display.
#!/bin/bash
level=$1
#echo "level given is $level"
if [ $# != 1 ]; then
echo "USAGE: $0 brightness_level (0 to 255)"
exit 1
fi
@Everlanders
Everlanders / ButtonMonitor.py
Last active May 8, 2024 05:09
Python Script to monitor GPIO button presses and call the Camera and Backlight.
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import subprocess, os
import signal
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
RearView_Switch = 14 # pin 18
Brightness_Switch = 15 # pin 16
@RichardBronosky
RichardBronosky / README.md
Last active February 24, 2025 04:59
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.

I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)

@Gadgetoid
Gadgetoid / README.md
Last active July 19, 2025 18:46
Raspberry Pi Zero / Windows 10 automatic RNDIS driver install for composite gadgets

Preface

I owe my very rapid learning journey in the world of ConfigFs to several key sources which aren't necessarily relevant to this result, but I feel deserve a mention anyway.

@ageis
ageis / YubiKey-GPG-SSH-guide.md
Last active November 30, 2025 16:23
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.