Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Fiddling with emulation/patching between schoolwork.

Max Thomas shinyquagsire23

💭
Fiddling with emulation/patching between schoolwork.
View GitHub Profile
@shinyquagsire23
shinyquagsire23 / t210.cfg
Last active May 28, 2021
Tegra X1 T210 OpenOCD JTAG config for Jetson Nano/TX1
View t210.cfg
#
# OpenOCD configuration for Tegra X1 (T210)
# by shinyquagsire23
# For use on Jetson Nano/TX1 and similar
#
transport select jtag
adapter speed 3000
reset_config trst_and_srst
jtag_ntrst_delay 500
View dsi-panel-souxp00_a-amb650wh07-uhd.dtsi
&mdss_mdp {
/* Samsung 4K OLED ID9 */
dsi_9: somc,9_panel {
qcom,dsi-ctrl-num = <0>;
qcom,dsi-phy-num = <0>;
qcom,dsi-select-clocks = "mux_byte_clk0", "mux_pixel_clk0";
qcom,mdss-dsi-panel-name = "9";
qcom,mdss-dsi-panel-type = "dsi_cmd_mode";
qcom,mdss-pan-physical-width-dimension = <65>;
@shinyquagsire23
shinyquagsire23 / image-extract.py
Created Jun 1, 2020
LG raw_resources image extraction
View image-extract.py
import struct
import imageio
import numpy as np
import sys
if len(sys.argv) < 2:
print ("Usage: image-extract.py [raw_resources_a.image]")
exit(0)
f = open(sys.argv[1], "rb")
@shinyquagsire23
shinyquagsire23 / imagedata-extract.py
Created Jun 1, 2020
Nexus 5 imagedata extraction
View imagedata-extract.py
import struct
import imageio
import numpy as np
import sys
if len(sys.argv) < 2:
print ("Usage: image-extract.py [imgdata.image]")
exit(0)
f = open(sys.argv[1], "rb")
@shinyquagsire23
shinyquagsire23 / colors.py
Created Mar 14, 2020
Extracting prominent color gradients from an image
View colors.py
import imageio
import numpy as np
import cv2
q = "20191230_221836_HDR.jpg"
r = "legs.png"
im = np.array(imageio.imread(r))
im_orig = im
dims = im.shape
View lg_getkdz.py
from Crypto.Cipher import AES
from Crypto import Random
import base64
import requests
import xml.etree.ElementTree as ET
block_size = AES.block_size
unpad = lambda s : s[0:-ord(s[-1])]
@shinyquagsire23
shinyquagsire23 / surfacego-touchscreen
Created Jan 12, 2020
Surface Go ChromeOS touchscreen fix - on-wake script and upstart daemon config
View surfacego-touchscreen
#!/bin/bash
# copy to /usr/sbin
interface=org.chromium.PowerManager
member=SetPolicy
# Run once just to be sure
echo "Surface Go fix daemon start..." > /dev/kmsg
echo "on" > /sys/devices/pci0000:00/0000:00:15.1/i2c_designware.1/power/control
@shinyquagsire23
shinyquagsire23 / gist:f7907fdf6b470200702e75a30135caf3
Created Jan 8, 2020
Philips Hue BLE Services and Characteristics (WIP)
View gist:f7907fdf6b470200702e75a30135caf3
DeviceInfo(softwareRevision, isOn,
SceneLightState(color, powerOnBehavior, deviceInfo
Light(id,
Capabilities(dimmable, customState
PowerOnBehavior(option
hueplay, huebloom, hueiris, huelightstrip, huego, plug, bollard, wallspot, groundspot, flexiblelamp, wallshade, walllantern
[ea:44:13:bd:db:59] Service [b8843add-0000-4aa1-8794-c3f462030bda] Unknown, ble_firmware_update?
[ea:44:13:bd:db:59] Characteristic [b8843add-0004-4aa1-8794-c3f462030bda]
View qt5-pen-tilt-rotation.diff
diff -r /home/maxamillion/workspace/qt5_compare/qt-everywhere-src-5.12.2/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtNative.java ./qtbase/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
491a492,495
> float tiltRot = event.getAxisValue(MotionEvent.AXIS_TILT);
> float orientation = event.getAxisValue(MotionEvent.AXIS_ORIENTATION);
> float tiltX = (float) Math.toDegrees(-Math.sin(orientation) * tiltRot);
> float tiltY = (float) Math.toDegrees(Math.cos(orientation) * tiltRot);
493c497
< event.getButtonState(), event.getX(), event.getY(), event.getPressure());
---
> event.getButtonState(), event.getX(), event.getY(), event.getPressure(), tiltX, tiltY, (float)Math.toDegrees(orientation));
View gist:291a16f1b5fa3b555f8a9da7692b72ce
Based somewhat on http://www.nicholasmelnick.com/2019/02/installing-chromeos-on-surface-go/
EDIT April 11, 2020: Happy to report that a lot of this isn't necessary any more! https://github.com/sebanc/brunch seems to work
perfectly with the Surface Go using the dual boot option and rEFInd, no adjustments needed. Even fixes autorotation, which I hadn't
gotten working.
# Get chromefy stuff
git clone https://github.com/imperador/chromefy.git
cd chromefy