Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Mize jgmize

  • Tulsa, OK
View GitHub Profile
View fetch_daily_snippet_metrics.py
from datetime import datetime, timedelta
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from redash_dynamic_query import RedashDynamicQuery
from snippets.base.models import ASRSnippet, DailySnippetMetrics
@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
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)
View emacs.dtruss
This file has been truncated, but you can view the full file.
sudo dtruss -e -f -n emacs 2> emacs.dtruss
PID/THRD ELAPSD SYSCALL(args) = return
40753/0x21fab: 4 thread_selfid(0x7FBC99703090, 0x7FBC99409E60, 0x7FBC9940B0B0) = 139179 0
40753/0x21fab: 2 csops(0x0, 0x0, 0x7FFF5FBFEA80) = 0 0
40753/0x21fab: 2 issetugid(0x0, 0x0, 0x7FFF5FBFEA80) = 0 0
40753/0x21fab: 3 shared_region_check_np(0x7FFF5FBFC978, 0x0, 0x7FFF5FBFEA80) = 0 0
40753/0x21fab: 12 stat64("/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon\0", 0x7FFF5FBFDB78, 0x7FFF5FBFEA80) = 0 0
40753/0x21fab: 7 stat64("/System/Library/Frameworks/WebKit.framework/Versions/A/WebKit\0", 0x7FFF5FBFDB78, 0x7FFF5FBFEA80) = 0 0
View mismatched-static-hash.org
  • failing tests
    • https://ci.us-west.moz.works/job/bedrock_test_prod_us_west/97/console
      =================================== FAILURES ===================================
      E               Exception: css selector:.partner-button > a is not visible
      Failing URL: https://bedrock-prod-deis.us-west.moz.works/en-US/firefox/partners/
      E               Exception: css selector:.partner-button > a is not visible
      Failing URL: https://bedrock-prod-deis.us-west.moz.works/en-US/firefox/partners/
      E               Exception: css selector:.partner-button > a is not visible
      Failing URL: https://bedrock-prod-deis.us-west.moz.works/en-US/firefox/partners/
              
You can’t perform that action at this time.