Skip to content

Instantly share code, notes, and snippets.

View ericek111's full-sized avatar

Erik Bročko ericek111

View GitHub Profile
@ericek111
ericek111 / bjt_char.plt
Last active April 15, 2021 20:22
NPN BJT characteristic curves GNUplot graphing macro
set macros
SMOOTH="smooth mcsplines"
set samples 1000
delta_v(x) = ( vD = x - old_v, old_v = x, vD)
old_v = NaN
LOAD_VALS(name, file) = sprintf("%s='%s';%s_S='%s_smoothed.dat';set table %s_S; plot '%s' lw 3 w l sm b;unset table", name, file, name, name, name, file);
CALC_DIFF(name) = sprintf("set table '%s_diff.dat';plot %s_S using 0:($1), '' using 0:(delta_v($1)); unset table", name, name)
eval(LOAD_VALS("FIRST", "first.csv"))
@ericek111
ericek111 / naruby.c
Last active January 17, 2021 13:51
volakoho domaca uloha
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#define MAX_WORD_LEN 20
@ericek111
ericek111 / csgo.c
Created November 20, 2020 02:30
CS:GO voice demo parser
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/time.h>
#include <celt.h>
// gcc -o csgo csgo.c -I./celt-0.11.1/libcelt -L"$HOME/.steam/steam/steamapps/common/Counter-Strike Global Offensive/bin/linux64" -l:vaudio_celt_client.so && ./csgo && play -t raw -r 22050 -e signed -b 16 -c 1 out.raw
@ericek111
ericek111 / deobfmail.php
Created November 19, 2020 15:22
CloudFlare e-mail obfuscator cracker in PHP
<?php
$doc = new \DOMDocument();
@$doc->loadHTMLFile($argv[1] ?? "https://baraja.cz/zivotopis");
$xpath = new \DOMXPath($doc);
function r($e, $t) {
return hexdec(substr($e, $t, 2));
}
function n($n, $c) {
$o = "";
@ericek111
ericek111 / catalina.xml
Created August 16, 2020 19:02
QEMU/KVM GPU passthrough for macOS Catalina with OpenCore, OVMF binaries from https://github.com/kholia/OSX-KVM
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>bigsur</name>
<uuid>d46a7bcc-ddb1-4c8f-b334-4645460724d0</uuid>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>12</vcpu>
<vcpus>
<vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
<vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
<vcpu id='2' enabled='yes' hotpluggable='yes' order='3'/>
@ericek111
ericek111 / keybase.md
Created April 12, 2019 22:16
keybase.md

Keybase proof

I hereby claim:

  • I am ericek111 on github.
  • I am ericek111 (https://keybase.io/ericek111) on keybase.
  • I have a public key whose fingerprint is F94A DF63 B3B2 0183 A719 ACA7 F850 D032 0BA8 02C9

To claim this, I am signing this object:

@ericek111
ericek111 / hl_activity.js
Created October 20, 2018 22:26
HLstatsX activity (sessions) total connection time calculator
javascript: (function(e, s) {
e.src = s;
e.onload = function() {
jQuery.noConflict();
$ = jQuery;
doStuff();
};
document.head.appendChild(e);
})(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js')
@ericek111
ericek111 / steamid.pl
Last active October 20, 2018 22:31
Perl SteamID64 parser
#!/usr/bin/perl
use bigint;
die "Usage: $0 (steamID64)\n" if @ARGV < 1;
# https://developer.valvesoftware.com/wiki/SteamID
my $sid = @ARGV[0];
my $up = ($sid >> 32) & (2**32 - 1);
@ericek111
ericek111 / first.nut
Last active August 31, 2018 00:07
[Squirrel] CS:GO CHIP-8 emulator
// ent_fire first_script runscriptfile first_map/first.nut;ent_fire first_script callscriptfunction ButtonPressed
// http://devernay.free.fr/hacks/chip8/C8TECH10.HTM
::toHex <- function (val) {
return format("%04X", val);
}
DoIncludeScript("first_map/data.nut", this)
class CPU {
scope = null;
stack = null;
@ericek111
ericek111 / index2.html
Created May 18, 2018 21:54
CS:GO Bhop Detector 3000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="./browser/bundle.js"></script>
</head>
<body>