Skip to content

Instantly share code, notes, and snippets.

View DavidBuchanan314's full-sized avatar
🌍
Hack the planet!

David Buchanan DavidBuchanan314

🌍
Hack the planet!
View GitHub Profile

Sometimes you need a 2048-bit RSA keypair for testing various things.

If you, like myself, have a child's sense of humor, I offer the following for your general use:

P = 19
Q = 1696986749729493925354392349339746171297507422986462747526968361144447230710192316397327889522451749459854070558277878297255552508603806832852079596337539247651161831569525505882103311631577368514276343192042634740927726070847704397913856975832811679847928433261678072951551065705680482548543833651752439700272736498378724153330763357721354498194000536297732323628263256733931353143625854828275237159155585342783077681713929284136658773985266864804093157854331138230313706015557050002740810464618031715670281442110238274404626065924786185264268216336867948322976979393032640085259926883014490947373494538254895109731

N = 0xFF69696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696
@nicolas17
nicolas17 / boostpp_math.c
Created November 4, 2020 18:05
Cursed boost.pp math
// SPDX-FileCopyrightText: 2020 Nicolás Alvarez <nicolas.alvarez@gmail.com>
//
// SPDX-License-Identifier: MIT
#include <boost/preprocessor.hpp>
// Utilities to convert from numbers (bytes) or words (highbyte,lowbyte pairs)
// into nibbles.
// a -> (a1,a0)
@DavidBuchanan314
DavidBuchanan314 / README.md
Last active January 21, 2024 04:03
Classic iPod software reinstall/restore without iTunes, on Linux

iTunes-less Classic iPod Restore Guide

I have tested this on a classic 4th-gen monochrome "clickwheel" iPod. I imagine this process works similarly for iPods of the same era. I'm not the first person to do this, but a lot of documentation is on dead wikis and is generally hard to come by.

Extract your firmware image from an .ipsw file, set the IPOD and FW_IMAGE variables in the bash script, and run it as root. Then cross your fingers.

If everything worked, the partition layout should look something like this:

Disk /dev/sdc: 119.08 GiB, 127865454080 bytes, 249737215 sectors
@probonopd
probonopd / Wayland.md
Last active May 7, 2024 00:24
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@DavidBuchanan314
DavidBuchanan314 / life.c
Last active August 9, 2023 23:12
Yet another reformatting of my tiny game of life implementation. Valid ANSI C with no (default) compiler warnings or UB
#define F\
for(i=l;i\
<l*4; i++)
main(){int
i,j,w=512,
n,l=w*w,o[
]={~w,-w,-
w+1,-1,1,w
-1,w,w+1},
b[l*5];F b
// Unscaled values for kOpsinAbsorbanceBias
const kB0 = 0.96723368009523958;
const kB1 = kB0;
const kB2 = kB0;
const kScale = 255.0;
const kScaleR = 1.0;
const kScaleG = 1.0;
const kInvScaleR = 1.0;
const kInvScaleG = 1.0;
@Treeki
Treeki / TurnipPrices.cpp
Last active April 5, 2024 13:55
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@enepomnyaschih
enepomnyaschih / base64.js
Last active March 6, 2024 23:45
https://www.npmjs.com/package/byte-base64 - Encode JS Uint8Array, simple array of bytes or native JS string to base64 and back
/*
MIT License
Copyright (c) 2020 Egor Nepomnyaschih
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@knightsc
knightsc / hijack.c
Created February 26, 2019 21:20
Example of how to hijack a thread on macOS to run code in a remote process
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <dlfcn.h>
#include <objc/runtime.h>
@justgerd
justgerd / 1_switchmemes.md
Last active September 25, 2019 15:26
ReSwitched #offtopic pins.

Accuracy of CTU simulating the Switch

Accuracy meme

Confused people

Switch to Linux distros

Accuracy of Mephisto emulating the Switch

Accuracy meme 2

Windows Update vs Switch Hacking