Skip to content

Instantly share code, notes, and snippets.

View driverdan's full-sized avatar

Dan DeFelippi driverdan

View GitHub Profile
@driverdan
driverdan / netgear-private-key-disclosure.md
Created January 20, 2020 16:22 — forked from nstarke/netgear-private-key-disclosure.md
Netgear TLS Private Key Disclosure through Device Firmware Images

Netgear Signed TLS Cert Private Key Disclosure

Overview

There are at least two valid, signed TLS certificates that are bundled with publicly available Netgear device firmware.

These certificates are trusted by browsers on all platforms, but will surely be added to revocation lists shortly.

The firmware images that contained these certificates along with their private keys were publicly available for download through Netgear's support website, without authentication; thus anyone in the world could have retrieved these keys.

@driverdan
driverdan / gist:3edf529cffa183da94a78f3dad1983ca
Created October 29, 2019 17:16
Git command to get single line descriptions for recent commits
git log --oneline HEAD...previous_hash
@driverdan
driverdan / runtime_logging_level.py
Created October 29, 2019 16:49
Runtime logging level change
# Source: https://stackoverflow.com/a/46710435
import logging
# Set level to the logging level you want to use.
# This will typically be INFO or DEBUG.
level = logging.INFO
logger = logging.getLogger()
logger.setLevel(level)
for handler in logger.handlers:
@driverdan
driverdan / model_list.py
Last active January 7, 2019 23:34
List of Django models and attributes
import django.apps
for model in django.apps.apps.get_models():
print(model._meta.label)
for field in model._meta.get_fields():
print(f" {field.name}")
@driverdan
driverdan / Brewfile
Last active September 22, 2016 19:23
My Brewfile. Top section is mostly dev tools, cask items are standard GUI apps.
cask_args appdir: '/Applications'
brew 'autoconf'
brew 'automake'
brew 'awscli'
brew 'bash-completion'
brew 'ctags'
brew 'curl'
brew 'git'
brew 'go'
@driverdan
driverdan / cpu_monitor.js
Last active August 29, 2015 14:16
Menubar load monitor using AnyBar and node
console.log('Starting...');
var dgram = require('dgram');
var os = require('os');
// Create UDP client
var client = dgram.createSocket('udp4');
// Colors to use
var good = new Buffer('green');
@driverdan
driverdan / main.js
Created March 6, 2015 02:01
AnyBar node example - Set random colors
var dgram = require('dgram');
// Create UDP client
var client = dgram.createSocket('udp4');
// Define all the colors
var colors = [
'black',
'blue',
'cyan',
'green',
@driverdan
driverdan / node-xhr-example-setting-global.js
Created September 18, 2010 16:50
Sets global var someGlobal to XHR response
var XMLHttpRequest = require("../XMLHttpRequest").XMLHttpRequest
,xhr
,someGlobal = "foo";
console.log("someGlobal: " + someGlobal);
xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4) {