Skip to content

Instantly share code, notes, and snippets.

View ericek111's full-sized avatar

Erik Bročko ericek111

View GitHub Profile
@ericek111
ericek111 / xoverlay.cpp
Last active May 8, 2024 23:37
X11 overlay
/*
* Copyright (c) 2020 ericek111 <erik.brocko@letemsvetemapplem.eu>.
*
* This program 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, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@ericek111
ericek111 / record.sh
Last active September 12, 2017 21:00
LiveATC archive
#!/bin/bash
# https://gist.github.com/ericek111/7463aa1c2367683e51578789767a583a
# Check if SOX is installed
if ! hash "${SOX:-sox}" 2>/dev/null; then
echo "ERROR: SOX was not found in path ${SOX:-sox}"
echo "Run: sudo apt-get install sox libsox-fmt-mp3"
exit 1
fi
@ericek111
ericek111 / median.c
Last active November 13, 2017 14:34
Find average of random numbers in array
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int find_median(int* arr, size_t count);
size_t median_count(int* arr, size_t count, int median);
int find_median(int* arr, size_t count) {
int sum = 0;
@ericek111
ericek111 / linked_list.c
Last active March 12, 2018 12:52
[C] Double linked list
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Linked list entry */
typedef struct llEntry {
struct llEntry* prev;
struct llEntry* next;
void* data;
} llEntry;
@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>
@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 / 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 / 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 / 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'/>