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
@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
@troyk
troyk / pg_stat_statements
Created January 5, 2013 18:18
enable postgres pg_stat_statements
1) see re: increasing shmmax http://stackoverflow.com/a/10629164/1283020
2) add to postgresql.conf:
shared_preload_libraries = 'pg_stat_statements' # (change requires restart)
136 pg_stat_statements.max = 1000
137 pg_stat_statements.track = all
3) restart postgres
4) check it out in psql

Non-lib patches

diff -r original/AndroidManifest.xml mod/AndroidManifest.xml
17c17
<     <application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:extractNativeLibs="false" android:icon="@mipmap/ic_launcher" android:label="@string/application_name" android:largeHeap="true" android:name="com.sonymobile.scan3d.Scan3DApp" android:networkSecurityConfig="@xml/network_security_config" android:resizeableActivity="false" android:supportsRtl="true">
---
>     <application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:extractNativeLibs="true" android:icon="@mipmap/ic_launcher" android:label="@string/application_name" android:largeHeap="true" android:name="com.sonymobile.scan3d.Scan3DApp" android:networkSecurityConfig="@xml/network_security_config" android:resizeableActivity="false" android:supportsRtl="true">
22c22
<         <uses-library android:name="com.sony.device" android:required="true"/>
-
@vi
vi / cgroup_memory_pressure_monitor.c
Created July 19, 2015 22:51
Simple command-line tool use cgroup's memory.pressure_level
#include <sys/eventfd.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
// Implemented by Vitaly "_Vi" Shukela in 2015, License=MIT.
@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
@jigpu
jigpu / wacom_app_config.sh
Last active January 31, 2022 16:32
Apply application-specific profiles with xsetwacom on Linux
#!/bin/bash
# wacom_app_config.sh
#
# BASH script to automatically run change Wacom driver config
# based on the focused application.
#
# Limited support for use under GNOME and its forks due to the
# way it does its own device/took configuration, but should work
# fine elsewhere. It may be possible to use the power of dconf
@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
}
@Sturtuk
Sturtuk / extract_mapjs.php
Created June 24, 2020 02:44
Extract source code & directories from the javascript .map files
<?php
/**
* Created by PhpStorm.
* User: edwinsturt
* Date: 2020-06-24
* Time: 00:45
*/
$file = 'main.ff0058ad.js.map';
@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
# *******************************************
@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 + "%/+="