The following snippets can be used to build a cross platform script to manage a local Anaconda environment by anyone.
conda create -y -p ./.env python=3.9 && conda activate ./.env
conda deactivate
# Based on https://www.tensorflow.org/datasets/keras_example | |
# Requires numpy, pygame, tensorflow and tensorflow-datasets | |
NUMBER_OF_EPOCHS = 8 | |
import numpy as np | |
import pygame | |
pygame.init() | |
pygame.display.set_caption('MNIST digits') |
function pollNESController() { | |
const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : []); | |
const controllerInput = { | |
isPresent: false, | |
dpad: '', | |
select: 0, | |
start: 0, | |
a: 0, | |
b: 0 | |
}; |
#!/usr/bin/python3 | |
import os, sys, requests, re, html | |
banner = ''' | |
#================================================== | |
# A script to process youtube playlist takeout | |
#================================================== | |
''' | |
print(banner) |
#!/usr/bin/python3 | |
import time, hashlib, hmac, base64 | |
secret = 'q5ma qo4x irgv cm6k auai kjyv ak57 5keu' | |
T_0 = 0 | |
X = 30 | |
d = 6 | |
K = base64.b32decode(secret.upper().replace(' ', '')) |
#==================== | |
# Settings | |
#==================== | |
$superSampling = 2 | |
$urlTemplate = "https://picsum.photos/{width}/{height}?grayscale" | |
#==================== | |
# Await connection | |
#==================== | |
$null = $urlTemplate -match "^https?://([^/]*)/" |
#!/usr/bin/python3 | |
import json | |
from pathlib import Path | |
from subprocess import PIPE, Popen | |
import sys | |
""" | |
Before using this script: | |
- Configure AWS cli to output JSON (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output-format.html) |
#!/usr/bin/python3 | |
import argparse, requests | |
url_request_code = ( | |
"https://identitytoolkit.googleapis.com/v1/accounts:sendVerificationCode" | |
) | |
url_sign_in_with_phone_number = ( | |
"https://identitytoolkit.googleapis.com/v1/accounts:signInWithPhoneNumber" | |
) |
#! /usr/bin/bash | |
ACCOUNT=$1 | |
USER=$2 | |
OTP=$3 | |
PROFILE=$4 | |
if [ -n "$PROFILE" ]; then | |
PROFILE="--profile $PROFILE" | |
fi |
#! /bin/bash | |
if [ "$1" == "rm" ] | |
then | |
nmcli connection delete eduroam 2>/dev/null | |
exit | |
fi | |
if [ -z "$(nmcli con show | grep eduroam)" ] | |
then |