Skip to content

Instantly share code, notes, and snippets.

View RomanHargrave's full-sized avatar

Roman Hargrave RomanHargrave

  • Cascadia
View GitHub Profile

AudioSurf 2 Lua Documentation

This is reverse-engineered from the game.

Scene manager functions

These functions are registered when LuaController.Start() is called. These are used by skins.

print(obj) : nil

Installing Steam in a chroot on Gentoo (using schroot)

This is a summary of how I set up a chroot for use with steam on Gentoo.

My reasoning for this approach to installing steam is as follows

  • Certain games do not want to work with the flatpak distribution, and flatpak is not pleasant to troubleshoot in this case
  • Installing steam on the host system would require I pull in several 32-bit packages, which I don't want to do
  • Installing steam in a chroot gives me the ability to fine-tune the environment that steam lives in without breaking my host system
#!/usr/bin/rakudo
sub MAIN(
Int :$threads = 1, #= Number of parallel flac encoders to run
*@files #= List of files to process
) {
# limit threads to n <= files
my $threads_eff = $threads > @files.elems ?? @files.elems !! $threads;
my $load = floor(@files.elems / $threads_eff);
@RomanHargrave
RomanHargrave / INDEXF.BT
Created August 19, 2020 16:06
Files-11 is a fuck
//------------------------------------------------
//--- 010 Editor v10.0 Binary Template
//
// File: Files-11 INDEXF.SYS Template
// Authors: Roman Hargrave
// Version: 0.1
// Purpose: Inspecting Files-11 INDEXF data
// Category:
// File Mask:
// ID Bytes:
@RomanHargrave
RomanHargrave / shodan-ip-copy.js
Created June 27, 2020 04:46
Userscript to add copy link next to search result ip on shodan
// ==UserScript==
// @name Shodan quick copy IP
// @namespace Violentmonkey Scripts
// @match https://www.shodan.io/search
// @grant none
// @version 1.0
// @author Roman Hargrave <roman@hargrave.info>
// @description 6/26/2020, 3:32:30 PM
// ==/UserScript==
window.addEventListener("load", function() {
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Mail::Mbox::MessageParser;
use MIME::Parser;
use Date::Parse;
@RomanHargrave
RomanHargrave / optware.pl
Last active April 18, 2020 08:28
Optware Collector
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
use List::Util qw(first);
use File::Basename;
use File::Path qw(make_path remove_tree);
use File::Temp qw(tempdir);
#!/usr/bin/perl
use warnings;
use strict;
use Text::CSV;
use Getopt::Long;
use Data::Dumper;
my $in_file = '-';
$!
$! Demo of WTF semantics
$!
$
$! assume that the first line in this file is ' KEY'
$ open/read fh EXAMPLE:[EXAMPLE]FILE.DAT
$
$! this should not reach EOF before finding a match, setting the global symbol 'line' and returning 1
$ call this_always_returns_two fh "KEY"
$

Encrypted SWAP hibernation in Debian 9+

It took me about 6 hours to find out all of this, but after reading a ton of man pages, initram scripts, and bug reports, I got a working result that takes about 2' to set up...

The point is to have a SWAP partition encrypted with LUKS, and it should be decypted during boot.

When using SysV, initram hooks and scripts in Debian worked like a charm but then, Systemd came and it's not yet fully implemented so this kind of crap happens. Systemd's cryptsetup doesn't support parameters in /etc/crypttab so using a script there is ignored:

/* Options Debian's crypttab knows we don't: