Skip to content

Instantly share code, notes, and snippets.

View oddmario's full-sized avatar

Mario oddmario

View GitHub Profile
@oddmario
oddmario / extract_original_audio.sh
Last active December 10, 2024 12:23
Extract the original audio track from a video using ffmpeg + ffprobe
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <input_file> <output_file>"
exit 1
fi
input="$1"
output="$2"
@oddmario
oddmario / WARP.md
Last active December 19, 2024 19:54
Stop routing all traffic through Cloudflare WARP and use it on-demand using the tunnel interface name instead

Stop routing all traffic through Cloudflare WARP and use it on-demand using the tunnel interface name instead

#!/bin/bash

# https://serverfault.com/questions/978701/setting-up-openvpn-as-an-interface-rather-than-routing-all-traffic-from-paid-vpn
# https://serverfault.com/questions/992624/vpn-client-doesnt-have-internet-connection

WARP_INTERFACE_NAME="CloudflareWARP"
@oddmario
oddmario / OPENVPN.md
Last active September 28, 2024 09:08
Stop routing all traffic through OpenVPN and use it on-demand using the tunnel interface name instead

Stop routing all traffic through OpenVPN and use it on-demand using the tunnel interface name instead

#!/bin/bash

# https://serverfault.com/questions/978701/setting-up-openvpn-as-an-interface-rather-than-routing-all-traffic-from-paid-vpn
# https://serverfault.com/questions/992624/vpn-client-doesnt-have-internet-connection

OVPN_TUN_INTERFACE_NAME="tun0"
@oddmario
oddmario / GRE_TUNNELS.md
Last active August 10, 2024 08:09
Setup a GRE tunnel between two Linux servers
@oddmario
oddmario / ANTI_MAGISK_ROOT_DETECTION.md
Last active February 9, 2025 13:01
Avoid Magisk root detection
@oddmario
oddmario / winefix.sh
Created July 13, 2024 11:09
Attempt to fix a corrupted Wineprefix
#!/bin/bash
killall -9 wine
mv ~/.wine ~/.winebak
wineboot
rm -rf ~/.wine/drive_*
mv -f ~/.winebak/drive_* ~/.wine
rm -rf ~/.wine/*.reg
mv -f ~/.winebak/*.reg ~/.wine
rm -rf ~/.winebak
@oddmario
oddmario / tune_go_http_server.md
Last active January 25, 2025 09:28
Tuning a Golang (Go) HTTP server

Tune a Go http.Server

by adjusting its default buffer sizes


In some situations, you may need to adjust the default buffer sizes of a Golang HTTP server.

Adjusting the default buffer sizes allows you to benefit from higher throughput and improve the performance of your HTTP servers overall.

For the cherry on the top,

Installing QEMU with the qemu-anti-detection patch

This procedure was done on an Ubuntu 24.04 system


Install the dependencies required for the building process:

sudo apt install git build-essential ninja-build python3-venv libglib2.0-0 libglib2.0-dev flex bison libpixman-1-dev libsdl2-dev libsdl2-image-dev mesa-common-dev libglfw3-dev libgles2-mesa-dev libgl-dev libepoxy-dev libpipewire-0.3-dev libspice-protocol-dev libspice-server-dev libvirglrenderer-dev libjson-c-dev libcmocka-dev libusbredirparser-dev libgtk-3-dev libusb-1.0-0-dev
@oddmario
oddmario / Backend example (NodeJS).js
Last active June 29, 2023 13:00
Send push notifications on your website using Firebase Cloud Messaging
const bodyparser = require("body-parser");
const express = require("express");
var admin = require("firebase-admin");
var serviceAccount = require("./serviceAccountFile.json");
// init
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
@oddmario
oddmario / AndroidManifest.xml
Last active June 27, 2023 13:41
Send push notifications in an Android app (Java) using Firebase Cloud Messaging
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application