Skip to content

Instantly share code, notes, and snippets.

View jberkel's full-sized avatar

Jan Berkel jberkel

View GitHub Profile
#!/usr/bin/perl
######################################################################
#
# File : split_bootimg.pl
# Author(s) : William Enck <enck@cse.psu.edu>
# Description : Split appart an Android boot image created
# with mkbootimg. The format can be found in
# android-src/system/core/mkbootimg/bootimg.h
#
# Thanks to alansj on xda-developers.com for
@jberkel
jberkel / gist:1087757
Created July 17, 2011 16:33
HOWTO: compile mkbootimg/mkbootfs
get Android source code: http://source.android.com/source/downloading.html
$ cd /path/to/android-src
$ cd system/core/libmincrypt/
$ gcc -c *.c -I../include
$ ar rcs libmincrypt.a *.o
$ cd ../mkbootimg
$ gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
$ cd ../cpio
$ gcc mkbootfs.c -o mkbootfs -I../include
[:/Volumes/tbaplus/projects/enwikt-dump-rs] 86dfd01* ± rust-lldb ./target/debug/wiktionary_dump2 -- dump_parsed_templates --input enwiktionary-20191201-pages-articles-multistream.xml --format cbor --templates templates --namespaces template
error: module importing failed: Missing parentheses in call to 'print'. Did you mean print('Whoops! You are missing the <' + arg.argName + '> argument.')? (fblldb.py, line 98)
File "temp.py", line 1, in <module>
(lldb) command script import "/usr/local/Cellar/rust/1.39.0/lib/rustlib/etc/lldb_rust_formatters.py"
(lldb) type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
(lldb) type category enable Rust
(lldb) target create "./target/debug/wiktionary_dump2"
Current executable set to './target/debug/wiktionary_dump2' (x86_64).
(lldb) settings set -- target.run-args "dump_parsed_templates" "--input" "enwiktionary-20191201-pages-articles-multistream.xml" "--format" "cbor" "--templates" "templates" "--namespaces" "template"
<?xml version="1.0" encoding="UTF-8"?>
<!-- track-length = 79030 filtered ascend = 1046 plain-ascend = 380 cost=144766 -->
<gpx
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
creator="BRouter-1.4.11" version="1.1">
<trk>
<name>brouter_trekking_0</name>
<trkseg>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
import sys
import csv
from datetime import timedelta, datetime
from graphication import FileOutput, Series, SeriesSet, Label, SimpleScale, css, default_css as style
from graphication.scales.date import AutoWeekDateScale, AutoDateScale
from graphication.wavegraph import WaveGraph
def colorgen(colours):
@jberkel
jberkel / mksession.vim
Created April 18, 2009 11:57
session handling for vim
" how to use this: vim -S mksession.vim file_to_edit
" based on scripts from http://vim.wikia.com/wiki/Go_away_and_come_back
function! SessionFile(name)
let b:sessions = "sessions"
if has("gui_running")
let b:sessions = b:sessions . "-gvim"
endif
let b:sessiondir = $HOME . "/.vim/" . b:sessions . getcwd()
return b:sessiondir . '/' . a:name
endfunction
diff -ru jack-1.9.6/common/wscript jack-1.9.6_patched/common/wscript
--- jack-1.9.6/common/wscript 2010-08-30 12:23:53.000000000 +0200
+++ jack-1.9.6_patched/common/wscript 2010-10-20 13:18:05.000000000 +0200
@@ -30,8 +30,8 @@
if bld.env['IS_LINUX']:
process.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['IS_MACOSX']:
- process.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
- #process.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
+ process.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch x86_64")
$ java \
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog \
-Dorg.apache.commons.logging.simplelog.showdatetime=true \
-Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG \
-Dorg.apache.commons.logging.simplelog.log.org.apache.http.wire=ERROR