Skip to content

Instantly share code, notes, and snippets.

@LukasKnuth
LukasKnuth / fix_arrow_pipe.json
Created May 16, 2022 07:17
Karabiner Elements "complex modification" to fix the arrow-brackets (<>) and pipe (|) keys when using the "German Standard" layout in OSX
{
"title": "Personal fixes - Moonlander",
"rules": [
{
"description": "Fixes both Arrow-brackets and the Pipe symbol on the Moonlander keyboard with German layout.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "non_us_backslash"
@LukasKnuth
LukasKnuth / gist:40c53447ff0c980297c010939a6b9cdd
Created July 20, 2020 11:07
Encode to H265, no quality loss
#!/bin/bash
function encode {
# Add a "?" at the end of a "map" to say "if available"
# For a preview: add "-ss 0" before "-i" and "-t 120" before the output file. This gives a 2min sample
ffmpeg -hide_banner \
-i "$1" \
-map_metadata 0 \
-map_chapters 0 \
-metadata title="$2" \
-map 0 \
# This is a BoxStarter Script. See https://boxstarter.org/
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Disable-GameBarTips
Disable-BingSearch
# Install Basics
cinst -y firefox 7zip cpu-z windirstat hwmonitor choco-cleaner
# Install Multimedia
@LukasKnuth
LukasKnuth / Readme.md
Created December 6, 2019 21:47
ffmpeg Merge two Audio Streams into one

This script takes a single input file and

  1. Reduces the volume of the third audio-track in the file by half
  2. Writes the reduced volume track into l
  3. Mixes both the second audio-track and the lowered l-track together and stores them into a
  4. Maps the original video to be the first track
  5. Adds the newly mixed audio-track a as the sole audio track
  6. Enables pass-through for the video-track
  7. Configures the mixed audio-track to be AAC at 192kbit/s
# This is a BoxStarter Script. See https://boxstarter.org/
### BEFORE
#
# * Make sure this is run on Windows 10 Pro (required for Hyper-V)
# * Enable Virtualization in BIOS/UEFI (required for Hyper-V)
# Basic Configuration
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Disable-GameBarTips
@LukasKnuth
LukasKnuth / TTS.java
Created June 14, 2014 14:59
A TTS (Text-To-Speech) wrapper with extended functionality, designed to be robust and easy to use.
import android.annotation.TargetApi;
import android.content.Context;
import android.media.AudioManager;
import android.os.Build;
import android.speech.tts.TextToSpeech;
import android.speech.tts.UtteranceProgressListener;
import android.util.Log;
import java.util.HashMap;
@LukasKnuth
LukasKnuth / PKGBUILD
Created December 25, 2013 12:10
Updated PKGBUILD for the leap motion drivers.
# Maintainer: Helge Rausch <helge@rausch.io>
# This script is licensed under the MIT license.
# https://gist.github.com/tsujigiri/5476281
#
## Installation
#
# To install the Leap software, you first need to download the SDK for Linux
# from https://developer.leapmotion.com/downloads/leap-motion/sdk using your
# developer account. Unpack it, place the included .deb files in the same
# directory as this PKGBUILD and run `makepkg`. If all goes well this will
@LukasKnuth
LukasKnuth / session.log.old
Created November 16, 2012 01:21
session.log
/etc/gdm/Xsession: Beginning session setup...
localuser:luke being added to access control list
/etc/gdm/Xsession: Setup done, will execute: /usr/bin/ssh-agent -- gnome-session
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9wq22l
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9wq22l
SSH_AUTH_SOCK=/run/user/1000/keyring-9wq22l/ssh
GPG_AGENT_INFO=/run/user/1000/keyring-9wq22l/gpg:0:1
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9wq22l
SSH_AUTH_SOCK=/run/user/1000/keyring-9wq22l/ssh
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9wq22l
@LukasKnuth
LukasKnuth / DxDiag
Created September 29, 2012 14:31
Torchlight 2 - Bug logs
------------------
System Information
------------------
Time of this report: 9/29/2012, 15:22:14
Machine name: LUKE-PC
Operating System: Windows 8 Pro 64-bit (6.2, Build 9200) (9200.win8_rtm.120725-1247)
Language: German (Regional Setting: German)
System Manufacturer: Apple Inc.
System Model: Macmini3,1
BIOS: Default System BIOS
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
/**
* This is an example-implementation, showing how to download a raw-RSS
* feed from a web-address and how to write it's content to a File.</p>
* All Exceptions are handled internally by their corresponding methods.
* In a real-use scenario, this might be the wrong way, since your