Skip to content

Instantly share code, notes, and snippets.

View bjmc's full-sized avatar

Brendan McCollam bjmc

View GitHub Profile
@bjmc
bjmc / kingrow_reset.txt
Last active March 28, 2020 01:30
Factory reset procedure for Kingrow K1
Trigger factory reset for Kingrow K1:
0) You'll need 'adb' and 'fastboot' installed. Use Google, or here's a guide:
https://www.androidpit.com/how-to-install-adb-and-fastboot
1) First, get to a state where adb recognizes the device...
1a) Press and hold Volume-Up + Power to get to a screen that says "Software update please wait patiently".
1b) I'm not sure exactly what the trick is from here (please add info if anyone knows), but
@bjmc
bjmc / hangman.py
Created January 26, 2018 09:30
Learning Python: A simple hangman game
import random
# List of words
some_words = [
'aloof',
'radiate',
'apathetic',
'inestimable',
'coil',
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
Client Name,Grant bundle name,Grant_type,Response_type,Client id
0977cdc8_13c0_11e6_a762_22000bf2d559_e_globus_org,,"(u'authorization_code', u'refresh_token', u'urn:globus:auth:grant_type:dependent_token')","(u'code',)",7ed42fb4-1ba2-11e6-9483-57d6b4b116c1
2bedea30-aaed-4994-9b96-6c41ce12be05,confidential_client,"(u'authorization_code', u'client_credentials', u'refresh_token')","(u'code',)",cdbbb45f-123b-4fcf-bc2a-b310b304ad47
5e1cd8a7-b8d5-434e-ba0a-ecc0f9890db7,confidential_client,"(u'authorization_code', u'client_credentials', u'refresh_token')","(u'code',)",5cfc2f6a-0755-41a3-a836-db06fe90a060
5ef475e7-942e-4ad3-871f-219fb38b1f95,,"(u'authorization_code', u'refresh_token', u'urn:globus:auth:grant_type:dependent_token')","(u'code',)",fffba431-37ac-4546-85bb-9185f347dc72
866cf534_2111_11e6_bfe4_22000b1701d1_e_globus_org,,"(u'authorization_code', u'refresh_token', u'urn:globus:auth:grant_type:dependent_token')","(u'code',)",71c0176b-ed2a-4bb6-a7fd-7ac2b4757d60
9343be8d-c88e-459e-8227-ba109277daa9,,"(u'author
@bjmc
bjmc / gist:2c0305c2b7d1c2cd53d194187b3ddf26
Created April 28, 2016 14:39
HTTPS reverse proxy /etc/nginx/sites-enabled/default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
sudo cp migrate_to_sql.py /mnt/globus_deploy/apps/nexus/current/graph/lib/python2.7/site-packages/globusonline-RELEASE_2011_06_06-py2.7.egg/globusonline/graph/admin/migrate_to_sql.py
from globusonline.graph.admin.migrate_to_sql import clear_sql_db, initialize_sql_db, migrate_to_sql
from globusonline.graph.sql import SQLManager, Base
sql_manager = SQLManager()
clear_sql_db(sql_manager.engine(), Base)
initialize_sql_db(sql_manager.engine(), Base)
@bjmc
bjmc / -
Created November 26, 2014 17:52
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://extras.ubuntu.com/ubuntu/ utopic/main i386 Packages
release v=14.10,o=LP-PPA-app-review-board,a=utopic,n=utopic,l=Application Review Board PPA,c=main
origin extras.ubuntu.com
500 http://extras.ubuntu.com/ubuntu/ utopic/main amd64 Packages
release v=14.10,o=LP-PPA-app-review-board,a=utopic,n=utopic,l=Application Review Board PPA,c=main
origin extras.ubuntu.com
500 http://archive.canonical.com/ubuntu/ utopic/partner Translation-en
GLOB sdist-make: /home/bjmc/Sandbox/apscheduler/setup.py
py26 inst-nodeps: /home/bjmc/Sandbox/apscheduler/.tox/dist/APScheduler-3.1.0.dev1.zip
py26 runtests: commands[0] | py.test -rsx
============================= test session starts ==============================
platform linux2 -- Python 2.6.9 -- py-1.4.20 -- pytest-2.5.2
collected 411 items
tests/test_executors.py ........
tests/test_expressions.py ..........................
tests/test_job.py .....................................
@bjmc
bjmc / tox_results.txt
Last active August 29, 2015 14:03
apscheduler tox test results
GLOB sdist-make: /home/bjmc/Sandbox/apscheduler/setup.py
py26 inst-nodeps: /home/bjmc/Sandbox/apscheduler/.tox/dist/APScheduler-3.1.0.dev1.zip
py26 runtests: commands[0] | py.test -rsx
============================= test session starts ==============================
platform linux2 -- Python 2.6.9 -- py-1.4.20 -- pytest-2.5.2
collected 1387 items / 2 errors
.env/lib/python2.7/site-packages/flake8/tests/test_engine.py .....
.env/lib/python2.7/site-packages/pyflakes/test/test_api.py ..........................FFFF
.env/lib/python2.7/site-packages/pyflakes/test/test_doctests.py ...............................................................................................................................................................
>>> tz = tzlocal.get_localzone()
>>> utc = pytz.timezone("UTC")
>>> utc
<UTC>
>>> import datetime
>>> now = datetime.datetime.now()
>>> now
datetime.datetime(2014, 6, 27, 12, 6, 12, 676354)
>>> tz
<DstTzInfo 'America/Los_Angeles' LMT-1 day, 16:07:00 STD>
@bjmc
bjmc / install_sentry.sh
Created June 26, 2014 01:32
Basic setup script for installing Sentry (http://getsentry.com) + Redis on new Ubuntu 14.04 Amazon EC2 instance
#! /bin/bash
export RUN_AS='ubuntu';
export INSTALL_DIR='/var/www/sentry';
HOSTNAME='http://mysentry.example.com'; # No trailing slash
DB_HOST='something.rds.amazonaws.com';
DB_PORT='5432';
DB_USER='sentry';
DB_NAME='sentry';
DB_PASSWORD='DB_PASSWORD';