Skip to content

Instantly share code, notes, and snippets.

@LukasKnuth
LukasKnuth / README
Created February 15, 2012 22:18
This Python script can be used as a "pre-commit"-hook, to check if a huge binary file got accidentally added to the staging area (and is about to be committed). Because deleting those afterwards is a huge pain in the ass...
-- DESCRIPTION --
If you accidentally commit a huge file, you have a problem. Sure, you can remove it from the working tree and commit,
but the file is still reachable from your history and therefore causes every clone to be as huge as the commented
binary file.
Fixing this can be very ugly, time consuming and might not even work as you wish. Luckily, this script can protect
you from committing such monsters in the first place.
It looks through the staged files (the ones that are added with the "git add"-command) and checks for their file-size.
If they are larger then the given size, the commit is aborted and you get a message telling you what file takes so
@LukasKnuth
LukasKnuth / README
Created March 7, 2012 10:40
A simple script that helps setting up your portable tools in the msysgit-shell.
-- Add Portable software to your msysgit-PATH --
If you like to work with your *nix shell even under Windows, you'll
likely use the git-bash provided by msysgit a lot.
A problem might be, that you don't have your tools in the PATH of that
shell and therefore can't use them. Those tools might be on the same
USB-drive as the git-shell, so you would have to adjust the PATH
(if you're allowed to) every time the drive-letter changes.
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
@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
@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 / 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 / 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;
# 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 / 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/
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Disable-GameBarTips
Disable-BingSearch
# Install Basics
cinst -y firefox 7zip cpu-z windirstat hwmonitor choco-cleaner
# Install Multimedia