Skip to content

Instantly share code, notes, and snippets.

View iscle's full-sized avatar
🎢
Having fun!

Iscle iscle

🎢
Having fun!
View GitHub Profile
@iscle
iscle / gist:1fcb951787ec449fe04ec0dee134fe88
Created January 31, 2024 02:44
iPhone 5,2 (N42AP) device tree
Device Tree with 17 properties and 16 children
Properties:
device-tree:
| +--compatible 25 bytes: N42AP 0x4e 0x34 0x32 0x41 0x50 0x00 0x69 0x50 0x68 0x6f 0x6e 0x65 0x35 0x2c 0x32 0x00 0x41 0x70 0x70 0x6c 0x65 0x41 0x52 0x4d 0x00
| +--secure-root-prefix 3 bytes: md 0x6d 0x64 0x00
| +--AAPL,phandle 4 bytes: (nul 0x00 0x00 0x00 0x01
| +--config-number 32 bytes: (null) 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
| +--model-number 32 bytes: (null) 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
| +--firmware-min-capacity 4 bytes: (nul 0x00 0x00 0x18 0x00
| +--platform-name 32 bytes: (null) 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
@iscle
iscle / gist:66e946553e74a883b4494d3b6df0ee82
Last active October 23, 2024 17:41
Install python2.7 on Ubuntu 23.04 as "python"
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar xzf Python-2.7.18.tgz
cd Python-2.7.18
sudo ./configure --enable-optimizations
sudo make altinstall
sudo ln -s "/usr/local/bin/python2.7" "/usr/bin/python"
@iscle
iscle / gist:4ec7bc80a1adaddbcfe41d931dff672e
Last active February 23, 2023 23:44
Trackmania United Forever
Download link: http://files.trackmaniaforever.com/tmunitedforever_setup.exe
Serial: DKTJ-A5WG-8B5K-H5AA-BWA
@iscle
iscle / forfan_upd_extractor.c
Created February 7, 2023 00:28
Extract ForFan Android HU update files
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
static void *mmap_file(const char *file_path) {
@iscle
iscle / fbx_binary_specification.md
Last active April 26, 2022 18:05
Autodesk FBX Binary Specification

Autodesk FBX Binary Specification (unofficial)

Finding updated documentation on the binary format for FBX can be quite hard. After looking through various parsers from various open-source projects, I decided to write this short specification with the new and updated information I found.

NOTE: This is still a work in progress, although all values being shown should be correct.

Binary header

Size: 27 bytes

Offset (bytes) Description Value
0 - 20 File magic (string + 2 spaces + NULL terminator) Kaydara FBX Binary \0
GLFW:
export NDK=<path_to_ndk_root>
export NDK=/home/iscle/Documents/android-ndk-r21d
// In the following command, boat headers are missing
cmake .. -DANDROID_PLATFORM=21 -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DGLFW_USE_BOAT=ON
GL4ES:
cmake .. -DANDROID_PLATFORM=21 -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake
LWJGL:
@iscle
iscle / gist:aa535d268a22cbdfc9567444963c1661
Created July 1, 2019 23:53
Building LineageOS 14.1 in Ubuntu 18.04
. build/envsetup.sh
export LC_ALL=C
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx7G"
brunch lineage_devicename-eng
package me.iscle.lemfoconnect_watch;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
if (isChecked) {
try {
Runtime.getRuntime().exec("su -c echo 1 > /sys/bus/i2c/devices/3-0038/wakeup_mode");
editor.putBoolean("dt2w_toggle", true).apply();
} catch (IOException e) {
e.printStackTrace();
}
} else {
try {
Runtime.getRuntime().exec("su -c echo 0 > /sys/bus/i2c/devices/3-0038/wakeup_mode");
#include <RF24.h>
#include <SPI.h>
#include <VESC.h>
//#define DEBUG
typedef struct {
uint8_t x;
uint8_t y;
bool c;