Skip to content

Instantly share code, notes, and snippets.

Corey Gilmore cfg

Block or report user

Report or block cfg

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
@cfg
cfg / dns_lookup.py
Created May 30, 2019
Use python for quick dns lookups when other tools (dig, host, nslookup) aren't available
View dns_lookup.py
import socket
list( map( lambda x: x[4][0], socket.getaddrinfo('example.com.', 80, 0, socket.SOCK_STREAM) ))
@cfg
cfg / .bashrc
Created May 6, 2019
Storing sensitive environment variables the keychain, selectively setting them on a per-application basis.
View .bashrc
source ~/bash.includes/keychain-environment-variables.sh
function aws-vault() {
/usr/local/bin/aws-vault-wrapper "$@"
}
# example wrapper
## function cloudns-api() {
## (
## export CLOUDNS_API_ID=$(keychain-environment-variable CLOUDNS_API_ID)
@cfg
cfg / ga_spreadsheet_onedit_timetimestamp.js
Created Apr 12, 2017
Google Sheets: Add a "last modified" timestamp to a row when a cell in a specific column is changed. Quick, hacky code, per usual.
View ga_spreadsheet_onedit_timetimestamp.js
function onEdit( evt ) {
var ss = SpreadsheetApp.getActiveSheet();
var sheet_name = 'Bug List';
if ( sheet_name !== ss.getName() ) {
return;
}
var status_col = 8; // column number that contains the status type
var lastmod_col = 10; // column number where the timestamp should go
@cfg
cfg / gist:4585f041cd069d3f2639e53fc33ae281
Created Apr 4, 2017
Extracting 2FA seeds from Authy
View gist:4585f041cd069d3f2639e53fc33ae281
Open chrome://extensions, debug Authy main.html
Set a breakpoint in Authy app.js in this function:
d.prototype.getOtp = function() {
return this.isEncrypted() ? "------" : this.otpGenerator.getOtp(this.decryptedSeed, this.digits)
}
Can use a conditional breakpoint, where this.getName() == 'your.account.display.name'
console.log( "otpauth://totp/%s:%s?secret=%s&issuer=%s", encodeURIComponent( this.getAccountName() ), encodeURIComponent( this.getName() ), encodeURIComponent(this.decryptedSeed), this.getAccountName() );
@cfg
cfg / compile_futurerestore.sh
Created Jan 1, 2017
Compile futurerestore from @tihmstar on OS X
View compile_futurerestore.sh
brew install openssl
git clone --recursive git@github.com:tihmstar/futurerestore.git
cd futurerestore/
export PKG_CONFIG_PATH=/usr/local/share/pkgconfig:/usr/local/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig
./autogen.sh
make
./futurerestore/futurerestore
View WWDC Line hax
// June 11, 2012
// https://twitter.com/b3ll/status/212169466665111552
-(BOOL)isBlocked
{
return false;
}
-(int)epicWWDCLineHacks
{
@cfg
cfg / print_stormchat.js
Created Sep 13, 2016
Make a StormChat print friendly
View print_stormchat.js
jQuery('#bottom-bar').remove();
jQuery('#contact-list').remove();
jQuery('html').css('overflow', 'auto');
jQuery('#chat-room').css({ 'height': 'auto', 'width': '100%', 'overflow-y': 'auto' });
View extract slack contact info.js
// Browse to https://my.slack.com/team#active and open the developer console
x=[];
jQuery('#active_members_list .team_list_item.member_item.active').each( function(ix, el) {
el = jQuery(el);
if( el.find('.member_image.bot').length ) {
return; // skip bots
}
var details = {
name: el.find('.member_name').text(),
tel: el.find('.member_data_table a[href^=tel]').text(),
@cfg
cfg / floatsign.sh
Created Jul 25, 2016 — forked from mediabounds/floatsign.sh
A small bash script to re-sign iOS applications.
View floatsign.sh
#!/usr/bin/env bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
#
# Extended by Ronan O Ciosoig January 2012
#
# Extended by Patrick Blitz, April 2013
@cfg
cfg / sshkey.bash
Created Jul 22, 2016
Attempt to locate the SSH public and private key used for a host/user@host.
View sshkey.bash
#!/usr/bin/env bash
HOST="$1"
[[ -z "$HOST" ]] && (>&2 echo "Usage: $0 [user@]hostname") && exit 1
OUT="$(ssh -o ConnectionAttempts=1 -o ConnectTimeout=2 -o StrictHostKeyChecking=no -o "PreferredAuthentications=publickey" -T "$HOST" -v true 2>&1 | grep -B3 "Authentication succeeded (publickey)" )"
RET="$?"
if [[ "$RET" -ne "0" ]] ; then
(>&2 echo "ERROR (errno: $RET): Unable to connect or authenticate to $HOST")
You can’t perform that action at this time.