Skip to content

Instantly share code, notes, and snippets.

View klaxa's full-sized avatar

klaxa

  • Germany
View GitHub Profile
@klaxa
klaxa / pitch_down.bash
Last active January 8, 2022 16:34
Pitches a video's audio down with ffmpeg and sox
#!/bin/bash
FFMPEG="/usr/bin/ffmpeg"
SOX="/usr/bin/sox"
$FFMPEG -i "$1" -map 0:a -c flac -y temp.flac
$SOX temp.flac pitched.flac pitch -500
$FFMPEG -i "$1" -i pitched.flac -map 0:v -map 1:a "${1}"_pitched.mkv
rm temp.flac pitched.flac
@klaxa
klaxa / nat.bash
Last active January 8, 2022 16:34
Shell script to set up an ssh vpn tunnel and set default routes.
#!/bin/bash
if [[ $# < 2 ]]
then
INTERNAL=tun0
EXTERNAL=eth0
else
INTERNAL=$1
EXTERNAL=$2
fi
#!/usr/bin/python2
import json
import urllib
import sys
import re
MAX_OUTPUT_LENGTH = 300
if len(sys.argv) < 2:
print "Usage: !define word"
@klaxa
klaxa / irc.py
Last active January 8, 2022 16:33
#!/usr/bin/python
import socket
import sys
import re
import select
import queue
import string
import time
import threading
#!/bin/bash
# Multivirsh
CONFIG="multivirsh.conf"
declare -A hypervisors
parse_hypervisor=0
while read line
@klaxa
klaxa / tta_cue_to_flac.bash
Last active January 8, 2022 16:16
Converts .tta and .cue files to .flac with rather proper tagging. Should work with the Touhou Lossless Music Collecion (Tested with all Shibayan Records albums and a few Foxtail-Grass Studios albums)
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage $0 <.cue file>"
exit 1
fi
# naming scheme:
# <Track No.>. <PERFORMER> — <TITLE>.flac
@klaxa
klaxa / gbcpu.c
Created February 21, 2013 02:38
/*
* gbsplay is a Gameboy sound player
*
* 2003-2005 (C) by Tobias Diedrich <ranma+gbsplay@tdiedrich.de>
* Licensed under GNU GPL.
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
$ wget -O /dev/null http://cachefly.cachefly.net/100mb.test
--2014-01-19 02:01:57-- http://cachefly.cachefly.net/100mb.test
Resolving cachefly.cachefly.net (cachefly.cachefly.net)... 205.234.175.175
Connecting to cachefly.cachefly.net (cachefly.cachefly.net)|205.234.175.175|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: ‘/dev/null’
100%[======================>] 104,857,600 6.97MB/s in 15s
$ cat root.proj
CONFIG_FILE config.h
PLATFORM_FILES corec/tools/coremake
WORKSPACE ebml
{
USE ebml2
USE ebmltests
}
$ cat Lets\ Play\ Trails\ in\ the\ Sky/setup_audio.bash
#!/bin/bash
pacmd load-module module-null-sink
pacmd set-default-sink null
pacmd set-default-source alsa_input.pci-0000_00_1b.0.analog-stereo
pacmd load-module module-loopback
pacmd set-default-source alsa_input.usb-0d8c_Generic_USB_Audio_Device-00-Device.analog-mono
pacmd load-module module-loopback
pacmd set-default-source null.monitor