Skip to content

Instantly share code, notes, and snippets.

View Killaship's full-sized avatar

William Killaship

View GitHub Profile
@Killaship
Killaship / main.c
Created November 14, 2022 03:31
mac-vm
/*
Killaship
2022
November 13th, ~10:30 PM EST
This took like an hour or two to make, WITH a tutorial and previous experience!
A VM following the specifications of the 'mac' architecture, as outlined in this blog:
https://felix.engineer/blogs/virtual-machine-in-c/
I was pretty tired while writing this, so the code might suck.
Hell, I typed & instead of % twice and was wondering for minutes about it!
I started work on this at ~ 9:15, I recorded the progress.
@Killaship
Killaship / brainfuck.c
Created October 2, 2022 15:22
I have no idea why it's broken
// Copyright Killaship (C) 2022
// Informally, this is under the MIT licence, where basically you can do whatever, just give me credit.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PROG_SIZE 30000
unsigned char dcells[30000];
unsigned char program[PROG_SIZE];
int data = 0;
int instr = 0;
#pragma once
#include<iostream>
#include<vector>
#include<stack>
class Interpreter
{
public:
static void Run(std::string input)
@Killaship
Killaship / dump.asm
Last active September 5, 2021 14:34
Dump Registers in A boot sector
; https://github.com/appusajeev/os-dev-16/blob/master/reg.asm
; This code is a slightly modified version of the above.
; This code dumps the registers in a single boot sector.
; Compile and run with the 2 following commands:
; nasm -f bin dump.asm -o dump
; qemu-system-i386 -fda dump
; You can also do it without -fda if you hate floppy disks for some reason.
// This post referred to this git. I just trimmed cam and wifi part.
// https://github.com/v12345vtm/CameraWebserver2SD/blob/master/CameraWebserver2SD/CameraWebserver2SD.ino
#include "FS.h"
#include "SD_MMC.h"
//List dir in SD card
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
Serial.printf("Listing directory: %s\n", dirname);
@rfong
rfong / I2C_SSD1306_ipaddr.py
Last active April 4, 2024 02:09
Display my IP address on an I2C OLED screen #raspberrypi #gpio
""" Display my IP address on an I2C OLED screen connected over GPIO """
import socket
import time
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import Adafruit_GPIO.SPI as SPI
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 17, 2024 04:56 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active November 7, 2024 05:04
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@Protoneer
Protoneer / SerialEcho
Created September 18, 2014 18:51
Serial Echo On Arduino
/*
* serial_echo.pde
* -----------------
* Echoes what is sent back through the serial port.
*
* http://spacetinkerer.blogspot.com
*/
int incomingByte = 0; // for incoming serial data