Skip to content

Instantly share code, notes, and snippets.


Obtaining RK3066 boot ROM.

Here are my steps.

At first, I took a look to RK30xxLoader(L)_V1.18.bin. This file appears in update.img for my device. So, I unpacked update.img using rk29Kitchen.

strings on that file returns nothing interesting, so I assumed the file is crypted

View gist:11405132
# with 2047 of 2048 reader slots allocated
$ python -mtimeit -s 'import lmdb; e ="/tmp/test")' 'e.begin().abort()'
100000 loops, best of 3: 10.1 usec per loop
$ git stash &>/dev/null ; python build &> /dev/null
$ python -mtimeit -s 'import lmdb; e ="/tmp/test")' 'e.begin().abort()'
1000000 loops, best of 3: 0.47 usec per loop
View gist:c38aff42b65101ab2240
[00:34:19 eldil!1 ~] cat bin/ts
while read; do
echo `date +%Y-%m-%d+T%H:%M:%S` "$REPLY"
View fs.c
// create 1 million files, final directory size ~4.1gb:
// for i in {1..1024} ; do mkdir -p junk/$i ; for j in {1..1024} ; do cp /etc/hostname junk/$i/$j ; done; done
[20:23:18 k2!58 ~] gcc -O2 -oa a.c
[20:23:19 k2!59 ~] time ./a
real 0m13.000s
#include <sys/types.h>
View gist:40d77f8689bdb0286c6b
* Match methods on `obj` of the form "_onCssClassAction", extracting
* "CssClass" and "Action", then:
* - Transform "CssClass" to ".cssClass"
* - Transform "Action" to "action"
* - Find elements matching .cssClass inside `elem`
* - Wire up the corresponding jQuery action (e.g. click()) to a bound
* copy of the method.
View gist:77f93efdad9db86012d3
import collections, types
class frozendict(collections.UserDict):
def __init__(self, d=None, **kw):
d = kw if d is None else dict(d, **kw) = types.MappingProxyType(d)
self._h = sum(map(hash,
__hash__ = lambda self: self._h
__repr__ = lambda self: repr(dict(self))
View pypy-2.4.0 py-lmdb 2.4ghz Xeon
[23:19:21 k3!2 py-lmdb] ~/pypy-2.4.0/bin/pypy examples/
permutate 1876098 words avglen 13 took 2.74sec
DB_PATH: /ram/testdb
insert: 3.070s 611142/sec
stat: {'branch_pages': 244L, 'entries': 1876098L, 'overflow_pages': 0L, 'psize': 4096, 'depth': 4, 'leaf_pages': 25385L}
k+v size 50911.31kb avg 27, on-disk size: 101540.00kb avg 55
enum (key, value) pairs: 0.544s 3447601/sec
reverse enum (key, value) pairs: 0.495s 3790924/sec
import lmdb
def test():
env ="test.lmdb", max_dbs=1, map_size=15*1024*1024)
value = bytearray(" "*9*1024*1024)
with env.begin(write=True, buffers=True) as txn:
txn.put("big", value, dupdata=False, overwrite=True)
def flags(names):
"""Return the result of ORing a set of (space separated) :py:mod:`termios`
module constants together."""
return sum(getattr(termios, name) for name in names.split())
def flags(names):
"""Return the result of ORing a set of (space separated) :py:mod:`termios`
module constants together."""
n = 0
dw /
Last active Sep 21, 2017
Mitogen (local and remote loop example)
import subprocess
import mitogen
def main(router):
u = router.ssh(hostname='u')
root = router.sudo(via=u, password='x')
for x in xrange(100):, ['true'])
if __name__ == '__main__' and mitogen.is_master: