Skip to content

Instantly share code, notes, and snippets.

View Roadmaster's full-sized avatar

Roadmaster Roadmaster

  • Montreal, QC, Canada
  • 04:48 (UTC -04:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am Roadmaster on github.
  • I am roadmr (https://keybase.io/roadmr) on keybase.
  • I have a public key whose fingerprint is 0923 F4A9 1878 11DA D163 FE29 B2CD DA8F 8190 A5D0

To claim this, I am signing this object:

# Tarmac lander
#
# This runs tarmac to automatically land launchpad branches on a periodic
# basis
description "Tarmac lander"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
@Roadmaster
Roadmaster / develop-in-lxc.py
Created February 2, 2015 21:14
develop-in-lxc.py
#!/usr/bin/env python3
#
# Copyright 2015 Canonical Ltd.
#
# Authors:
# Daniel Manrique <daniel.manrique@canonical.com>
#
# develop-in-lxc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
# This script will log into the specified IMAP server, select the INBOX,
# then just delete all the messages present there.
import imaplib
the_imap = imaplib.IMAP4_SSL("your-imap-server.com")
print(the_imap.login("your-login", "your-plaintext-password"))
print(the_imap.list())
print(the_imap.select("INBOX"))
typ, data = the_imap.search(None, "ALL")
msg_set = data[0].split()
#!/usr/bin/env python2
# Find and restart lost Juju agents in a Juju2 environment.
import subprocess
import json
juju_output = subprocess.check_output(["juju","status","--format=json"])
the_dict = json.loads(juju_output)
to_fix = {}
@Roadmaster
Roadmaster / gist:f3e214f26a3218dd65d9cdd6f8d67c51
Last active April 18, 2017 04:37
A codeceptjs test (acceptance test). This creates a user in login.ubuntu.com (assumes a development instance with no captcha protection)
Feature('Create an account');
ac_num = Math.floor(Math.random() * 1e10);
var the_mail = "user" + ac_num + "@example.com";
Scenario('test some forms', (I) => {
I.amOnPage("/");
I.see("One account");
I.dontSee("Strength:")
#!/bin/bash
# ./thebuilder.sh tomechangosubanana 1 foo-2017-09-26-01
namespace=${1:-tomechangosubanana}
name=${2:-1}
rev=${3:-2}
cat > snapcraft.yaml <<EOF
name: hello-$namespace-$name
version: $rev
@Roadmaster
Roadmaster / bisecter.py
Created October 4, 2017 21:31
Python unit test bisecter
#!/usr/bin/python3
"""
Find which test in the test list is causing the failure of a known-failing
test. That is - Given a test list which dictates a specific test order,
under which a test X (which passes when run in isolation) is failing, find
out which of the tests that, on the list, run before X, are causing it to
fail.
Many of our test runs use parallelization to run faster. Sometimes we see test
failures which we can't reproduce locally, because locally we usually run
name: lsdalton-roadmr
version: '1.3'
summary: LsDalton quantum chemistry program
description: |
LsDalton quantum chemistry program or computing Hartree-Fock and DFT wave
functions, energies, and molecular properties. For correlated models, MP2
geometry optimizations and CCSD energies (not linear-scaling) are available.
Most parts of lsDalton employ linear scaling and massively parallel
implementations, which makes it suitable for calculations on large molecular
systems, in particular when the calculations are carried out on large super
@Roadmaster
Roadmaster / gist:c00f8aa205ccbe003f6fd24549effe02
Created October 5, 2017 18:52
snap building scripts and yamls
namespace=${1:-tomechangosubanana}
name=${2:-1}
rev=${3:-2}
cat > snapcraft.yaml <<EOF
name: hello-$namespace-$name
version: $rev
summary: say hello
confinement: strict
grade: stable