Skip to content

Instantly share code, notes, and snippets.

View carstene1ns's full-sized avatar

Carsten Teibes carstene1ns

View GitHub Profile
@carstene1ns
carstene1ns / recursive maildir-deduplicate
Created November 29, 2013 17:52
After migrating from google mail, I had a bunch of mails more than once. It happens because gmail uses tags that are converted to folders when moving with imapsync. The following one-liner shows (and optionally removes without '-n') all duplicated mails.
find $HOME/Maildir -type d -not \( -path "*/cur" -or -path "*/new" -or -path "*/tmp" -or -path "*/.Trash" \) -exec ./maildir-deduplicate.py -n {} +
@carstene1ns
carstene1ns / .gitattributes
Last active August 29, 2015 14:27
git diff output for rpg maker files using easyrpg's lcf2xml tool
*.lmu diff=easyrpg
@carstene1ns
carstene1ns / unxxd.rb
Last active June 5, 2018 00:32
`xxd -i` creates header files with hexdumps of any raw file. This simple ruby script saves the content of the header file in raw form.
#!/usr/bin/env ruby
# read
xxd = IO.read('file.xxd')
# values are comma separated
chars = xxd.split(',')
# with whitespaces
chars.map! {|c| c.strip}
# in hex
chars.map! {|c| c.to_i(16)}
@carstene1ns
carstene1ns / libmad-pkg-config.diff
Created October 12, 2015 03:56
libmad pkg-config patch, adapted from Arch Linux package. Needs to run autoreconf.
diff -Naur libmad-0.15.1b.orig/configure.ac libmad-0.15.1b/configure.ac
--- libmad-0.15.1b.orig/configure.ac 2004-01-23 10:41:32.000000000 +0100
+++ libmad-0.15.1b/configure.ac 2015-10-12 05:51:12.514078692 +0200
@@ -26,7 +26,7 @@
AC_CONFIG_SRCDIR([decoder.h])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([foreign])
@carstene1ns
carstene1ns / write_room_pics.rb
Created June 23, 2017 17:02
Creates the room description bars in the EasyRPG Testgame
#!/usr/bin/ruby
rooms = Array[
"Message",
"Message options",
"Show face",
"Choices",
"Number input",
"Switch operation",
"Variable operation",
@carstene1ns
carstene1ns / discord-bot-bridge.pl
Last active August 18, 2017 18:05
HexChat plugin to map bot messages in `<nick> message` format to messages coming from nick directly instead
# Name: discord-bot-bridge.pl
# Author: carstene1ns < dev f4ke de >
# Date: 2017-08-04
# License: This code is put in the public domain.
use strict;
use warnings;
use utf8;
use v5.26.0;
use HexChat;
@carstene1ns
carstene1ns / fonts-noaa.conf
Created October 29, 2017 20:16
Better font rendering for RPG_RT.exe in wine
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- load default settings -->
<include>/etc/fonts/fonts.conf</include>
<!-- disable anti-aliasing -->
<match target="font">
<edit mode="assign" name="rgba">
<const>none</const>
</edit>
@carstene1ns
carstene1ns / dump_romfs.rb
Created April 26, 2018 21:40
Simple tool to get a romFS image out of a .NRO file
#!/usr/bin/env ruby
#
# dump_romfs.rb by carstene1ns, 2018 - under ISC License
#
# See http://switchbrew.org/index.php?title=NRO for reference
MAGIC = "NRO0"
HEADER = "ASET"
# helper
@carstene1ns
carstene1ns / dnsmasq.conf
Created May 1, 2018 19:47
Minimal dnsmasq configuration for Nintendo Switch homebrew launcher (https://switchbrew.github.io/nx-hbl/)
#/etc/dnsmasq.conf
no-resolv
no-hosts
address=/ctest.cdn.nintendo.net/<IP of your Webserver>
#log-queries
@carstene1ns
carstene1ns / README.md
Last active October 4, 2020 11:56
Get all commits of the current branch since creation from another branch

Usage

Show all commits the current feature branch has:

$ git show -s $(./git-branch-commits.sh)

Cherry-Pick all commits the specific pull request (checked out as branch) has: