Skip to content

Instantly share code, notes, and snippets.

📘 How to Retrieve GitHub Release Tags and Assets Programmatically Using the GitHub API

GitHub provides a comprehensive REST API that enables developers to programmatically access information about repositories, releases, and downloadable assets. This is especially useful for automating software distribution, checking version histories, or integrating with CI/CD pipelines.

Below is an explanation of how to retrieve release-related data—including specific release assets and all available tags—from a GitHub repository using various API endpoints.


🔹 1. Get the Latest Release

Embedding Library Search Paths into Binaries with GCC on Linux

It's possible to embed absolute paths for shared libraries into ELF executables (or shared objects) using dynamic tags such as DT_RPATH or DT_RUNPATH. The GNU ld linker (invoked by gcc or g++) supports several methods to achieve this.

1. Embedding Absolute Paths at Link Time

g++ main.cpp -o app \
    -Wl,-rpath,/opt/mylibs           # Writes /opt/mylibs into DT_RPATH

Converting .a to .so

Use the .o files inside the .a archive to create a .so

  1. Extract the .a archive:

    ar x libsomething.a

netns ipvlan L3 NAT

This Bash script sets up and tears down a network namespace using ipvlan (L3 mode) and NAT on a Linux system.

It has two main commands:

setup

  • Creates a new network namespace (a separate network environment).
  • Adds two ipvlan interfaces (host side and namespace side).

iOS open url with youtube app

iOS Rain Notifier

End-to-End Workflow for Exporting a Public iOS Shortcut as JSON


1. Publish the Shortcut

  1. Open Shortcuts .app → long-press the shortcut → ShareCopy iCloud Link. Example link:

Binding Functions with Frida Gum (x86 / x86-64)

Purpose Generate at run-time a zero-argument function that always calls a given 2-argument function with two fixed constants, using Frida Gum’s GumX86Writer.

Build (Linux example)

g++ bound_function.cpp -o bound -I./frida -L./frida -lfrida-gum

Frida Gum Function Hook Example

The program demonstrates how to intercept (“hook”) a C function at runtime with Frida Gum. install_hook() replaces the original func() with my_func(), while keeping a pointer (orig_func) so the genuine implementation can still be called. After the test call, remove_hook() cleans everything up and de-initialises Frida.

Build

We need frida-gum-devkit. Please access frida/releases.

WebGPU compute shader examples

Purpose

Demonstrates how to perform GPU compute shader in the browser using the WebGPU API.

How to run

  1. Prerequisites: A recent Chromium-based browser (Chrome ≥ 113, Edge, etc.) with the “WebGPU” feature enabled.
  2. Launch: Prepare an https web server to serve the html. open html via a web server. The protocol should be https://.