- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit -o pipefail | |
if [ "$#" -eq 0 ] | |
then | |
echo "usage: rs PATTERN REPLACEMENT [PATH...]" > /dev/stderr | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* !!!! 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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})') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moved to https://github.com/mattbague/mpv-configs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |