Skip to content

Instantly share code, notes, and snippets.

@m0rb
m0rb / webp-carve.pl
Last active September 10, 2023 22:48
#!/usr/bin/perl -w
use strict;
use warnings;
my $header = 'RIFF';
my $sbuf = 1024;
open my $file, '<', $ARGV[0] or die $!;
binmode $file;
my $i = 0;
@m0rb
m0rb / pbash64.sh
Last active May 5, 2023 05:01
pure bash bash64.sh
#!/bin/bash
B=({A..Z} {a..z} {0..9});p=printf\ ;I=$(B=$@
for((;i<${#B};i++)){ for y in {31..128};{
[[ ${B:i:1} = "$($p\\x`$p%x $y`)" ]]&&(a()((q=y/2,r=y%2));a;o=$r
for((;q;)){ y=$q;a;o=$r$o;};$p%08d $o)} })
for((;e<${#I};e+=6)){ y=${I:e:6}0000;O+=${B[2#${y::6}]};}
for((;${#O}%4;)){ O+=\=;}
$p$O
@m0rb
m0rb / nodelpr.ino
Created February 3, 2023 14:05
nodemcu famiclone lpr
/*
nodemcu line printer for Subor Famiclones
- morb
*/
const int pins[] = { 16, 5, 4, 0, 2, 14, 12, 13, 15 };
const int busy = 3;
byte out;
void ICACHE_RAM_ATTR readStrobe() {
@m0rb
m0rb / nes_extract.sh
Created January 31, 2023 03:03
Quick and dirty NES ROM binifier
#!/bin/bash
# yet another NES ROM to BIN script
# got tired of doing this all by hand
# - morb
TITLE=$1
ROMSIZE=65536
RSIZES=($(file "$TITLE" | cut -f2- -d: | awk '{print $5"\n"$7}'))
BIN=${TITLE/.nes/.bin}
CHR=${BIN/.*/_chr.bin}
@m0rb
m0rb / phony.pl
Last active November 25, 2022 00:36
phony.pl - phonetic alphabet - now with navajo
#!/usr/bin/perl
use Getopt::Std;
%alpha = (
"A" => [ "Alpha", "WOL-LA-CHEE", "BE-LA-SANA", "TSE-NILL" ],
"B" => [ "Bravo", "NA-HASH-CHID", "SHUSH", "TOISH-JEH" ],
"C" => [ "Charlie", "MOASI", "TLA-GIN", "BA-GOSHI" ],
"D" => [ "Delta", "BE", "CHINDI", "LHA-CHA-EH" ],
"E" => [ "Echo", "AH-JAH", "DZEH", "AH-NAH" ],
"F" => [ "Foxtrot", "CHUO", "TSA-E-DONIN-EE", "MA-E" ],
"G" => [ "Golf", "AH-TAD", "KLIZZIE", "JEHA" ],
@m0rb
m0rb / gist:2f2ab9c981cedbf3181880b97c0fa9bb
Last active October 31, 2022 01:55
Lenovo ThinkBook 15 G2 ARE (20VG) BIOS/UEFI Upgrade via UEFI Partition
This is now how I flash the UEFI/BIOS on my ThinkBook instead of running h2offt from some random laptop manu's support page.
Maybe it won't void your warranty? :)
Proceed at your own risk.
From a Linux Environment:
1) Download latest BIOS/UEFI firmware from Lenovo: https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkbook-series/thinkbook-15-g2-are/downloads/driver-list/component?name=BIOS%2FUEFI
@m0rb
m0rb / vs6sp5.diff
Created May 23, 2022 11:15
Visual C++ 6.0 SP5 MDAC Req. Patch
--- sp598ent.stf 2022-05-23 07:13:52.314498801 -0400
+++ sp598ent.stf 2022-05-23 07:13:44.066407850 -0400
@@ -26,7 +26,7 @@
11 yes Floppy Install AppMainDlg 13 12 No %m
12 yes &Complete Complete install of VS 6.0 Service Pack 5 Group 13 44 53 60 65 74 84 86 80 70 40 89 sp598ent.dll,104
-13 Group 28 36 38 29 30 32 26 27 14 25 16 17 20 18 19 15 39 21 22 24 23 43
+13 Group 28 38 29 30 32 26 27 14 25 16 17 20 18 19 15 39 21 22 24 23 43
14 CustomAction """sp598ent.dll"", ""GetPathFromReg"", ""HKEY_LOCAL_MACHINE,Software\Microsoft\VisualStudio\6.0\Setup,VSCommonDir"" " %d\Common
15 CustomAction """sp598ent.dll"", ""GetPathFromReg"", ""HKEY_LOCAL_MACHINE,Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Studio,ProductDir"" "
@m0rb
m0rb / sg.txt
Created May 19, 2022 11:04
Spacegulls (NES) Game Genie / FCEUX Cheat Codes
STZGUO - Instadeath, all damage is fatal
PTZGSO - Invincibility
@m0rb
m0rb / ripscrip.prn
Created May 14, 2022 13:13
RIPscrip 2.0 Alpha 4 Spec
This file has been truncated, but you can view the full file.
TABLE OF CONTENTS
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
1 þ Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1 þ Use of the RIPscrip Language . . . . . . . . . . . . . . . . 3
1.2 þ Definition . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 þ How Does RIPscrip Work? . . . . . . . . . . . . . . . . . . . 5
1.4 þ Revision History Notation . . . . . . . . . . . . . . . . . . 6
1.4.1 þ Revision 2.A4 . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.2 þ Revision 2.A3 . . . . . . . . . . . . . . . . . . . . . . . . 10
@m0rb
m0rb / stryker.uue
Created March 18, 2022 13:45
Major Stryker Beta (August 12, 1992) Date/Environment Protection Crack
begin 664 STRYKER.PATCH
M0E-$249&-#!6`````````*TN````````M"4!``````!"6F@Y,4%9)E-9-?&,
MWP``*?G4?=P``(0```$``,``0``$``"`(``Q3)B9!D8,DT#30T#1VT7=[4SI
MW)(&4`9"=2"H%VLHO3"<;WOB[DBG"A(&OC&;X$)::#DQ05DF4UFG+V^Q``2P
M_____________________________________________^`>NRT;7F;M8]NW
M=QMM1-O@````#WSTO=M]N)V\[.O>9:NYZ]XW=G;W7==[R][;SN>ZVVMZG=W;
MS=[WE[WEZJ76=4][6QUKE>]MW-N][RZ[NWO7O/>KL94]H`$,0T-&@T-)DTVB
M83$RG@!,*?JGIDP3`33331-/(P"1F`F@(_0D\H]!DI^3!3TPF`C3$QH#4:83
M:`)DP,@F`U,5#*GD9`T9)Z-#4VC2GF0)Z:3:-":G@U)O30`AFID&F(VA&*>$
M>IJ8-4_30:,!D-$\@R&@J?FA&#34]":I[29HU/3)@F(PIZ:GDQ-'J::-3R:H