I hereby claim:
- I am jorng on github.
- I am robprentiss (https://keybase.io/robprentiss) on keybase.
- I have a public key ASDCDcRI4mfcEiUn6l4-2JVtNvZN9a2ZguDNlOU5_expDQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# This block defines the variables the user of the script needs to input | |
# when deploying using this script. | |
# | |
#<UDF name="hostname" label="The hostname for the new Linode." default="gitea"> | |
#<UDF name="FQDN" label="The new Linode's Fully Qualified Domain Name"> | |
#<UDF name="POSTGRES_PASSWORD" label="The password to use for PostgreSQL"> | |
#<UDF name="GITEA_VERSION" label="The Gitea Version to install" default="1.5" oneof="1.4.0,1.4.1,1.4.2,1.4.3,1.5"> | |
# This sets the variable $IPADDR to the IP address the new Linode receives. |
import re | |
from math import ceil | |
import hashlib | |
def base64Regex(byteLength): | |
padLength = (3 - (byteLength % 3)) if (byteLength % 3) > 0 else 0 | |
strLength = int(ceil(byteLength / 3.)) * 4 - padLength | |
padding = '=' * padLength | |
regexString = '[a-zA-Z0-9+/]{{{strLength}}}{padding}'.format(**locals()) |
#! /usr/bin/python | |
def downloadFileWithProgress(url, downloadFolder='./', sha1=None, chunk_size=8192): | |
import requests, sys | |
""" | |
Function to download a file from the specified URL. | |
Outputs a basic progress bar and download stats to the CLI. | |
Optionally downloads to a specified download folder, and checks the SHA1 checksum of the file. | |
Chunk size can also be specified, to control the download. |
set progress description to "A simple progress indicator" | |
set progress additional description to "Preparing…" | |
set progress total steps to -1 | |
delay 5 | |
set progress total steps to 100 | |
repeat with i from 1 to 100 | |
try | |
set progress additional description to "I am on step " & i |
#!/bin/bash | |
OSXVersion=$(sw_vers -buildVersion) | |
if [[ "$OSXVersion" < "12A" ]]; then | |
ServerAdminPath="/usr/sbin/serveradmin" | |
else | |
ServerAdminPath="/Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin" | |
fi | |
if [ ! -e $ServerAdminPath ]; then | |
echo "Unable to find 'serveradmin' tool. Is Server.app in the Applications folder?" | |
exit 1 |