Skip to content

Instantly share code, notes, and snippets.

View fathonix's full-sized avatar
💭
I may be slow to respond.

Aldo Adirajasa Fathoni fathonix

💭
I may be slow to respond.
View GitHub Profile
@fathonix
fathonix / 0001-Remove-the-config.h-header-which-is-generated.patch
Created February 6, 2023 01:17
Debian GPSim Patch to Remove config.h
From c39da3038d9456663b17faa1606e87c5b16711ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <[email protected]>
Date: Sun, 8 Sep 2019 16:38:35 +0200
Subject: [PATCH] Remove the config.h header, which is generated and valid
during build from the source code, from the breakpoints.h header that is part
of the public API.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@fathonix
fathonix / update-syslinux
Last active September 16, 2023 07:58
Modified update-extlinux script to update syslinux configuration
#!/bin/sh
# Taken from https://git.adelielinux.org/adelie/packages/-/blob/abefa433c8e2199520e5a763e415e7ed4d60f551/legacy/syslinux/update-extlinux
# Modified for Legacy & UEFI Syslinux
version=
default=0
timeout=5
verbose=0
conf=/boot/syslinux/syslinux.cfg
@fathonix
fathonix / vtscan.sh
Last active January 5, 2024 04:17
Script to analyze macOS executable(s) with VirusTotal (unfinished)
#!/usr/bin/env bash
# Script to analyze macOS executable(s) with VirusTotal.
# Requires virustotal-cli and jq to be present in PATH.
# Licensed under MIT. (c) 2023-2024 Aldo Adirajasa Fathoni.
INPUT=$@
FILELIST=filelist.txt
TMPSCAN=vtscan.txt
TMPANLYS=vtanalysis.json
@fathonix
fathonix / findsym.sh
Created February 6, 2024 05:00
Print filename that contains the specified symbol
#!/usr/bin/env bash
# findsym.sh - Print filename that contains the specified symbol
# Usage: findsym.sh [symbol] [file ...]
# Licensed under MIT. (c) 2024 Aldo Adirajasa Fathoni
findsym() {
for f in ${@:2}; do
found=$(nm -a "$f" | \grep $1)
if [ $? -eq 0 ]; then
echo ${f}:
@fathonix
fathonix / README.md
Last active February 19, 2024 09:58
Make Zoom app links automatically open Zoom meeting on browser

Make Zoom app links automatically open Zoom meeting on browser

This trick automatically opens meeting on your browser without having to click "Join from Your Browser" manually, useful to save some space used by Zoom Desktop or run on unsupported platforms such as i386 and ARM.

There is a Chromium extension to do this, but this method works on any XDG-compliant browser without additional extensions and fearing your data collected by them.

@fathonix
fathonix / retouchid.sh
Created April 25, 2024 07:04
Script to enable PAM authentication with Touch ID on macOS
#!/bin/sh
# retouchid - Script to enable PAM authentication with Touch ID on macOS
# Licensed under MIT. (c) 2022 Aldo Adirajasa Fathoni
if grep -q pam_tid.so /etc/pam.d/sudo; then
echo "Already set. no need to update /etc/pam.d/sudo."
exit 0
fi
if [ $(id -u) = 0 ];then
@fathonix
fathonix / install.sh
Last active May 14, 2024 04:15
Install Apple Silicon-native Spleeter without Conda
#!/bin/bash -e
# Install Apple Silicon-native Spleeter without Conda
# Tested on macOS 14.1, M1 MBP, 2024-05-07
# Licensed under MIT. (c) 2024 Aldo Adirajasa Fathoni
# Assuming Xcode CLT and Homebrew have been installed
brew install [email protected] ffmpeg libsndfile
mkdir spleeter
python3.9 -m venv spleeter
source spleeter/bin/activate
@fathonix
fathonix / install.sh
Last active May 14, 2024 04:16
Install Rembg with CoreML support to use Neural Engine
#!/bin/bash -e
# Install Rembg with CoreML support to use Neural Engine
# Tested on macOS 14.1, M1 MBP, 2024-05-14
# Licensed under MIT. (c) 2024 Aldo Adirajasa Fathoni
# Assuming Xcode CLT and Homebrew have been installed
brew install [email protected]
mkdir rembg-env
/opt/homebrew/bin/python3.9 -m venv rembg-env
source rembg-env/bin/activate
@fathonix
fathonix / svgtocsv.py
Last active September 26, 2024 17:45
Python script to convert SVG to CSV containing starting and ending XY coordinates
#!/usr/bin/env python3
"""
Adapted from https://stackoverflow.com/a/65851533
The input SVG must be flattened/combined into single node/path first.
Recommended to optimize the SVG first with SVGO or Inkscape's Save As Optimized SVG.
First two columns are the starting coordinates and the second ones are the ending ones.
"""
from xml.dom import minidom
from svg.path import parse_path
@fathonix
fathonix / README.md
Created November 10, 2024 01:47
Use Android Phone as Microphone w/ Echo Cancellation on Linux with PipeWire + ROC

Use Android Phone as Microphone w/ Echo Cancellation on Linux with PipeWire + ROC

Follow this tutorial first on setting up ROC: https://gavv.net/articles/roc-0.4/

Instead of following the config file provided on the tutorial, use this config to route ROC source to a Loopback device and an Echo Cancel device.

Restart PipeWire afterwards:

systemctl restart --user pipewire.service