Skip to content

Instantly share code, notes, and snippets.

Josh Mize jgmize

Block or report user

Report or block jgmize

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
@jgmize
jgmize / github_issues.py
Last active Oct 7, 2018 — forked from patrickfuller/github_issues_to_csv.py
Export Issues from Github repo to json or csv (API v3)
View github_issues.py
#!/usr/bin/env python3
"""
Exports issues from a list of repositories to individual csv files.
Uses basic authentication (Github username + password) to retrieve issues
from a repository that username has access to. Supports Github API v3.
Forked from https://gist.github.com/patrickfuller/e2ea8a94badc5b6967ef3ca0a9452a43
"""
import argparse
import csv
import json
@jgmize
jgmize / replication-lag.md
Last active Mar 20, 2018
Replication lag ETA
View replication-lag.md
delay=60
cmd="mysql -e 'show slave status\G' | grep Seconds_Behind_Master | awk '{print \$2}'"
while sleep $delay; do   eval $cmd; done | mawk -W interactive -v delay=$delay '
{
   passed += delay;
View oregon-b.org

bedrock

bedrock-dev

mkdir -p ~/tmp/bedrock-dev
cd ~/tmp/bedrock-dev
wget https://raw.githubusercontent.com/mozilla/bedrock/master/Procfile
DEIS_PROFILE=usw deis config:pull -a bedrock-dev
export DEIS_PROFILE=oregon-b
deis2 create bedrock-dev
deis2 config:push -a bedrock-dev
View gist:ce347c600f0037be3511923d1ec5bdb5
Verifying my Blockstack ID is secured with the address 1C1iZRBZSDYuKENdR46or7DAcFzusyqCQ2 https://explorer.blockstack.org/address/1C1iZRBZSDYuKENdR46or7DAcFzusyqCQ2
@jgmize
jgmize / jenkins-demo-deploy.sh
Created Sep 1, 2016
Jenkins demo deploy script
View jenkins-demo-deploy.sh
export UPDATE_DOCKER_IMAGES=true
export DOCKERFILE=bedrock_base
export DOCKER_REPOSITORY=mozorg/bedrock_base
./docker/jenkins/build_image.sh
export UPDATE_DOCKER_IMAGES=false
export DOCKERFILE=bedrock_code
export DOCKER_REPOSITORY=mozorg/bedrock_code
export FROM_DOCKER_REPOSITORY=mozorg/bedrock_base
./docker/jenkins/build_image.sh
@jgmize
jgmize / Dockerfile
Created Aug 18, 2016
postgresql-client docker install on top of quay.io/mozmar/base
View Dockerfile
FROM quay.io/mozmar/base
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7
RUN apt-get update && apt-get install -y postgresql-client
@jgmize
jgmize / legacy_release_note_map.py
Created Jan 23, 2014
Extract relations of releases to notes from legacy db to new schema in RNA
View legacy_release_note_map.py
import json
from django.db.models import Q
from rna.models import Release, Note
def dump_release_notes_map(filename='release-notes-map.json'):
"used on the legacy side with the legacy models"
with open(filename, 'w') as f:
json.dump(
[(release.id, list(
@jgmize
jgmize / gist:6529655
Created Sep 11, 2013
Proposal of how to deal with legacy PHP lang param usage conflict with funfactory.middleware.LocaleURLMiddleware
View gist:6529655
from funfactory.middleware import LocaleURLMiddleware
from django.conf import settings
class ExceptionalLocaleURLMiddleware(LocalURLMiddleware):
"""
Replacement for funfactory.middleware.LocaleURLMiddleware that supports excluding
specific paths from getting redirected if a lang param is present in the request.
"""
def process_request(self, request):
if 'lang' in request.GET and request.path in getattr(
@jgmize
jgmize / contentlengths.py
Created Feb 26, 2013
get URL content lengths using requests, a gevent process pool, and redis
View contentlengths.py
#!/usr/bin/env python
import logging
import re
from gevent import monkey, spawn
from gevent.pool import Pool
monkey.patch_all()
from redis import Redis
import requests
View jenkins-stack-trace.txt
Stack trace
javax.servlet.ServletException: net.sf.json.JSONException: JSONObject["tag"] not found.
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$13.dispatch(MetaClass.java:411)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$13.dispatch(MetaClass.java:411)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
You can’t perform that action at this time.