Skip to content

Instantly share code, notes, and snippets.

View francoism90's full-sized avatar
Cuddling the cat

François M. francoism90

Cuddling the cat
  • FoxWS
  • Netherlands
View GitHub Profile
francoism90 /
Created January 12, 2024 21:21
Limit CPU/memory using systemd
francoism90 / init-start
Created August 20, 2023 11:28
# Login into router using SSH and execute listed commands (AT OWN RISK!).
# To apply the settings on boot, copy + paste the same settings in init-start.
# Backup current settings
nvram dump > dump.txt
# Set country + TX-power
nvram set asuscfe0:ccode=US
nvram set asuscfe1:ccode=US
nvram set asuscfe0:regrev=0
francoism90 / auto-suspend.service
Created October 16, 2021 10:51
Autosuspend system
Description=Suspend system
ExecStart=/usr/bin/systemctl suspend
qemu-system-x86_64 -display gtk \
-boot c \
-enable-kvm -machine q35,accel=kvm \
-object rng-random,id=rng0,filename=/dev/urandom \
-device virtio-rng-pci,rng=rng0 \
-cpu host \
-smp $(nproc) \
-m 4G \
-drive id=disk,file=/run/media/archie/Data/Images/droid,if=none,format=raw \
francoism90 / power-on
Last active January 6, 2023 19:55
Prevents Thunderbolt/USB 3.1C suspend on my NUC
# force Thunderbolt/USB 3.1C power
# doc:
echo 1 > /sys/bus/wmi/devices/86CCFD48-205E-4A77-9C48-2021CBEDE341/force_power; \
echo "on" > /sys/bus/wmi/devices/86CCFD48-205E-4A77-9C48-2021CBEDE341/power/control
francoism90 / 99-sysctl.conf
Created March 28, 2019 09:27
Linux performance tweaks (TCP/UDP, swap, VFS)
fs.file-max = 2097152
net.core.netdev_max_backlog = 250000
net.core.somaxconn = 1024
net.core.rmem_max = 67108864
francoism90 / 88XXau@.service
Created November 16, 2018 18:09
Set txpower and monitor mode
Description=Set 88XXau txpower and monitor-mode
After=systemd-udevd.service systemd-sysusers.service systemd-sysctl.service
ExecStart=sh -c 'iw %i set txpower fixed 3000'
francoism90 /
Last active April 12, 2024 21:12
Change country to unlock channels, increase TX-power. (Use at your own risk)


Following instructions are provided without any warranty, and may even get you in trouble legally. The instructions are provided for testing, and should be use with care. We (including commentators) are not responsible for any damage to your device(s).


This may enable additional channels and power (in most cases don't) on ASUS Merlin provided routers.

francoism90 /
Last active July 9, 2018 16:31
Concat compatible video files using ffmpeg (in this case mp4)
rm -rf .list.txt
for file in *; do
filename=$(basename -- "$file")
echo "file '$file'" >> .list.txt;
francoism90 /
Last active April 12, 2024 21:16
libtorrent - get seeds/peers + metadata without downloading (DHT/magnet)
#!/usr/bin/env python3
import libtorrent as lt
import time
import json
import os
def write_json(path, contents):
with open(path, 'w', encoding='utf-8') as f:
json.dump(contents, f, default=str, indent=4, sort_keys=True)