Skip to content

Instantly share code, notes, and snippets.

View djmitche's full-sized avatar

Dustin J. Mitchell djmitche

View GitHub Profile
@djmitche
djmitche / @@INTRO.md
Last active April 11, 2024 06:13
My use of Taskwarrior

Getting Started

My Usage

I've been using this for almost ten years now, so here are some of the ways I have set it up to be most productive. See my taskrc below for implementation details.

In general, I've had the most success by keeping lists of tasks short and to the point, avoiding the anxiety of seeing 100 tasks and feeling like I'm going to drown.

@djmitche
djmitche / test.md
Created September 19, 2012 23:21
markdown playground

What? This doesn't look like a README!

Right, this is the TODO list for Buildbot-0.9.0. We'll delete this once it's empty. Pitch in!

Infrastructure

  • Parsing of endpoint options is currently left to the endpoint, which will lead to inconsistencies. Add and document some helper methods to base.Endpoint for parsing e.g., boolean options (supporting on/off, 0/1, true/false, etc.)
  • Optimize the type verification system by dynamically creating verifier functions once.
@djmitche
djmitche / git-prompt.sh
Created January 15, 2009 16:59 — forked from henrik/.bashrc
edit existing PS1; be more efficient
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir [master] $ # clean working directory
# username@Machine ~/dev/dir [master*] $ # dirty working directory
# djmitche: *edit* an existing PS1 to add the git information
# djmitche: only invoke 'git' and 'sed' once (each) for each prompt
# djmitche: display [NO BRANCH] when not on a branch (e.g., during rebase -i)
# djmitche: almost completely replace with __git_ps1 from git contrib, which
# gives more information and avoids calling git scripts if possible
@djmitche
djmitche / mozilla-levels.md
Last active February 23, 2022 13:33
Mozilla Levels

[UPDATE June 2020]

The Mozilla Phonebook now shows staff levels by name in the "Official Job Title" field. This marks an improvement in transparency of levels within the organization!

Some of the technical details in this post, such as where to find your level, are out of date but preserved here.

The sections below on leveling-up and mis-leveling remain as relevant now as when this Gist was first written.

@djmitche
djmitche / signin-aws
Last active July 28, 2021 18:44 — forked from jonasfj/signin-aws
A simple script for forcing 2FA usage with AWS credentials
#!/bin/bash
# This script expects AWS credentials:
# SIGNIN_AWS_ACCESS_KEY_ID
# SIGNIN_AWS_SECRET_ACCESS_KEY
# Or it will use the credentials set up with `aws configure` if those are not set.
#
# It optionally epects the TOTP entry name in your yubikey
# SIGNIN_AWS_YUBIKEY_OATH_NAME
# Put these environment variables into your .bashrc.local (or .bashrc, if you
  • pull master and push to main
  • update the default branch in GitHub settings (under "branches")
  • copy the branch protection settings (manually) from master to main
  • update automation to look at main instead of master and make a PR
    • also fix any links -- look for github.com/taskcluster/$REPO/
  • change community-tc-config if necessary
  • delete branch protection for master, push a new history-free commit there with a README (something like https://github.com/taskcluster/taskcluster/commit/5d2ef402861dee513bdf94c704dcbf6bad12bce3)
  • re-enable branch protection for master, require linear commits, and include administrators
  • for any open PRs, click "edit" and change the base branch to main

Run this as python3 gcloud-tail.py FILTER. The result is in JSON format, with one line per log message. You can process the results with jq.

import csv
import sys
def common(row):
row['tz'] = row['Time Availability'].split('(')[0]
rv = '''
<li><em>Avaialble as:</em> {ml}</li>
<li><em>Time Availability:</em> {tz}</li>
<li><em>Organizational Level:</em> {org}</li>
<li><em>Organization:</em> {Organization}</li>
import json
import sys
import os
import urllib.request
def main():
rootUrl = os.environ["TASKCLUSTER_ROOT_URL"]
workerPoolId = sys.argv[1]
apiUrl = rootUrl + "/api/worker-manager/v1/workers/" + workerPoolId
#! /usr/bin/env python3
import re
import sys
import json
import urllib.request
import argparse
import subprocess
# get config
try: