Skip to content

Instantly share code, notes, and snippets.

View webdev23's full-sized avatar
😡
SHTF

NVRM webdev23

😡
SHTF
View GitHub Profile
@webdev23
webdev23 / decomposer.md
Created October 8, 2025 00:35
PHP decomposer | Convert composer packages to a single flat file directly usable.

This wonderful tool allow to render a PHP composer package as a single PHP file.

https://github.com/cubiclesoft/php-decomposer

Here is a bash script to speed-up things.

It allow to get the final needed file from the current directory in few seconds, without never messing with composer.

Usage example (Find a package and it's documentation at https://packagist.org/packages)

@webdev23
webdev23 / Control multiple GPU Fan speed based on CPU temperature - Linux systemd service - Nvidia
Last active February 7, 2025 13:51
Control multiple GPU Fan speed based on CPU temperature - Linux systemd service - Nvidia
This setup allows to provide extra boost of cool air, dedicated for overclocked CPU.
Using the powerful GPU fans based on both CPU and GPU temperature.
As a permanent systemd service, across reboots.
It should be -run once and forget-, make sure to adjust <USER> and always use FULL PATH.
We cannot control GPU fan speed without sudo rights, and various issue arise with display settings.
THe following works great for me, over reboot, and it should work in any Linux.
There is many tricks against issues controlling nvidia-settings, that one works, but:
@webdev23
webdev23 / 💾RePack
Last active September 6, 2025 10:21
💾RePack bookmarklet. Dump static page in one html file, highlight contents, embed styles, convert images as data-uri, remove scripts.
// Bookmarklet
javascript:void (()=>{let e="";try{document.designMode="on",onmouseup=()=>{document.execCommand("backColor",!1,"chartreuse"),window.getSelection().removeAllRanges()};var n=/^\s*('|")/;[...document.styleSheets].forEach((t=>{[...t.rules].forEach((t=>{var o,c;e+=(o=t.cssText,c=function(e){var n;(n=e,fetch(n).then((e=>e.blob())).then((e=>new Promise(((n,t)=>{const o=new FileReader;o.onloadend=()=>n(o.result),o.onerror=console.log(n,t),o.readAsDataURL(e)}))))).then((e=>{console.log("RESULT:",e)}))},[/(@import\s+)(')(.+?)(')/gi,/(@import\s+)(")(.+?)(")/gi,/(url\s*\()(\s*')([^']+?)(')/gi,/(url\s*\()(\s*")([^"]+?)(")/gi,/(url\s*\()(\s*)([^\s'")].*?)(\s*\))/gi].reduce((function(e,t,o){return e.replace(t,(function(e,t,o,r,s){var a=c(r);return console.log(t,o,a,s),n.test(a)&&n.test(o)&&(o=s=""),t+o+a+s}))}),o))}))})),[...document.querySelectorAll("link")].forEach((e=>{e.outerHTML=""})),[...document.querySelectorAll("source")].forEach((e=>{var n;(n=e.src,fetch(n).then((e=>e.blob())).then((e=>new Promise(((
@webdev23
webdev23 / markletbooker
Last active May 29, 2022 09:33
MarkletBooker: a bookmarklet to create and edit es6+ bookmarklets
javascript:void (async()=>{let e="",t="",n="🐙";if(console.log(window.getSelection().rangeCount),window.getSelection()&&window.getSelection().rangeCount>=1){console.log(window.getSelection());try{if(t="(async () => {\n"+window.getSelection().anchorNode.parentElement.textContent+"\n})();","javascript"===window.getSelection().anchorNode.textContent.split(":")[0])return void(t=window.getSelection().anchorNode.textContent);if("javascript"===window.getSelection().anchorNode.parentElement.textContent.split(":")[0])return void(t=window.getSelection().anchorNode.parentElement.textContent);if("javascript"===window.getSelection().anchorNode.parentElement.textContent.split(":")[0])return void(t=window.getSelection().anchorNode.parentElement.textContent);if("javascript"===window.getSelection().anchorNode.parentElement.href.split(":")[0])return void(t=window.getSelection().anchorNode.parentElement.href)}catch(e){console.log(e.message)}}document.documentElement.innerHTML=document.implementation.createHTMLDocument().document
@webdev23
webdev23 / xiaomi_cam.sh
Created January 14, 2021 12:37
Connect to Xiaomi Mi 4K stream without app
echo '{"msg_id":257,"token":0}' | telnet 192.168.42.1 7878
//termux-open-url rtsp://192.168.42.1/live
vlc rtsp://192.168.42.1/live
@webdev23
webdev23 / 0.README.md
Created April 1, 2018 21:26 — forked from izabera/0.README.md
tput codes

This is the table from man 5 terminfo.

Do NOT hardcode terminal escape sequences. Use tput with the cap-names from the table below to get the right code for your terminal.

(P) indicates that padding may be specified
@webdev23
webdev23 / keystrokes.php
Created March 27, 2018 23:01
Realtime keystrokes in php bash scripts
#!/usr/bin/php
<?php
$trap = [];
system("xinput list | grep -Po 'id=\K\d+(?=.*slave\s*keyboard)' \
| xargs -P0 -n1 xinput test > keys &");
while (true){
$data = file("keys");
$key = $data;
@webdev23
webdev23 / EQ
Last active September 9, 2017 13:40
Pulseaudio equalizer command line fine control | php bash script
#!/usr/bin/php
<?php
// Usage: ./EQ [bandnumber] [+/-]
// ./EQ toggle
// ./EQ reset
// ./EQ gui
@webdev23
webdev23 / winkill
Last active September 9, 2017 13:49
Kill all x11 windows, empty ram and swap, empty trash bin | php bash script
#!/usr/bin/php
<?php
// Get all x11 windows
$windows = system("wmctrl -l | cut -f1 -d' ' > winlist");
$list = file("winlist");
foreach($list as $kill){
@webdev23
webdev23 / QEMU_MicroXP-v0.82.php
Last active May 3, 2023 18:27
QEMU MicroXP-v0.82.iso installation script from internet archives
#!/usr/bin/php
<?php
echo " _.-;;-._
\e[15;48;5;20mMicro_xp QEMU deployment script '-..-'| || |
'-..-'|_.-;;-._|
'-..-'| || |
'-..-'|_.-''-._|
";