Skip to content

Instantly share code, notes, and snippets.

View insilications's full-sized avatar
🐼

Francisco Boni insilications

🐼
View GitHub Profile
@frangio
frangio / rs
Last active August 23, 2025 11:55
ripsed: use ripgrep as a sed replacement. requires sponge from moreutils
#!/usr/bin/env bash
set -o errexit -o pipefail
if [ "$#" -eq 0 ]
then
echo "usage: rs PATTERN REPLACEMENT [PATH...]" > /dev/stderr
exit 1
fi
@tkafka
tkafka / listAllEventListeners.js
Last active October 3, 2024 11:02 — forked from dmnsgn/listAllEventListeners.js
List all event listeners in a document
console.table((function listAllEventListeners() {
const allElements = Array.prototype.slice.call(document.querySelectorAll('*'));
allElements.push(document); // we also want document events
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
let elements = [];
for (let i = 0; i < allElements.length; i++) {
@imaman
imaman / cdp.js
Last active June 24, 2024 05:41
iframe inspection w/o getFlattenedDocument()
const CDP = require('chrome-remote-interface');
const chromeLauncher = require('chrome-launcher');
const util = require('util');
// cdp.js: a playground for using chrome-devtools-protocol.
// Plug-in your own code at the run() function, below.
//
// Usage:
// $ node scripts/cdp.js
//
@jrelo
jrelo / findrootprocs.txt
Created January 1, 2019 14:18
find procs with ruid not 0 and euid 0
find /proc/ -maxdepth 1 -user root -type d |egrep '[0-9]'|while read ; do head -1 $REPLY/cmdline;done
egrep 'Uid:' /proc/*/status|awk '{if ($3 != '0' && $2 == '0') print $0}'
egrep 'Uid:' /proc/*/status|awk '{if ($3 != '0' && $2 == '0') print $0}'|cut -d\/ -f3|while read pid;do ps -p $pid -o comm,user,pid,ppid,uid,euid,ruid,suid,lwp,nlwp,etime,time,ni,pri_foo,sgi_p,psr,stat,wchan=WIDE-WCHAN-COLUMN,min_flt,maj_flt,cls,f,pcpu,pmem,rss,vsz,sz,args;done
@MPThLee
MPThLee / enableDiscordExperiments.js
Last active July 27, 2025 01:25
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
@andre-hartmann
andre-hartmann / main.cpp
Last active August 1, 2024 07:10
QCommandLineParser with subcommands
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QTextStream>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QCommandLineParser parser;
parser.setOptionsAfterPositionalArgumentsMode(QCommandLineParser::ParseAsOptions);
parser.addPositionalArgument("subcommand",
@mr-nfamous
mr-nfamous / classbuilder.py
Created September 17, 2018 00:14
Python __build_class__
import dis
from sys import _getframe as GF
def vprint(f, *args, **kws):
kws = ', '.join(f'{k}={v!r}' for k,v in kws.items())
args= ', '.join(a for b in (map(repr, args), (kws,)) for a in b if a)
print(f'{f}({args})')
@mattbague
mattbague / mpv.conf
Last active November 27, 2020 23:58
MPV Configs
moved to https://github.com/mattbague/mpv-configs
@Mnkai
Mnkai / README.md
Last active July 25, 2025 21:16
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and Turbo Parameter Modification with MSR on Non-Overclockable CPUs

Disclaimer

  • Modifying MSR may void your CPU's (or system board's) warranty. Proceed with caution. I am not responsible for any damage caused by this article.
  • MSR addresses vary significantly between CPUs. Check your CPU's MSR address using Intel's documentation.
  • This has only been tested on the Intel i7-8550U (Kaby Lake R).
  • This article is a translation of this article. If you can read Korean, I recommend reading that article instead.

Introduction

@dpineiden
dpineiden / pyqt_dbus.py
Last active January 26, 2025 18:42
PyQt example with Dbus, asyncio and multiprocessing. Send data using DBus standar
"""
Example with Signal-Slot system from QT
When generate data, sends and load on the Gui's text widget
"""
import sys
from PyQt5.QtCore import QObject, pyqtSignal, QSharedMemory
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow