Skip to content

Instantly share code, notes, and snippets.

View Mr-Bossman's full-sized avatar
💤
Slept through school

Jesse Taube Mr-Bossman

💤
Slept through school
View GitHub Profile
@Mr-Bossman
Mr-Bossman / emile-68k-qemu.sh
Last active May 19, 2025 17:27
generate a bootable linux image for 68k using emile
#!/bin/bash
PART_NAME="linux"
IMG_NAME="emile.img"
PART_SIZE=$((1024*1024*1000))
BS=$((1024*1024))
# HD0-OpenRetroSCSI-7.5.3.hda
# https://mega.nz/folder/8hA3AQCJ#pWUq92L70yDXlogy9lk5Dg/file/hkIxnQ4S
#mv HD0-OpenRetroSCSI-7.5.3.hda MacOS.img
cp MacOS.img "$IMG_NAME"
@Mr-Bossman
Mr-Bossman / divisibility_rules.c
Created December 7, 2024 20:05
A generalized divisibility rule for binary inspired by Matt at Stand-up Maths https://www.youtube.com/watch?v=6pLz8wEQYkA
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
bool is_divisible(uint64_t n, uint64_t divisor) {
while((divisor % 2) == 0) {
if((n % 2))
return false;
n /= 2;
@Mr-Bossman
Mr-Bossman / BBP.py
Created March 25, 2024 20:48
Example of Bailey–Borwein–Plouffe digit extraction formula
# Example of Bailey–Borwein–Plouffe digit extraction formula
extra = 2
def BBP_8k(k,j):
return (8*k+j)
def BBP_mod(n, d):
return (16**n) % d
def BBP_inner(n, j):
@Mr-Bossman
Mr-Bossman / libcaca.sh
Last active October 29, 2023 05:12
libcacampv
export TERM=xterm-256color
export COLUMNS=80
export LINES=40
DISPLAY= mpv --quiet -vo caca 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
export TERM=xterm-256color
export COLUMNS=80
export LINES=40
yt-dlp -f best https://www.youtube.com/watch?v=dQw4w9WgXcQ -o - 2> /dev/null | ffmpeg -re -i pipe: -vcodec rawvideo -an -color full16 -antialias prefilter -algorithm fstein -pix_fmt rgb24 -window_size 80x40 -driver ncurses -f caca - 2> /dev/null
@Mr-Bossman
Mr-Bossman / listlinuxarch.sh
Last active September 19, 2023 01:40
script to list added and removed architectures in the linux tree
#!/bin/bash
#removed archs
git log --diff-filter=A --oneline --name-only -- arch/ | grep -E "^arch/[^/]?+/Makefile$" | xargs git log --oneline --diff-filter=D --name-only --
#added arches
git log --diff-filter=A --oneline --name-only -- arch/ | grep -E "^arch/[^/]?+/Makefile$" | xargs git log --oneline --diff-filter=A --name-only --
#example outoput of removed
: '
aec499c75cf8 nds32: Remove the architecture
@Mr-Bossman
Mr-Bossman / bash
Last active October 19, 2022 23:03
`open(0,0)` cases page fault...
LINUX=$1
if [ ! -f "init" ]; then
if [ -d "tmps" ]; then
sudo umount tmps
rmdir tmps
fi
dd if=/dev/zero of=init bs=4k count=400
mkfs.ext4 init
mkdir tmps
sudo mount -o loop init tmps
@Mr-Bossman
Mr-Bossman / ssh-keygen-deterministic.sh
Created August 30, 2022 20:55
deterministic ssh-keygen
SSH_PATH=$HOME/.ssh/id_rsa; read -ep "Enter file in which to save the key ($SSH_PATH): " -i $SSH_PATH SSH_PATH && echo "Enter seed passphrase: " && certtool --generate-privkey --outfile $SSH_PATH --key-type=rsa --sec-param=high --seed=$(perl -e '<>' | sha256sum | tr -d '-') && ssh-keygen -yf $SSH_PATH | sed "s/$/ $HOSTNAME/" > $SSH_PATH.pem
@Mr-Bossman
Mr-Bossman / .gitignore
Created January 23, 2022 03:58
Example git ignore with many binary/debug file types
**/*.log
**/*.o
**/*.d
**/*.so
**/*.a
**/*.bin
**/*.hex
**/*.elf
**/*.axf
**/*.exe
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" type="image/jpg" href="/"/>
<script>
const GIF = function () {
// **NOT** for commercial use.
var timerID; // timer handle for set time out usage
var st; // holds the stream object when loading.
@Mr-Bossman
Mr-Bossman / install.sh
Created January 15, 2022 21:15
termux ccminer
pkg install git nano automake build-essential libjansson
git clone --single-branch -b ARM https://github.com/monkins1010/ccminer.git
cd ccminer
chmod +x build.sh
chmod +x configure.sh
chmod +x autogen.sh
./build.sh
./run