This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
_UID=$(id -u) | |
GID=$(id -g) | |
# give lxd permission to map your user/group id through | |
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root | |
# set up a separate key to make sure we can log in automatically via ssh | |
# with $HOME mounted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2018 Simon Davy | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script will create xenial and trusty lxd images that will be used by the | |
# lxd provider in juju 2.1+ It is for use with the lxd provider for local | |
# development and preinstalls a common set of production packages. | |
# | |
# This is important, as between them, basenode and layer-basic install ~111 | |
# packages, before we even get to any packages installed by your charm. | |
# | |
# It also installs some helpful development tools, and pre-downloads some |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import sys | |
import itertools | |
import os | |
import numpy as np | |
import pandas as pd | |
import pyarrow as pa | |
import psutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import json | |
from pathlib import Path | |
class ActionConfig: | |
def __init__(self, validator=None): | |
self.validator = validator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from http import HTTPStatus | |
from urllib.request import HTTPError, Request, urlopen | |
def read_response_json(response): | |
if "application/json" in response.headers["Content-Type"]: | |
return json.loads(response.read().decode("utf8")) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenSAFELY Github actions | |
========================= | |
Central repository of github workflows that can be referenced from OpenSAFELY projects. | |
Note: these don't yet exist, I'm trying to figure out what we want. | |
| Study Actions | Description | Stage | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map $upstream_http_www_authenticate $auth_header { | |
~(.*)ghcr.io(.*) $1example.com$2; | |
} | |
server { | |
server_name example.com | |
... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask_socketio import SocketIO | |
import talisker.flask | |
app = Flask(__name__) | |
talisker.flask.register(app) | |
socketio = SocketIO(app) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ONESHELL: | |
python: private SHELL=python | |
python: | |
for i in range(10): | |
print('OMG!') | |
def f(x): | |
print(x) | |
f('this is awesome') |
NewerOlder