Skip to content

Instantly share code, notes, and snippets.

View antiharmonic's full-sized avatar
😢

d̵͍͉̰̽͐i̸̝͔̎e̷̱̅̎ş̷͙́̃ ̵͎̔͘͜i̴̫̓͂͗r̵͔͑a̵̙̗͇̾̕ě̵̡͓͂ antiharmonic

😢
View GitHub Profile
@antiharmonic
antiharmonic / ext-to-magnet-fixer.js
Last active April 10, 2026 03:36
javascript magnet fixer
// ==UserScript==
// @name ext.to magnet href fixer
// @namespace http://tampermonkey.net/
// @version 1.3
// @match https://ext.to/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function () {
@antiharmonic
antiharmonic / calculate_b2_upload.sh
Last active October 15, 2022 22:07
As far as I'm aware b2 sync --dryRun doesn't give statistics like rsync would, and I am often curious how much space will be used/uploaded once the sync is performed
#!/bin/bash
# usage: calc_b2_upload.sh <bucket-name> [optional parameters to pass to the b2 command]
if ! command -v mac2unix &> /dev/null
then
echo "mac2unix (from dos2unix) could not be found, please install to continue."
exit
fi
@antiharmonic
antiharmonic / steam_screenshot_extraction.py
Created June 10, 2021 14:34
Extract steam screenshots from appid named dirs to human readable dirs.
#!/bin/env python3
# This has a lot of problems, e.g. I should have used os.path.join()
# and as such this has only been used in my own little WSL world.
# replace steam_libraries, ssdir, and extractdir with your values. Probably could just run
# with steam_libraries as empty and then the script would just pull everything from store.steampowered.com
# instead of locally
# this was just a quick hack because I wanted to backup my screenshots in a format that wasa little more readable.
@antiharmonic
antiharmonic / encrypted-backup-to-s3.md
Created June 2, 2020 14:27 — forked from erdii/encrypted-backup-to-s3.md
A crude encrypted backup on s3

encrypted backup to s3

init encfs

  • first time mounting with
    • encfs --reverse /path/to/backup /tmp/encrypted-s3-backup
  • i choose this settings:
    • x - expert mode
    • AES encryption - 256 bit keysize
@antiharmonic
antiharmonic / custom-rss-feed.pl
Last active August 6, 2017 18:52
I wanted to subscribe to an RSS feed, but I only wanted a filterable subsection of it. So I created this script to parse and filter the RSS so I could subscribe to it in my podcast app.
#!/usr/bin/perl
# written by antiharmonic
# 2017/08/07
# v0.0.1
# Probably poorly written and insecure.
# I just wanted a filtered feed for a podcast app
use strict;
use warnings;
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
@antiharmonic
antiharmonic / gist:8199327
Last active January 1, 2016 20:49
Foundation.pm / PerlObjCBridge Bad Notification Code
#!/usr/bin/perl
use warnings;
use strict;
use Foundation; # perlobjcbridge
use feature qw(say);
PerlObjCBridge->setTracing(1);
my $notification = NSUserNotification->alloc()->init();
@antiharmonic
antiharmonic / gist:6885587
Last active December 25, 2015 00:09
My interpretation of perl eval error caching
my $ct = CT->new(); # helper module
my $dbh;
my $max = 0;
do {
eval {
$dbh = DBI->connect("dbi:Oracle:host=" . $ct->db_host . ";sid=" . $ct->db_name .";port=1521", $ct->db_user, $ct->db_pass, {AutoCommit=>1}) or die "$DBI::errstr\n$instance";
};
if ($@) {
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect(...);
my $sth = $dbh->prepare("select name, id from example_table where col1 = ?");
my %id_hash;
while (my @row = $sth->fetchrow_array) {