This is my total crap script(s) to figure out the space used on disk and number of rows for tables in kitsune.
Do:
- edit
get_schema.sh
replacing paths with paths for your system
#!/usr/bin/env python | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, you can obtain one at http://mozilla.org/MPL/2.0/. | |
# This expects Python 3 | |
from distutils.spawn import find_executable | |
from http.client import HTTPSConnection |
import json | |
import os | |
try: | |
import requests | |
from tabulate import tabulate | |
except ImportError: | |
print 'Please install "requests" and "tabulate" packages.' | |
#!/usr/bin/env python | |
""" | |
Takes a mysql db dump in the form of: | |
blah blah blah | |
INSERT INTO `table_name` VALUES (...) | |
INSERT INTO `table_name` VALUES (...) | |
It parses it and returns number of rows and total bytes of data per |
.promoted-tweet { | |
display: none; | |
} |
import argparse | |
import os | |
def get_python_packages(packages_dir): | |
os.chdir(packages_dir) | |
paths = [path for path in os.listdir('.') if os.path.isdir(path)] | |
packages = {} | |
for package_name in paths: |
Breakdown of happy/sad data by locale for Firefox OS.
Fork this gist and tweak your own dashboard. Keep in mind that Input requests are throttled. If you're tweaking things, you might want to switch to the stage server at input.allizom.org and then switch to the prod server when your code is more stable.
If you have an interesting dashboard, let me know!
/will
This is a proof of concept for using Input data with d3 to generate your own dashboard.
Fork this gist and tweak your own dashboard. Keep in mind that Input requests are throttled. If you're tweaking things, you might want to switch to the stage server at input.allizom.org and then switch to the prod server when your code is more stable.
If you have an interesting dashboard, let me know!
""" | |
This is the rule in my fabfile.py that generates the bulk of the | |
status reports I send every two weeks. | |
""" | |
from fabric.api import local | |
REVISION_URL = 'https://input.mozilla.org/media/revision.txt' | |
PRIMARY_DEVS = [ |
#!/usr/bin/env python | |
""" | |
james.py - Chief CLI. | |
USAGE: james.py ENV REF | |
ENV - Environment defined in the config file to deploy to. | |
REF - A git reference (like a SHA) to deploy. | |
Config: james.ini in the current directory should be an ini file with | |
one section per environment. Each environment should have a |