Skip to content

Instantly share code, notes, and snippets.

View ericek111's full-sized avatar

Erik Bročko ericek111

View GitHub Profile
@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 / 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 / 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 / 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 / stargate.sh
Last active February 20, 2022 01:41
Stretch/shift and combine audio/video from different sources
#!/bin/bash
# deps: sox, ffmpeg
audiof="$1"
videof="$2"
outputf="$3"
tmp_file="$(mktemp /tmp/stargate.XXXXXXX)"
echo "$!" > "$tmp_file"
@ericek111
ericek111 / uSDR.ino
Created December 27, 2021 19:48
Firmware for the Chinese uSDR slim clone (longer body, small LCD, controls on front, no battery).
// QCX-SSB.ino - https://github.com/threeme3/QCX-SSB
//
// Copyright 2019, 2020, 2021 Guido PE1NNZ <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTR
@ericek111
ericek111 / miri_source_c.cc
Created April 14, 2022 17:38
gr-osmosdr libmirisdr-4 fixed (+ DC offset removal by vladisslav2011)
/* -*- c++ -*- */
/*
* Copyright 2012 Dimitri Stolnikov <[email protected]>
* Copyright 2012 Steve Markgraf <[email protected]>
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
@ericek111
ericek111 / inotifycompressor.cpp
Created September 16, 2022 22:23
use inotify to watch a directory and process content written to a file from another process
#include <iostream>
#include <filesystem>
#include <chrono>
#include <thread>
#include <vector>
#include <map>
#include <condition_variable>
#include <cerrno>
#include <cstring>
@ericek111
ericek111 / turboflash.sh
Created October 4, 2022 11:54
Script for Galaxy S10e to overclock the flashlight LED
mytmpfolder="/dev/myowntmp" # it seems there is no /tmp, so let's make our own -- /dev is on a tmpfs, it is purged on reboot
mkdir -p "$mytmpfolder"
flashfile="/sys/class/camera/flash/rear_flash"
curval="$(cat "$mytmpfolder/turboflashval")"
curval="${curval:-0}"
HIGH_VAL=200
LOW_VAL=2003
@ericek111
ericek111 / manticore_parser.php
Last active March 27, 2023 01:14
Manticore Search query log parser in PHP
<?php
class ManticoreLogLine {
public function __construct(
public *\DateTimeImmutable* $date,
public int $conn,
public float $realTime,
public float $wallTime,
public int $foundRows,
public string $sql,