Skip to content

Instantly share code, notes, and snippets.

View LightningStalker's full-sized avatar

LightningStalker

View GitHub Profile
@LightningStalker
LightningStalker / dskimg.asm
Last active April 6, 2026 14:38
DOS - Save image of disk A: in current directory to file DSK.IMG
name dskimg
page 55,132
title DSKIMG.COM--save a disk image
; Project Crew™ 1/18/2025
.MODEL tiny ; Create DSKIMG.COM
bytes equ 64 * 512 ; number of bytes in buffer
exit equ 4c00h ; exit back to DOS
@LightningStalker
LightningStalker / S.ASM
Last active April 6, 2026 13:55
DOS Screen Saver - blanks the sreen and waits for keypress
name cs
title CS.COM--blank the Screen (CGA version)
;--- assemble: uasm -bin -Fo CS.COM CS.ASM
;
; Project Crew™ 12/6/2024
.model tiny
modsel equ 3d8h ; CGA Mode-Select Register
@LightningStalker
LightningStalker / hellos.asm
Last active November 29, 2024 00:27
DOS assembly program that has a hidden string
.MODEL TINY
.STACK 100h
.DATA
;msg DB 'hello, world',13,10,'$'
msg DB 0d6h,0dbh,0d2h,0d2h,0d1h,092h,09eh,0c9h,0d1h,0cch,0d2h,0dah,0b3h,0b4h,09ah
.CODE
start:
@LightningStalker
LightningStalker / rngesus.cpp
Created November 21, 2024 10:48
Generates a random number between 1 and argv[1]
/* rngesus Generates random numbers >= 1 <= argv[1]
*
* Project Crew 11/21/2024
*/
#include <iostream>
#include <exception>
#include <random>
using namespace std;
@LightningStalker
LightningStalker / tankfreq.cpp
Last active June 29, 2025 02:24
C++ version of tankfreq
/* compile with $ g++ -Wall -Os -o tankfreq tankfreq.cpp
*/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <exception>
#include <locale> // std::locale, std::numpunct, std::use_facet
using namespace std;
@LightningStalker
LightningStalker / floperation.c
Last active August 13, 2024 13:39
Examine binary representations of floating point numbers on your machine
/* Compile with gcc -Wall -o floperation floperation.c -lquadmath*/
/* Examine binary representations of floating point numbers
on your machine
Project Crew 8/10/2024 */
//#include <immintrin.h>
#include <quadmath.h>
#include <stdint.h>
#include <stdio.h>
@LightningStalker
LightningStalker / lineskip.sh
Last active June 13, 2024 10:59
conversion script for AT7456 / MAX7456 character sets from Maxim .MCM binary format to charset.h for reloading default character set, etc.
#!/bin/bash
# conversion script for AT7456 / MAX7456 character sets
# from Maxim .MCM binary format to charset.h
# for reloading default character set, etc.
# Project Crew 2024
exec<$1
value=1
echo "const char charset[] PROGMEM = {" > charset.h
read
#!/bin/bash
# script that reads a YAML (.yml) file and verifies a local file against its sha512 hash
# extraction of multiple digest entries not supported
# these .yml are rumored to be spawn of electron-builder or ...
hash=$(sed -n 's/^sha512: //p' $1 | base64 -d | xxd -p -c64)
fname=$(sed -n 's/path: //p' $1)
echo -n $hash' '$fname | sha512sum -c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <xdo.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
if (argc<2)
{
puts("Specify rep rate in milliseconds");
return 0;
/* Compile with gcc -Wall -o pinh pinh.c -lm
The formulator of the pinhole camera
microscopic probgramme by The Lightning Stalker ©April 11, 2022
It's basically in case I can't remember the formula.'*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>