Skip to content

Instantly share code, notes, and snippets.

@ckorn
ckorn / alias-completion
Last active August 28, 2016 16:37
Bash auto-completion with aliases. Aliases are nice to shorten often used commands. But ever got frustrated when bash's tab completion did not work? Instead of "git checkout" I just type "go". But I also want to type "go m<tab>" to get completed to "go master" automatically. This script creates a wrapper function to be used with the alias. (Also…
/usr/local/bin/make-completion-wrapper:
#!/bin/sh
# Author.: Ole J
# Date...: 23.03.2008
# License: Whatever
# Wraps a completion function
# make-completion-wrapper <actual completion function> <name of new func.> <alias>
# <command name> <list supplied arguments>
# eg.
#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source. The hook's purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to "prepare-commit-msg".
@ckorn
ckorn / git-svn-convert-branches
Created February 25, 2013 21:44
These scripts convert remote tags/branches of git-svn into real git tags/branches: http://jausoft.com/blog/2009/07/08/svn-to-git-migration-1/
#! /bin/sh
branchfile=$1
shift
if [ -z "$branchfile" ] ; then
echo Usage $0 branchfile containing branchnames without ref path
exit 1
fi
@ckorn
ckorn / dpkg-parsechangelog_version
Last active December 15, 2015 15:19
Get the version (without Debian revision) of a package.
VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')
@ckorn
ckorn / ytdl
Created November 2, 2013 22:14
#!/bin/bash
#Youtube-DL DASH Video and Audio merging script
#Written by QuidsUp
#Edited by Christoph Korn
File1New=video.mp4
File2New=audio.m4a
URL=$1
if [ -z $URL ]; then
@ckorn
ckorn / youtube-playlist-download.py
Created November 20, 2013 18:02
Shows all videos in a YouTube playlist and downloads them using xVideoServiceThief.
#!/usr/bin/python
# http://proxer.me/watch?a=214&l=engsub&e=8#top
# repository.py
import wx
import sys
from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin
import gdata.youtube
import gdata.youtube.service
import time
@ckorn
ckorn / speedtest
Last active August 29, 2015 13:57
The only real internet speedtest
#!/bin/sh
wget -O /dev/null -q "http://ftp.uni-kl.de/pub/linux/knoppix-dvd/KNOPPIX_V7.4.1DVD-2014-09-15-DE.iso" &
wget -O /dev/null -q "http://ftp.knoppix.nl/os/Linux/distr/knoppix-dvd/KNOPPIX_V7.4.1DVD-2014-09-15-DE.iso" &
wget -O /dev/null -q "http://vesta.informatik.rwth-aachen.de/ftp/pub/comp/Linux/knoppix/knoppix-dvd/KNOPPIX_V7.4.1DVD-2014-09-15-DE.iso" &
wget -O /dev/null -q "http://ftp.uni-erlangen.de/pub/mirrors/knoppix/DVD/KNOPPIX_V7.4.1DVD-2014-09-15-DE.iso" &
@ckorn
ckorn / create_one_repo.py
Last active August 29, 2015 14:00
Put all debian directories of a repository in a subdirectory
#!/usr/bin/python3
import urllib.request
import gzip
import sys
import io
import pprint
import os
import tarfile
import shutil
import subprocess
@ckorn
ckorn / sf.py
Last active August 29, 2015 14:04
sourceforge redirector
#!/usr/bin/python
from xml.dom import minidom
import requests
import os
import sys
from SocketServer import ThreadingMixIn
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import pickle
import time
# when changing to Japanese input with ibus-mozc and changing
# back to German KeePassX does not type correctly any longer
# has to be a problem in ibus-mozc. For now run "setxkbmap de"
# before autotyping.
Index: keepassx-0.4.3+dfsg/src/lib/AutoTypeGlobalX11.cpp
===================================================================
--- keepassx-0.4.3+dfsg.orig/src/lib/AutoTypeGlobalX11.cpp
+++ keepassx-0.4.3+dfsg/src/lib/AutoTypeGlobalX11.cpp
@@ -130,6 +130,8 @@ void AutoTypeGlobalX11::performGlobal(){
}