Skip to content

Instantly share code, notes, and snippets.

@onomatopellan
onomatopellan / waydroidwsl2.md
Last active December 11, 2025 22:35
Waydroid in WSL2 with sound (Weston on top of Weston approach)

Waydroid in WSL2 with sound

Requirements

Recommended to install Waydroid in a brand new Ubuntu 25.04 install. Waydroid needs a custom linux kernel. Actually just needs latest kernel for WSL2 with just these changes before compiling:

CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
@sghael
sghael / gist:6cba5c75a36ed271fa959c35e516e516
Last active November 11, 2024 10:47
Persistent WOL on Ubuntu 24.04
### Step-by-Step Guide
1. **Check for Active Connections:**
- Use `nmcli` to list active connections and identify the correct connection name:
```bash
nmcli connection show
```
2. **Edit the Connection Profile via nmcli:**
@almas
almas / ubuntu-on-mbp-a1707.md
Last active November 30, 2025 20:35 — forked from rob-hills/ubuntu-22.04-mbp-a1707.md
Ubuntu LTS on MacBook Pro 2017 (A1707, MBP 14,3)(T1 chip)

Summary

Notes to install Ubuntu 22.04.4LTS (Upgraded to 24.04LTS) up and running on my 2017 MacBook Pro 15 inch (MacBookPro14,3).

Now everything except the TouchID (Fingerprint), Suspend and Hibernation seems to work for me.

About Ubuntu 24.04LTS: I tried to install Ubuntu 24.04 and didn't have success. There was a crash issue during installation. https://bugs.launchpad.net/subiquity/+bug/2065310 But I installed 22.04 and upgraded it to the 24.04LTS later and it working same as 22.04.4.

Useful References (not mentioned in the text)

@NoCtrlZ1110
NoCtrlZ1110 / image_to_text.js
Created January 18, 2024 07:57
Extract text from image using Google Lens API
const fs = require('fs');
const axios = require('axios');
const FormData = require('form-data');
// Function to read the image file as a buffer
const readImageFile = (filePath) => {
return new Promise((resolve, reject) => {
fs.readFile(filePath, (err, data) => {
if (err) {
reject(err);
@0xdevalias
0xdevalias / decompile-apple-shortcuts.md
Last active November 8, 2025 09:14
A few notes on decompiling Apple Shortcuts workflows into their raw XML 'source code'.
@Paraphraser
Paraphraser / Checking your Raspberry Pi's view of its power supply.md
Last active November 15, 2025 09:50
Checking your Raspberry Pi's view of its power supply (sometimes it's not the wall-wart)

Checking your Raspberry Pi's view of its power supply

Sometimes it seems like the first (and sometimes only) advice you get offered for almost any problem with a Raspberry Pi is "check your power supply". You think something like:

"hey, I'm using an official power supply sold as being matched with my Pi so how can there be any problem?"

You look up the specs then stick a controlled load across your supply and confirm that it can deliver the required number of Watts.

Yet your problems persist…

@ynkdir
ynkdir / clangdump.py
Last active August 25, 2022 11:24
Python bindings for Win32 API generated using clang
import sys
import clang.cindex
clang.cindex.Config.set_library_path(r'C:\Program Files\LLVM\bin')
def visit(cursor, indent):
print("%s[KIND:%s] { extent: { File:%s, start:{ l:%d, c:%d }, end {l:%d, c:%d } } , spelling:%s, type:{ kind:%s, spelling:%s } }" % (
' ' * indent,
cursor.kind.name,
cursor.extent.start.file,
@eyecatchup
eyecatchup / calc-sapisidhash.js
Last active November 23, 2025 10:24
Calculate SAPISIDHASH
// Generates the SAPISIDHASH token Google uses in the Authorization header of some API requests
async function getSApiSidHash(SAPISID, origin) {
function sha1(str) {
return window.crypto.subtle.digest("SHA-1", new TextEncoder("utf-8").encode(str)).then(buf => {
return Array.prototype.map.call(new Uint8Array(buf), x=>(('00'+x.toString(16)).slice(-2))).join('');
});
}
const TIMESTAMP_MS = Date.now();
const digest = await sha1(`${TIMESTAMP_MS} ${SAPISID} ${origin}`);
@bmatthewshea
bmatthewshea / certbot_pip_install-debian_ubuntu.md
Last active October 23, 2025 22:13
Debian/Ubuntu - CERTBOT without SNAP/SNAPD

CERTBOT - Install using Python PIP

Install Certbot using Python PIP (Package Installer for Python) - without using SNAP, APT or SYSTEMD. (Debian/Ubuntu)


This guide will help you install LetsEncrypt / Certbot using venv PIP under Debian/Ubuntu.

  • This guide has been tested up to Debian 12 / Bookworm.
@Tocchann
Tocchann / RunMessageLoop_MsgWaitForMultipleObjects.cpp
Last active August 3, 2022 13:21
MsgWaitForMultipleObjects の例
#include <map>
#include <functional>
// waitActions に登録する例は載せていない(通常は、排他制御して追加処理するのが良い)
std::map<HANDLE, std::function<bool(bool,bool&)>> waitActions;
DWORD APIENTRY SetupWaitHandles( HANDLE* waitHandles, DWORD capacityCount )
{
DWORD waitCount = 0;
if( capacityCount > 0 )
{