Skip to content

Instantly share code, notes, and snippets.

geekman

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
marcan / rpi_cam_auth.py
Created Jan 25, 2019
Raspberry Pi Camera V2 DRM authentication example
View rpi_cam_auth.py
import hmac, hashlib
# Data from I²C trace at https://hackaday.io/project/19480-raspberry-pi-camera-v21-reversed/log/52547-i2c-logic-analyzer-trace
# 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")
View README.md

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.

USE AT YOUR OWN RISK. NO WARRANTY IS PROVIDED.

@marcan
marcan / canon-ef-protocol-notes.md
Last active Oct 16, 2019
Canon EF protocol notes
View canon-ef-protocol-notes.md

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

Pinout

  1. VBAT
  2. DET (common with P-GND on lens side)
  3. P-GND
  4. VDD
  5. DCL
  6. DLC
@chrsstrm
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
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
Brainiarc7 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
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&Libav-setup.md

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
cyphunk / ios_security_notes.md
Last active May 28, 2018
notes from iOS security documentation that I used to write https://deadhacker.com/2016/03/25/the-terrorists-phone/
View ios_security_notes.md

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
paulirish / what-forces-layout.md
Last active Oct 20, 2019
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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.

Element

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
ryancdotorg / frag32.py
Created Aug 20, 2015
A FAT32 fragmenter, because I am a horrible person.
View frag32.py
#!/usr/bin/env python
import random
import struct
import sys
# Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833
def ppNum(num):
return "%s (%s)" % (hex(num), num)
You can’t perform that action at this time.