Skip to content

Instantly share code, notes, and snippets.

View LightningStalker's full-sized avatar

LightningStalker

View GitHub Profile
@LightningStalker
LightningStalker / backup.cpp
Last active January 16, 2026 10:42
Pass files list to mksquashfs
/* wrapper prog for mksquashfs
* to add the missing file list functions
* because xargs have lousy quoting and and shell script also suck
* beware of the MAX_INPUT limit of the shell
* Project Crew™ 1/15/2026
*/
#include <iostream>
#include <fstream>
using namespace std;
@LightningStalker
LightningStalker / TLZ.ASM
Created January 7, 2026 06:46
The Twiddlebit Zone
NAME tz
PAGE 55,132
TITLE TLZ.COM
.MODEL TINY
;
; TLZ.COM: The Twiddlebit Zone
;
; Project Crew, 12.27.2025
@LightningStalker
LightningStalker / fl.cpp
Last active January 17, 2026 16:59
Another demo for the C++ hexdump of previous gist (need the hxd.hpp)
/* Compile with $ g++ -o fl fl.cpp
* Project Crew™ 12/28/2025
*/
#include <iostream>
#include <iomanip>
using namespace std;
#include "fl.hpp"
#include "hxd.hpp"
@LightningStalker
LightningStalker / hxd.cpp
Created December 29, 2025 12:26
C++ hex dump for debug, etc.
/* Compile with $ g++ -o hxd hxd.cpp
* Demonstration of the hexadecimal dumper for the char[]
* Project Crew™ 12/28/2025
*/
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
@LightningStalker
LightningStalker / WC.ASM
Last active December 19, 2025 22:13
"wc" - wordcount in asm for DOS, 8086 +
name wc
title WC.COM--word count
;--- assemble: uasm -bin -Fo WC.COM WC.ASM
display_char macro character
mov dl, character
mov ah, 02h
int 21h
endm
@LightningStalker
LightningStalker / dirshma.sh
Created November 22, 2025 11:03
make you directry disappear
#!/bin/bash
if [ -d "${1}" ]
then
echo -n 'dirshma.sh: '
rename -v 'y/ -~/0/' "${1}"
until
echo -n 'dirshma.sh: '
rename -v 's/0//' 0*
rmdir 0 2> /dev/null
do
@LightningStalker
LightningStalker / bucks.c
Created September 11, 2025 10:06
Buck converter calc
/* Compile with $ gcc -Wall -o bucks bucks.c
* For Watcom: $ wcl -bcl=$(DEST_OS) -wx -fe=$(EXE_file) bucks.c
* or use make
* Buck converter Power State calculator
* Formuli from SLVA477B by TI, Rev. 8/2015
* C adaptation by Project Crew 2024
*/
#include <stdio.h>
#include <stdlib.h>
@LightningStalker
LightningStalker / beacondist.cpp
Last active September 5, 2025 23:40
distance to station based on RSSI and reference station
/* distance to station based on RSSI and reference station
* stations must be very very close to same
* Project Crew™ 9/3/2025
*/
#include <iostream>
#include <cmath>
#include <exception>
#include <filesystem>
using namespace std;
@LightningStalker
LightningStalker / dec2sex.c
Last active August 27, 2025 12:55
Convert decimal GPS coordinates into sexagesimal
/* Compile with gcc -Wall -o dec2sex dec2sex.c -lm */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (int argc, char **argv)
{
int d, m, s, ms;
double mm, ss;
@LightningStalker
LightningStalker / sex2dec.c
Last active August 27, 2025 12:58
Convert sexagesimal GPS coordinates into decimal
/* Compile with gcc -Wall -o sex2dec sex2dec.c */
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
if (argc == 5)
{
printf ("%f\n", atoi(argv[1])