Skip to content

Instantly share code, notes, and snippets.

View MorganDavis's full-sized avatar

Morgan Davis MorganDavis

View GitHub Profile
@MorganDavis
MorganDavis / gist:7bed784bd9ab65eabf2302b56aac779b
Created October 2, 2017 21:55
Verifying that "morgandavis.id" is my Blockstack ID. https://onename.com/morgandavis
Verifying that "morgandavis.id" is my Blockstack ID. https://onename.com/morgandavis
@MorganDavis
MorganDavis / gist:0a1ef19c6d77c4d9331a
Created January 20, 2015 18:38
Upgrade pip packages
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)

Keybase proof

I hereby claim:

  • I am morgandavis on github.
  • I am morgandavis (https://keybase.io/morgandavis) on keybase.
  • I have a public key whose fingerprint is B9D4 BB0D E2E1 5737 3CBC D3A6 229E 4397 9435 8D9E

To claim this, I am signing this object:

@MorganDavis
MorganDavis / gist:b9df6839212e676cb749
Created July 27, 2014 20:04
Generate a 'Cisco Type 5' password hash:
#OpenSSL passwd will create the proper format, but uses an 8 char salt by default
#Have rand create a 3 byte value and base64 for 4 chars instead
openssl passwd -salt `openssl rand -base64 3` -1 5upers3kr1t
@MorganDavis
MorganDavis / .osx
Created July 18, 2014 22:17
Useful defaults for OSX
# I keep this file at ~/.osx
# Note that it doesn't auto execute, but you can execute it like a shell script
# and sudo lines will ask you for your password
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
#disable sleeping when pressing the power button on 10.9.2, also makes diaglog appear quicker
defaults write com.apple.loginwindow PowerButtonSleepsSystem -bool no
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking-mode
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold-mode
export LESS_TERMCAP_me=$'\E[0m' # end (blinking/bold)-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
export LESS_TERMCAP_ue=$'\E[0m' # end underline
@MorganDavis
MorganDavis / 0_reuse_code.js
Created December 2, 2013 06:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@MorganDavis
MorganDavis / ruggedpass.py
Created May 26, 2012 01:51
RuggedCom - Backdoor Password from MAC
#!/usr/bin/python
"""A python implementation of the RuggedCom Backdoor detailed at:
http://lists.grok.org.uk/pipermail/full-disclosure/2012-April/086652.html
All credit goes to JC Crew - just re-writing in python.
for the input mac of: 00-0A-DC-00-00-00
you should get the password of: 60644375"""
import re
@MorganDavis
MorganDavis / gcertcheck.py
Created April 18, 2011 19:11
This script will attempt to verify the certificate for the host name specified in the Google Certficate Database.
#!/usr/bin/python
import ssl, hashlib
from datetime import date
from optparse import OptionParser
try:
from dns.resolver import query
from dns.exception import DNSException
except ImportError: