Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block geekman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
marcan /
Created Jan 25, 2019
Raspberry Pi Camera V2 DRM authentication example
import hmac, hashlib
# Data from I²C trace at
# Secret key from VideoCore blob
# serial[8], serial[7:4], serial[3:0]
serial = bytes.fromhex("EE8C196D8301230B59")
# rPi -> camera random number
numIn = bytes.fromhex("5805F3C898C3133154498E082F2E703516F2DBD1")

Firebase Hosting Deploy Single File

This utility script deploy a single local file to an existing Firebase Hosting site. Other files that are already deployed are left unmodified.

The difference with firebase deploy is that this script does not require you to have a local snapshot of all hosted files, you just need the one file that you want to add/update.


marcan /
Last active Oct 16, 2019
Canon EF protocol notes

Testing done using a Canon EOS 600D and a Canon EF-S18-55mm f/3.5-5.6 IS II.


  1. VBAT
  2. DET (common with P-GND on lens side)
  3. P-GND
  4. VDD
  5. DCL
  6. DLC
chrsstrm / gas_sheet_as_json.js
Last active Mar 29, 2018
Treat a Google Sheet like a JSON API
View gas_sheet_as_json.js
* create a Google Sheet then go to Tools > Script Editor
* Paste this code into the editor. Save.
* Publish > Deploy as Web App
* Set new version, publish as me, who has access - anyone, even anon.
* GET to the URL, add on end ?sheet=[sheet name]
* Sheet name is the sheet name, manage appropriately (no spaces or symbols to keep it simple)
* Request returns JSON representation of the sheet.
ni0n / gist:a69500b9cdac25b8462882f34090bff8
Last active Aug 28, 2017
useful mappings for auditing code - highlight word under cursor until switched off
View gist:a69500b9cdac25b8462882f34090bff8
let mapleader=","
map <Leader>mon :exe printf('match IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\'))<cr>
map <Leader>moff :exe printf('match IncSearch /\V\<%s\>/', '')<cr>
View gist:826bde4f3fa8ecb3445046b92f08f90b
#!/usr/bin/env python
# Copyright 2016 Mike Ryan
# Copyright 2016 Matthew Garrett
# This code will connect to a Bluetooth nuLock and reset the password to 123456
# This file is part of PyBT and is available under the MIT license. Refer to
# LICENSE for details.
Brainiarc7 / VAAPI-hwaccel-encode-Linux-Ffmpeg&
Last active Oct 20, 2019
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.
View VAAPI-hwaccel-encode-Linux-Ffmpeg&

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

cyphunk /
Last active May 28, 2018
notes from iOS security documentation that I used to write

Notation iOS 9

This homebrewed notation I typically use when evaluating secure boot designs of embedded devices. It doesn't apply accurately for the iOS review, hides the key-wrapping schema for example. But it's enough to keep track of storage location of secrets and some interdependency.

pfk                  = 256bit per_file_key
paulirish /
Last active Oct 20, 2019
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.


Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
ryancdotorg /
Created Aug 20, 2015
A FAT32 fragmenter, because I am a horrible person.
#!/usr/bin/env python
import random
import struct
import sys
# Most of the Fat32 class was cribbed from
def ppNum(num):
return "%s (%s)" % (hex(num), num)
You can’t perform that action at this time.