Skip to content

Instantly share code, notes, and snippets.

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 March 18, 2021 12:25 — forked from patrickfuller/github_issues_to_csv.py
Export Issues from Github repo to json or csv (API v3)
#!/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 March 20, 2018 14:31
Replication lag ETA
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;
@jgmize
jgmize / oregon-b.org
Created January 25, 2018 05:52
Oregon-b

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
Verifying my Blockstack ID is secured with the address 1C1iZRBZSDYuKENdR46or7DAcFzusyqCQ2 https://explorer.blockstack.org/address/1C1iZRBZSDYuKENdR46or7DAcFzusyqCQ2
@jgmize
jgmize / jenkins-demo-deploy.sh
Created September 1, 2016 04:38
Jenkins demo deploy script
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 August 18, 2016 14:36
postgresql-client docker install on top of quay.io/mozmar/base
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
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)
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
40753/0x21fab: 7 stat64("/System/Library/Frameworks/Quartz.framework/Versions/A/Quartz\0", 0x7FFF5FBFDB78, 0x7FFF5FBFEA80) = 0 0
  • 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/