Skip to content

Instantly share code, notes, and snippets.

@C4K3
C4K3 / monosound.sh
Last active September 21, 2023 12:22
monosound
#!/bin/bash
set -euo pipefail
################################################################################
## This will make all (pulseaudio) sound currently playing mono. ##
## ##
## It does this by creating a new remapped "monosound" sink for each existing ##
## sink. Then it moves every input over to the monosound sink corresponding ##
## to the sink the input is currently using. ##
################################################################################
# Merges the two input files. Execute as
# jq -s -f statsmerge.jq file1 file2
# Numeric values with key beginning with "minecraft:" are added together.
# For all other values the value in b takes precedence
.[0] as $file1 | .[1] as $file2 |
$file1 + $file2 |
reduce paths(numbers) as $path
#!/bin/bash
set -euo pipefail
## This is a script made for the purpose of embedding metadata into media files
## from an iTunes library, allowing the media files to be used in any player.
##
## Given a media file extracted from iTunes, search the current directory for
## iTunes plist files, and if a matching file is found metadata is extracted
## from the plist file and embedded into the media file. The media file is then
## written into the directory 'out'.
@C4K3
C4K3 / README.md
Last active July 17, 2021 21:15
paper-terrain-generation-video

Screenrecording-2021-07-17_13.50.19.mp4

Keybase proof

I hereby claim:

  • I am C4K3 on github.
  • I am c4k3 (https://keybase.io/c4k3) on keybase.
  • I have a public key whose fingerprint is BD1E 234A 0731 E3B7 6B77 EF22 F6F8 C8F9 7069 BED9

To claim this, I am signing this object:

@C4K3
C4K3 / alts.clj
Last active August 6, 2022 06:35
Minecraft alts searcher -- Find the alts of a player based on IP by searching through the logs
(use 'clojure.set)
(defn get-map [prev filename]
(let [filename (str "./logs/" filename)
reg (re-seq #"(\S+)\[/(.+):"
(with-open [in (if (nil? (re-matches #"^.*gz$" filename))
(clojure.java.io/input-stream filename)
(java.util.zip.GZIPInputStream.
(clojure.java.io/input-stream filename)))
]
@C4K3
C4K3 / timeconnected.py
Created May 2, 2015 20:52
Count the time a Minecraft player has been online based on the server based on the logs (useful for logs prior to the implementation of statistics)
#!/usr/bin/env python3
import sys
import gzip
import datetime
import os
def checkDirectory(player, directory):
files = os.listdir(directory)