Skip to content

Instantly share code, notes, and snippets.

View LightningStalker's full-sized avatar

LightningStalker

View GitHub Profile
@LightningStalker
LightningStalker / !Press any key to reboot.asm
Created February 23, 2026 18:30
Press any key to reboot OS for PC
;******************************
; Press any key to reboot v2.1
; For flat assembler
; Project Crew™ 2/29/2008
;******************************
version equ '2.1'
format binary as 'ima'
include 'Ata_Atapi.inc' ; Use Craig Bamford's library
; for CD Eject functions
Load_Segment equ 7C00h
@LightningStalker
LightningStalker / wa.sh
Created February 23, 2026 17:24
wa.sh : remove the trailing whitespace
#!/bin/bash
# wa.sh - rinse away the sin of trailing whitespace <- Project Crew™ 2/23/2026
PROGNAME=$(basename ${0})
if test -n "${1}"
then
if test -f "${1}"
then
NL=$(egrep -ch ' +$' ${1})
echo ${PROGNAME}: Found ${NL} line\(s\) ending in whitespace.
if test ${NL} -gt 0
@LightningStalker
LightningStalker / helloa2.s
Last active February 23, 2026 17:59
vasm hello world for Apple 2
; vasm hello world for Apple ][
; address for call of the ROM BIOS function routines
COUT equ $fded ; character output
CROUT equ $fd8e ; start new line
WRST equ $3d0 ; warm reset, return to system
; symbols to get rid of the "magic numbers"
ABM equ $80 ; abyte modifier (chars + $80)
CR equ 13 ; carriage return char
@LightningStalker
LightningStalker / stripall.sh
Created February 22, 2026 11:34
Strip all binary programs in current directory
# Strip all the executable files in current directory that don't have
# '.' character in the name.
echo -n "stripall.sh: Number of programs to strip: "
find -maxdepth 1 -executable \! -name '*.*' | wc -l
echo Stripping...
find -maxdepth 1 -executable \! -name '*.*' -print0 | xargs -0 strip -s
@LightningStalker
LightningStalker / hello.asm
Created February 18, 2026 08:08
fasm hello world DOS
; fasm hello world DOS
; Project Crew™ 2/16/2026
CR equ 13 ; carriage return
LF equ 10 ; line feed
org 100h
start:
mov ah, 9 ; Display String
@LightningStalker
LightningStalker / pink_main.c
Last active February 5, 2026 11:48
Pink noise from CLI
/* depend: Tom Merchant's Voss-McCartney pink-noise approximation algorithm:
* (https://gist.github.com/tom-merchant/5ced03a0638b06138ee7d11c0c209aa4)
*
* output is FLOAT_LE (32-bit)
* Project Crew™ 2/4/2026
*/
#include <stdio.h>
#include <stdlib.h>
#include <curses.h>
@LightningStalker
LightningStalker / floyd.cpp
Last active February 4, 2026 10:11
Generate the pink noise by Voss-McCartney
/* Voss-McCartney pink noise
* Project Crew™ 1/27/2026
*
* Pros might wanna use low freq high pass.
*/
#include <iostream>
#include <cmath>
#include <random>
#include <array>
@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"