Skip to content

Instantly share code, notes, and snippets.

@ilsubyeega
ilsubyeega / 0001-drm-fourcc-add-amd-gfx6-8-modifiers.patch
Created June 5, 2026 16:13
GeForce Now with NixOS+RX470. (upstream linux does not support vulkan video encoding so it must hack the kernels instead)
kernel driver, and the last ones that didn't support
DRM format modifiers until now.
On GFX6-8, the GFX block can only use pre-determined tiling
modes which are programmed by the kernel according to the
tiling mode table. GFX6 uses the GB_TILE_MODE0...31 registers,
and GFX7-8 also has GB_MACROTILE_MODE0...15 registers.
DCC is also supported on GFX8, albeit not displayable.
Note that the tiling table is uAPI and userspace relies on
const int LED1 = PA1; // interrupt
const int LED2 = PA2; // 상시-주기적 toggling LED
const int BTN_LED = PB12; // -> LED1
const int BTN_MOTOR = PB13; // MOTOR_{A,B}
const int MOTOR_A = PA6;
const int MOTOR_B = PA7;
void handleLedISR() {
digitalWrite(LED1, digitalRead(BTN_LED));
@ilsubyeega
ilsubyeega / MEMO-G-decrypted.rs
Created November 17, 2025 11:15
com.gion.android.GnMemoG sqlite database file decryption;
use aes::{
Aes128, Aes128Dec,
cipher::{ArrayLength, BlockDecryptMut, KeyInit, consts::U16, generic_array::GenericArray},
};
use pkcs5::pbes1::DigestAlgorithm;
use sha1::{Digest, Sha1};
use std::{
fs::File,
io::{Read, Write},
};
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
{
description = "Build configuration for brave browser";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
};
outputs = { nixpkgs, ... }@inputs: let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
alacritty -e "bash" "-c" "echo hi && sleep 10" &
PROCESSID=$!
sleep 0.1
WINDOW_ID=$(echo "\"Windows\"" | socat STDIO "$NIRI_SOCKET" | jaq '.Ok | .[] | map(select(.pid == '"$PROCESSID"')) | .[].id')
echo $WINDOW_ID
echo '{"Action":{"MoveWindowToWorkspace":{"window_id":'"$WINDOW_ID"', "reference": {"Index":2}, "focus": false}}}' | socat STDIO "$NIRI_SOCKET"
@ilsubyeega
ilsubyeega / gnome
Created May 25, 2025 10:43
wayland interfaces between gnome shell and niri
interface: 'wl_compositor', version: 6,
interface: 'wl_subcompositor', version: 1,
interface: 'wl_drm', version: 2,
interface: 'wl_shm', version: 2,
interface: 'wl_output', version: 4,
interface: 'wl_data_device_manager', version: 3,
interface: 'wl_seat', version: 8,
interface: 'wp_viewporter', version: 1,
interface: 'wp_fractional_scale_manager_v1', version: 1,
// from https://github.com/firebase/firebase-js-sdk/blob/ea1f9139e6baec0269fbb91233fd3f7f4b0d5875/packages/installations/src/helpers/generate-fid.ts#L20
const fidByteArray = new Uint8Array(17);
self.crypto.getRandomValues(fidByteArray);
fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000)
const fid = btoa(String.fromCharCode(...fidByteArray)).replace(/\+/g, '-').replace(/\//g, '_').substr(0,22);
/^[cdef][\w-]{21}$/.test(fid)

db설계

노션과 같이 flexible하고 CRM 목적 데이터베이스 만들어야만 함 Local-First일수도 있고 아닐수도 있고. Collaborative 해야 할 수도 있고 아닐수도 있고 User-Friendly, Developer-Friendly 일수도 있고 아닐수도 있고

이름 정의

Collection, Document, Field.

  • Collection: 데이터베이스의 테이블과 같은 개념
  • Document: 데이터베이스의 레코드와 같은 개념
  • Field: 데이터베이스의 컬럼과 같은 개념
use mpv::FrameTimeInfo;
use std::process;
mod mpv;
const VIDEO_URL: &str = "/home/sob/Downloads/2024-12-09_23-11-21-00.22.12.245-00.22.40.000.mp4";
#[tokio::main]
async fn main() {
// Arg parsing
let args = std::env::args().collect::<Vec<String>>();