Skip to content

Instantly share code, notes, and snippets.

View 0xD34D's full-sized avatar

Clark Scheff 0xD34D

View GitHub Profile
@0xD34D
0xD34D / TFTRLE2RGB565.py
Last active March 12, 2024 01:05
Python script to convert TJC TFT RLE encoded images to raw RGB565
import argparse
import os
from pathlib import Path
import struct
if __name__ == "__main__":
desc = """TFT RLE to RGB5656 image converter
Developped by Clark Scheff, licensed under GPLv3"""
parser = argparse.ArgumentParser(description=desc)
@0xD34D
0xD34D / 64x64_rgb565_image.dat
Created March 7, 2024 19:02
TJC3224T132_011N compressed image from .tft file
0000:0000 | 01 00 00 00 14 05 00 00 00 00 00 00 00 00 00 00 | ................
0000:0010 | 00 00 00 00 FE F3 2F 00 00 F8 00 F8 00 F8 E0 07 | ....þó/..ø.ø.øà.
0000:0020 | E0 07 E0 07 80 AB 38 01 FE F3 2F 00 00 F8 00 F8 | à.à..«8.þó/..ø.ø
0000:0030 | 00 F8 E0 07 E0 07 E0 07 80 AB 38 01 FE F3 2F 00 | .øà.à.à..«8.þó/.
0000:0040 | 00 F8 00 F8 00 F8 E0 07 E0 07 E0 07 80 AB 38 01 | .ø.ø.øà.à.à..«8.
0000:0050 | FE F3 2F 00 00 F8 00 F8 00 F8 E0 07 E0 07 E0 07 | þó/..ø.ø.øà.à.à.
0000:0060 | 80 AB 38 01 FE F3 2F 00 00 F8 00 F8 00 F8 E0 07 | .«8.þó/..ø.ø.øà.
0000:0070 | E0 07 E0 07 80 AB 38 01 FE F3 2F 00 00 F8 00 F8 | à.à..«8.þó/..ø.ø
0000:0080 | 00 F8 E0 07 E0 07 E0 07 80 AB 38 01 FE F3 2F 00 | .øà.à.à..«8.þó/.
0000:0090 | 00 F8 00 F8 00 F8 E0 07 E0 07 E0 07 80 AB 38 01 | .ø.ø.øà.à.à..«8.
@0xD34D
0xD34D / tjc3224T132_header2_decrypter.py
Created March 5, 2024 19:31
Ugly python code to decrpyt header2 from tjc.tft files
import argparse
from pathlib import Path
import struct
NONCE = struct.pack("III", 0x92930f5e, 0x924f6584, 0xfbad3bbf)
KEY = struct.pack("II", 0x582659b6, 0xbd829c9c)
if __name__ == "__main__":
desc = """TFT header2 decoder
Developped by Clark Scheff, licensed under GPLv3"""
@0xD34D
0xD34D / gist:31b78144c7e29e0141c4696999c7af48
Created January 16, 2024 03:58
strings prtouch_v2_wrapper.cpython-38-mipsel-linux-gnu.so
init extras.prtouch_v2_wrapper
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_SELF_CHECK_PRTOUCH
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_TRIG_TEST
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_ACCURATE_HOME_Z
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_SAFE_MOVE_Z
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_PRTOUCH_READY
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_START_STEP_PRTOUCH
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_CHECK_BED_MESH
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_NOZZLE_CLEAR
extras.prtouch_v2_wrapper.PRTouchEndstopWrapper.cmd_DEAL_AVGS
@0xD34D
0xD34D / print_start.cfg
Created December 7, 2023 01:51
e3v3se klipper print_start macro
[gcode_macro PRINT_START]
variable_parameter_EXTRUDER_TEMP: 200
variable_parameter_BED_TEMP: 60
gcode:
G28 ; home all axes
BED_MESH_CLEAR
PRTOUCH_PROBE_ZOFFSET APPLY_Z_ADJUST=1 CLEAR_NOZZLE=1
M106 S255
M104 S{params.EXTRUDER_TEMP} ; set extruder temp
M190 S{params.BED_TEMP} ; set bed temp and wait
@0xD34D
0xD34D / runout.cfg
Created September 9, 2023 02:11
Filament sensor config for Ender-3 v3 SE hooked up to z-limit port
[filament_switch_sensor RunoutSensor]
switch_pin: ^PA15
pause_on_runout: True
pause_delay: 3.0
runout_gcode: PAUSE
#insert_gcode: RESUME
@0xD34D
0xD34D / generate_comic_book.py
Last active January 9, 2019 21:12
Generate .cbz comic books from readcomics.tv
#!/usr/bin/env python3
from lxml import html
import os
import requests
import shutil
import sys
from urllib import request
from zipfile import ZipFile
AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'
@0xD34D
0xD34D / battery_meter_demo.sh
Created August 16, 2016 15:21
battery meter demo for CM
#!/bin/bash
adb shell 'dumpsys batterymanager unplug;settings --cm put system status_bar_battery_style 0;sleep 0.5;for i in $(seq 100 -1 16);do dumpsys batterymanager set level $i;sleep 0.05;done;for i in $(seq 16 100);do dumpsys batterymanager set level $i;sleep 0.05;done;settings --cm put system status_bar_battery_style 5;sleep 0.5;for i in $(seq 100 -1 16);do dumpsys batterymanager set level $i;sleep 0.05;done;for i in $(seq 16 100);do dumpsys batterymanager set level $i;sleep 0.05;done;settings --cm put system status_bar_battery_style 2;sleep 1;for i in $(seq 100 -1 16);do dumpsys batterymanager set level $i;sleep 0.05;done;for i in $(seq 16 100);do dumpsys batterymanager set level $i;sleep 0.05;done;dumpsys batterymanager reset'
@0xD34D
0xD34D / MotionDetectorTest.cpp
Last active August 29, 2015 14:15
Program for testing a PIR module on the Intel Edison
/*
* Author: Clark Scheff <clark@scheffsblend.com>
* Copyright (c) 2015 Scheff's Blend
*
* 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 furnished to do so, subject to
function wordwrap( str, width, brk, cut ) {
brk = brk || '\n';
width = width || 75;
cut = cut || false;
if (!str) { return str; }
var regex = '.{1,' +width+ '}(\\s|$)' + (cut ? '|.{' +width+ '}|.+$' : '|\\S+?(\\s|$)');
matches = str.match( new RegExp(regex, 'g') );