Skip to content

Instantly share code, notes, and snippets.

@marcus-j-davies
marcus-j-davies / build.js
Last active July 7, 2024 13:08
Node Red V4 - SFE (Single File Executable)
const esbuild = require('esbuild');
const { cp, readFile, writeFile } = require('fs/promises');
const { exists } = require('fs-extra');
const OutputDIR = './build';
const InputFile = `./main-source.js`;
const OutputFile = `${OutputDIR}/node-red.js`;
const FinalPKG = `${OutputDIR}/package.json`;
const GotSourceFile = './node_modules/got/dist/source/index.js';
const GotPackageFile = './node_modules/got/package.json';
@skrimix
skrimix / pixel_kernelsu_patch.sh
Last active March 23, 2024 07:52
boot.img repack script for KernelSU. Supports extracting boot.img from factory and OTA images
#!/bin/bash
set -e
# This script creates a patched boot.img with KernelSU GKI kernel and cmdline tweaks
SCRIPT_PATH="$(dirname "$(realpath -s "$0")")"
MAGISKBOOT="$SCRIPT_PATH"/magiskboot
MAGISK_VER="v26.1" # used for downloading magiskboot, newer versions print "unexpected ASN.1 DER tag: expected SEQUENCE, got APPLICATION [1] (primitive)" warning(?)
ANYKERNEL_FILE_NAME="CHANGE_ME" # for downloading from the latest KernelSU github release, e.g. "AnyKernel3-android13-5.10.157_2023-03.zip"

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot

@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active July 22, 2024 16:41
Hacking the LG Monitor's EDID

preface: Posting these online since it sounds like these notes are somewhat interesting based on a few folks I've shared with. These are semi-rough notes that I basically wrote for myself in case I ever needed to revisit this fix, so keep that in mind.

I recently bought an LG ULTRAGEAR monitor secondhand off of a coworker. I really love it and it's been great so far, but I ran into some minor issues with it in Linux. It works great on both Mac and Windows, but on Linux it displays just a black panel until I use the second monitor to go in and reduce the refresh rate down to 60 Hz.

This has worked decent so far but there's some issues:

  • It doesn't work while linux is booting up. The motherboards boot sequence is visible just fine, but as soon as control is handed over to Linux and I'd normally see a splash screen while I'm waiting for my login window, I see nothing.
  • It doesn't work on the login screen. This would be fine if login consistently worked on my second screen, but I need to manually switch
@7enderhead
7enderhead / 6x4.py
Created April 1, 2023 18:45
Create BIOS Master Password for Fujitsu Laptops (6x4 Digit Version) - Python 3 Compatible
#!/usr/bin/python
# Copyright 2009: dogbert <dogber1@gmail.com>
# Copyright 2023: 7enderhead (https://github.com/7enderhead/)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@nguyendung17
nguyendung17 / android-backup-apk-and-datas.md
Created December 23, 2022 04:18 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

function UninstallLicenses($DllPath) {
$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2).DefineType(0)
[void]$TB.DefinePInvokeMethod('SLOpen', $DllPath, 22, 1, [int], @([IntPtr].MakeByRefType()), 1, 3)
[void]$TB.DefinePInvokeMethod('SLGetSLIDList', $DllPath, 22, 1, [int],
@([IntPtr], [int], [Guid].MakeByRefType(), [int], [int].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128)
[void]$TB.DefinePInvokeMethod('SLUninstallLicense', $DllPath, 22, 1, [int], @([IntPtr], [IntPtr]), 1, 3)
$SPPC = $TB.CreateType()
$Handle = 0
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created October 31, 2022 12:31
Simple bash script to create a Bootable ISO from macOS Ventura Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
# Change this at your desire. Sometimes this works out of the box, sometimes not.
# Default size: ~16 GB
DISK_SIZE="15361m"
@JonnyTech
JonnyTech / mkwinusb.sh
Last active August 13, 2023 20:29
Create bootable Windows installer drive from Linux
#!/bin/bash
die(){
echo -e "\n$1"
echo -e "\nUsage: $0 /path/to/windows.iso /path/to/usb [gpt|mbr] [full|quick]\n"
exit
}
[ "$(id -u)" != "0" ] && die "You must be root to run this script"
[ -f "$1" ] && iso="$1" || die "Error: File $1 does not exist"
[ -e "$2" ] && usb="$2" || die "Error: Drive $2 not present"
[[ ${3,,} = "mbr" ]] && { mode=1; echo "Mode: MBR"; } || { mode=0; echo "Mode: GPT"; }
@sinofool
sinofool / install_unifi_8_debian_12.txt
Last active June 7, 2024 21:53
Install Unifi Controller on Debian 11 (Bullseye)
# libssl1.1, the only missing mongodb dependency.
# I prefer enable oldstable in case this get backport security patches
echo "deb http://deb.debian.org/debian bullseye main" | sudo tee /etc/apt/sources.list.d/oldstable-bullseye.list
# MongoDB 4.4, [end of life Feb 2024](https://www.mongodb.com/support-policy/lifecycles)
curl -fsSL https://pgp.mongodb.com/server-4.4.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-4.4.gpg --dearmor
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-4.4.gpg ] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update && sudo apt-get install mongodb-org-server -y
# Unifi