Skip to content

Instantly share code, notes, and snippets.

View ericek111's full-sized avatar

Erik Bročko ericek111

View GitHub Profile
@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 <pe1nnz@amsat.org>
//
// 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 / 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 / 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 / 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 / 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 / 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;