Skip to content

Instantly share code, notes, and snippets.

View foone's full-sized avatar

Foone Turing foone

View GitHub Profile
@foone
foone / ASCII.BAS
Created February 20, 2017 21:48
ASCII Table on a MDA monochrome adapter
SCREEN 0, 0
CLS
DEF SEG = &HB000
FOR y = 0 TO 15
FOR x = 0 TO 15
addy = x * 4 + y * 160
POKE addy, x + y * 16
POKE 1 + addy, 10
POKE addy + 2, x + y * 16
POKE 3 + addy, 2
@foone
foone / mkdosfloppy.sh
Created June 8, 2017 18:54
Create a floppy image from some files
#!/bin/bash
set -e
set -x
IMGFILE=$1
CONTENTS=$2
TMPIMG=$(mktemp -u -t XXXXXXXXX.img)
mkfs.fat -D 0 -M 0xF0 -C $TMPIMG 1440
from PIL import Image
from struct import pack,unpack
from random import randint
import pdb
import sys
im=Image.open(sys.argv[1])
colors={}
for i in range(256):
r,g,b = unpack('3B',im.palette.palette[i*3:i*3+3])
@foone
foone / pck_extract.py
Created June 21, 2018 06:37
An extractor for PCK datafiles as used by ring^-27 by TEMPERANCE LANCE
import sys
from struct import unpack
with open(sys.argv[1],'rb') as f:
if f.read(4)!='.pck':
print 'invalid header!'
sys.exit()
while True:
chunk_header=f.read(8)
if not chunk_header:
break
@foone
foone / passwords.txt
Created September 21, 2018 16:02
Decoded passwords for the Cosmi Multi Media CD MASCD-35
Software: 3D Virtual Reality RoomPlanner
Boxed password: USE THIS
Jewelcase password: TAKE SHAPE
Software: Label Publisher with Wizards
Boxed password: RESTART
Jewelcase password: PRINT
Software: Garden Architect
Boxed password: THIS TUTORIAL
@foone
foone / fooneRotate.py
Created March 2, 2018 21:43
variant on mTesseracted's voxel script
'''
=====================================
Rotating 3D voxel animation of PYTHON
=====================================
Demonstrates using ``ax.voxels`` with uneven coordinates
'''
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
@foone
foone / fix-wesdar-buttons.sh
Last active April 3, 2019 09:32
Script to fix the button mapping for the Wesdar X5 USB Mouse's side buttons.
#!/bin/sh
# If a Wesdar X5 USB Mouse is detected, fix the mapping of the left and right keys.
# Tested on xubuntu 18.10
USB_ID='258a:0017'
if lsusb | grep -q $USB_ID
then
echo 'found'
xmodmap -e 'pointer = 1 2 3 4 5 6 7 9 8 10 11 12'
fi
@foone
foone / weirdzip.py
Created February 11, 2020 14:54
WeirdZip: identify zipfiles with weird compression
from zipfile import ZipFile,BadZipfile
import sys
BORING_COMPRESSION = (0,1,2,3,4,5,6,8,14)
for path in sys.argv[1:]:
try:
zipf = ZipFile(path, 'r')
except BadZipfile:
continue
for info in zipf.infolist():
if info.compress_type not in BORING_COMPRESSION:
; Ender 3 Custom Start G-code
G28 ; Home all axes
G29 ; BLTouch homing
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
@foone
foone / settings.json
Created April 30, 2020 06:33
new-tab settings for Windows Terminal
{
"keybindings": [{
"command": "closeTab",
"keys": [
"ctrl+w"
]
},
{
"command": "newTab",
"keys": [