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 | |
cat << EOF > fly.toml | |
app = "dockerignore" | |
primary_region = "yul" | |
kill_timeout = 10 | |
kill_signal = "SIGINT" | |
[[services]] | |
internal_port = 80 |
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 | |
# Create lxc profile with apt caching | |
# Requires installing apt-cacher-ng to 10.0.4.1 (your host) | |
# Could be improved by making the actual apt cache host tunable | |
# Then use like: | |
# lxc launch -p default -p aptcache ubuntu:16.04 my-cached-container | |
NAME=aptcache | |
CACHE_IP=$(ip addr list lxdbr0 | grep -Po 'inet \K[\d.]+') | |
if ! ping -c 1 "$CACHE_IP" -w 1 >/dev/null 2>&1; then |
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 up an lxc container with google chrome so it runs confined but displayed on the | |
# localhost. | |
# Adapted from https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/ | |
# Assume setguid/setid for root is properly setup | |
# root:1000:1 | |
# Assume aptcache profile exists, see https://gist.github.com/Roadmaster/754110f3f49fef19ec89ae29f29edd11 | |
LXC_NAME=chrome-container |
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 | |
SNAP_NAME=lxd | |
info=$(curl -s https://api.snapcraft.io/v2/snaps/info/$SNAP_NAME -H "Snap-Device-Series: 16") | |
url=$(echo $info | jq -r '."channel-map"[0]."download"."url"') | |
snapid=$(echo $info | jq -r '."snap"."snap-id"') | |
# Download snap | |
echo "Downloading snap from $url" |
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
#!/usr/bin/env python3 | |
# Adds an existing account to Person/LP teams (creates the teams as well) | |
# Mainly for SAML testing | |
from identityprovider.tests.factory import SSOObjectFactory | |
from identityprovider.models import Account | |
teams = ("footeam", "barteam", "bazteam") | |
theaccount = Account.objects.get(displayname='foomaster') |
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
def roadmr_mini_openssl_dgst(): | |
print("HELLO") | |
print("let's try to reimplement openssl") | |
#openssl dgst -sha1 -verify sample-public-key.pub -signature /tmp/signature /tmp/data | |
pubkeyfile = "keys/sample/sample-public-key.pub" | |
signaturefile = "keys/sample/signature" | |
datafile = "keys/sample/data" | |
pubkey = M2Crypto.EVP.load_key_string_pubkey( | |
open("keys/sample/sample-public-key.pub", "rb").read()) |
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
The sender needs to do this: | |
Create a file /tmp/attest with something like "blah", then sign it with: | |
openssl dgst -sha512 -sign ~/.ssh/id_rsa /tmp/attest > /tmp/attest.sig | |
then base64-encode the sig and the attest file: | |
base64 /tmp/attest >/tmp/attest.b64 | |
base64 /tmp/attest.sig >/tmp/attest.sig.b64 |
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
<script type="text/javascript"> | |
// Python to obtain the serverArgJson | |
/* | |
from webauthn import WebAuthnMakeCredentialOptions | |
chor = WebAuthnMakeCredentialOptions( | |
challenge="ar"*16, | |
rp_name="Ubuntu One SSO", | |
# VERY IMPORTANT: the RP_ID must MATCH the URL/HOSTNAME. |
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 | |
CRT_BRANCH=/src/click-reviewers-tools/review-tools # git branch | |
SCA_BRANCHES=/src/software-center-agent | |
WANTED_RELEASE=$1 | |
NEW_BRANCH=sca-crt-$WANTED_RELEASE | |
if [ -z $WANTED_RELEASE ]; then | |
echo "Didn't indicate a wanted release" | |
exit 1 | |
fi |
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
Small format (no 4k monstrosities thanks): | |
youtube-dl -f "[height <= 1024]" -a bru.txt | |
Good quality: | |
youtube-dl -f "bestvideo+bestaudio[ext=m4a]" |
NewerOlder