Skip to content

Instantly share code, notes, and snippets.

View mikkorantalainen's full-sized avatar

Mikko Rantalainen mikkorantalainen

  • Peda.net, University of Jyväskylä
  • Finland
View GitHub Profile
@koto
koto / crime.py
Created September 11, 2012 08:32
It's not a crime to build a CRIME
# This is supposedly what CRIME by Juliano Rizzo and Thai Duong will do
# Algorithm by Thomas Pornin, coding by xorninja, improved by @kkotowicz
# http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/
import string
import zlib
import sys
import random
charset = string.letters + string.digits + "%/+="
@barraponto
barraponto / git-submodule-rm.sh
Created April 25, 2012 16:36
git submodule-rm
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
@hank
hank / insane_kernel_macro_solution.c
Created April 12, 2012 07:10
The solution to Linus' question on resolving undefined macros in the preprocessor to 0, as well as resolving defined macros to their values.
#include <stdio.h>
#define CONFIG_FOO 1
#define CONFIG_NOO 0
#define is_set(macro) is_set_(macro)
#define macrotest_1 ,
#define is_set_(value) is_set__(macrotest_##value)
#define is_set__(comma) is_set___(comma 1, 0)
#define is_set___(_, v, ...) v
@mezis
mezis / git-merge-po.sh
Last active November 20, 2023 11:33
Git merge driver for PO files
#!/bin/sh
#
# *******************************************
# WARNING: this does *not* handle 3-way merges properly.
# Anything modified on the local branch since the common base will get ignored.
#
# FOR ANYONE LANDING HERE:
# This script is now updated as part of the git-whistles gem.
# https://github.com/mezis/git-whistles
# *******************************************
@tvogel
tvogel / git-merge-associate
Created March 30, 2011 13:23
git script to manually associate files in a conflicting merge when rename detection fails
#!/bin/bash
#
# Purpose: manually associate missed renames in merge conflicts
#
# Usage: git merge-associate <our-target> <base> <theirs>
#
# Example: After a failed rename detection A/a -> B/b which results
# in CONFLICT (delete/modify) for A/a and corresponding "deleted by us"
# messages in git status, the following invocation can be used to manually
# establish the link:
@bigtoast
bigtoast / jrockit ubuntu
Created November 17, 2010 19:28
jrockit ubuntu
path to jrockit /usr/lib/jvm/java-6-jrmc4
then use
sudo update-java-alternatives -l or -s to select your version of java
sudo update-alternatives --install /usr/bin/appletviewer appletviewer /usr/lib/jvm/java-6-jrmc4/bin/appletviewer 64
sudo update-alternatives --install /usr/bin/apt apt /usr/lib/jvm/java-6-jrmc4/bin/apt 64
sudo update-alternatives --install /usr/bin/extcheck extcheck /usr/lib/jvm/java-6-jrmc4/bin/extcheck 64
sudo update-alternatives --install /usr/bin/idlj idlj /usr/lib/jvm/java-6-jrmc4/bin/idlj 64
sudo update-alternatives --install /usr/bin/jarsigner jarsigner /usr/lib/jvm/java-6-jrmc4/bin/jarsigner 64