Skip to content

Instantly share code, notes, and snippets.

View hertzg's full-sized avatar
🏠
Working from home

George Hertz hertzg

🏠
Working from home
View GitHub Profile
#!/bin/sh
## Node.js for Raspberry Pi Packaging Script
## =========================================
## Execute this script from within node.js git repo
## Use like this:
## ~/node/$ VERSION=v0.10.0 ./buildnode.sh
if [ -z $VERSION ]; then
echo "set the VERSION first"
exit 1
@hertzg
hertzg / compare_acoustid.js
Last active February 13, 2018 21:26
compare_acoustid.js
const fs = require('fs')
let fp1Map = parseFPStr(fs.readFileSync('fpcalc.mp3.fp').toString('utf8'))
, fp2Map = parseFPStr(fs.readFileSync('fpcalc-16.mp3.fp').toString('utf8'))
;
function parseFPStr(fpStr) {
let lines = fpStr.split('\n')
, map = Object.create(null)
@hertzg
hertzg / cc-node-armv6hf.sh
Last active June 17, 2021 01:54
Cross Compiling NodeJS for Raspberry PI (armv6hf)
#!/bin/bash
set -e
set -x
### IF we dont have archive url prefix
if [ -z "$_PARAMS_NODEJS_SOURCE_ARCHIVE_URL" ]; then
_PARAMS_NODEJS_SOURCE_ARCHIVE_URL=$(wget -qO- http://nodejs.org/dist/latest/ | egrep -o 'node-v[0-9\.]+.tar.gz' | tail -1);
_PARAMS_NODEJS_SOURCE_ARCHIVE_URL="http://nodejs.org/dist/latest/"$_PARAMS_NODEJS_SOURCE_ARCHIVE_URL
fi
@hertzg
hertzg / .ctags
Last active August 29, 2015 14:08 — forked from markwu/.ctags
--langdef=js
--langmap=js:.js
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*function[A-Za-z0-9_$ \t]*\(/\1/f, function, functions/
--regex-js=/\[[ \t]*['"]([A-Za-z0-9_$ ]+)['"][ \t]*\][ \t]*=[ \t]*function[A-Za-z0-9_$ \t]*\(/\1/f, function, functions/
--regex-js=/['"]([A-Za-z0-9_$ ]+)['"][ \t]*:[ \t]*function[A-Za-z0-9_$ \t]*\(/\1/f, function, functions/
--regex-js=/function[ \t]+([A-Za-z0-9_$]+)[ \t]*([^)])/\1/f, function, functions/
--regex-js=/(\b[A-Z][A-Za-z0-9_$]*)[ \t]*=[ \t]*new[ \t]+/\1/v, variable, variables/
--regex-js=/(\b[A-Z][A-Z0-9_$]*)[ \t]*=/\1/c, constant, contants/
@hertzg
hertzg / gist:fa133aee97d7d4ed612e
Last active August 29, 2015 14:09
Hyundai Sonata 2002 P1529 & P0705

Hyundai

DTC Codes

P0705 PRNDL Input

Transmission Range Sensor Circuit Malfunction (PRNDL Input)

P1529 TCM MIL REQUEST

Request from Transmission Control Module to Engine Control Module to turn on the Malfunction illumination light aka. Check Engine / Service Engine Soon Light)

@hertzg
hertzg / mocha-run-test.js
Last active August 29, 2015 14:10
Mocha Runner
var fs = require('fs'),
Mocha = require("mocha"),
path = require('path');
// Our Mocha runner
var mocha = new Mocha({
ui:"bdd",
reporter:"spec",
timeout:60000,
slow:10000
int ledPin = 13;
//led for visualization (use 13 for built-in led)
int speakerPin = 11;
//speaker connected to one of the PWM ports
#define c 261
#define d 294
#define e 329
#define f 349
@hertzg
hertzg / deb-vlc-deps.sh
Created January 8, 2015 01:02
VLC Dependencies for Debian
sudo apt-get -y install libvorbis-dev libogg-dev libtheora-dev speex libspeex-dev flac libflac-dev \
x264 libx264-dev a52-0.7.4 liba52-0.7.4-dev mpeg2dec libmpeg2-4-dev faad libfaad-dev faac libfaac-dev \
lame libmp3lame-dev ffmpeg libavdevice-dev libmad0 libmad0-dev dirac libdirac-dev liboil-dev libschroedinger-dev \
libdca-dev twolame libtwolame-dev libmpcdec-dev libvorbisidec1 libvorbisidec-dev libass-dev libass5 libebml4 \
libebml-dev libmatroska6 libmatroska-dev libdvbpsi9 libdvbpsi-dev libmodplug1 libmodplug-dev libshout3 libshout3-dev \
libdvdread4 libdvdnav4 libdvdnav-dev livemedia-utils liblivemedia-dev libcddb2 libcddb2-dev libcdio13 libcdio15 libcdio-dev \
libcdio-utils vcdimager libvcdinfo0 libvcdinfo-dev libgpg-error0 libgpg-error-dev libgcrypt11 libgcrypt11-dev \
gnutls-bin libgnutls26 libgnutls-dev libdap11 libdap-bin libdap-dev libxml2 libxml2-dev libpng12-0 libpng12-dev \
libjpeg8 libtiff5 libtiff5-dev libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev libc-bin gettext libfreet
@hertzg
hertzg / tls_creds.js
Last active August 29, 2015 14:14 — forked from mildmojo/tls_creds.js
var tls = require('tls');
var constants = require('constants');
// Disable client session renegotiation, no known use case per:
// https://www.ssllabs.com/downloads/SSL_TLS_Deployment_Best_Practices_1.3.pdf
// By virtue of require() caching, this will affect all code using `tls`.
tls.CLIENT_RENEG_LIMIT = 0;
// Based on whitelist proposed at: https://bugs.ruby-lang.org/issues/9424
// And SSL/TLS Best Practices: https://www.ssllabs.com/downloads/SSL_TLS_Deployment_Best_Practices_1.3.pdf