View deploy-all-regions.sh
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
# Create AWS Ethereum Miner in all available regions | |
# See https://github.com/mludvig/aws-ethereum-miner | |
ETH_WALLET=0x99b36B44cf319c9E0ed4619ee2050B21ECac2c15 | |
HASHRATE=1000 # Desired hashrate in MH/s, i.e. 1000 = 1 GH/s | |
REGIONS=$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text) | |
for REGION in ${REGIONS}; do | |
echo "== ${REGION} ==" | |
aws --region ${REGION} cloudformation create-stack \ |
View pythonstart.py
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
# startup script for python to enable saving of interpreter history and | |
# enabling name completion | |
# import needed modules | |
import atexit | |
import os | |
import readline | |
import rlcompleter | |
# where is history saved |
View aws-gpu-2021.csv
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
Instance Type | GPU Type | CPUs | Measured MH/s | Spot Price / hr | MH/s per $1 | |
---|---|---|---|---|---|---|
g5.xlarge | 1x Tesla A10g | 4 | 56 | $0.30 | 186 | |
g4dn.xlarge | 1x Tesla T4 | 4 | 25 | $0.16 | 158 | |
p4d.24xlarge | 8x Tesla A100 | 96 | 1404 | $9.83 | 143 | |
g4dn.2xlarge | 1x Tesla T4 | 4 | 25 | $0.23 | 111 | |
p3.8xlarge | 4x Tesla V100 | 32 | 372 | $3.67 | 101 | |
p3.16xlarge | 8x Tesla V100 | 64 | 744 | $7.34 | 101 | |
p3.2xlarge | 1x Tesla V100 | 8 | 93 | $0.92 | 101 | |
g5.24xlarge | 4x Tesla A10g | 96 | 226 | $2.44 | 93 | |
g5.48xlarge | 8x Tesla A10g | 192 | 452 | $4.89 | 93 |
View profile-local.sh
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 | |
# Save as /etc/profile.d/local.sh or as your local ~/.bash_profile | |
# By Michael Ludvig <mludvig@logix.net.nz> | |
umask 022 | |
if [ $(id -u) = "0" ]; then | |
# Prompt is RED for root | |
_PS1COLOUR=31 | |
else |
View scan2pdf.sh
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 -e | |
## Put your sane-detected device name here. | |
#DEVICE="snapscan" | |
## For network scanners use | |
#DEVICE="net:sane.example.org:snapscan" | |
DEVICE='brother4:net1;dev0' | |
## See scanimage --device $(DEVICE) --help | |
SOURCES[0]="FlatBed" |
View aws-gpu-1.csv
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
Instance Type | GPU Type | Number of GPUs | |
---|---|---|---|
g3s.xlarge | Tesla M60 | 1 | |
g4dn.xlarge | Tesla T4 | 1 | |
g4dn.2xlarge | Tesla T4 | 1 | |
g4dn.12xlarge | Tesla T4 | 4 | |
p2.xlarge | Tesla K80 | 1 | |
p3.2xlarge | Tesla V100 | 1 | |
p3.8xlarge | Tesla V100 | 4 |
View aurora-standalone.yml
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: PostgreSQL Aurora Cluster | |
Metadata: | |
Author: Michael Ludvig <michael.ludvig@enterpriseit.co.nz> | |
Parameters: | |
DbName: | |
Type: String |
View cfn-service-role-and-policy.yml
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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: CloudFormation Service Role and Policy | |
Metadata: | |
Author: Michael Ludvig | |
Url: https://aws.nz/best-practice/cloudformation-service-roles/ | |
Parameters: | |
RoleName: |
View ssml_simple.py
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 | |
# ssml_simple.py - Basic SSML-enhanced text output | |
# Author Michael Ludvig | |
# Import play_audio_stream() from audio_helper.py | |
from audio_helper import play_audio_stream | |
# Boto3 is the AWS SDK for Python | |
import boto3 |
View describe_voices.py
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 | |
# describe_voices.py - describe and play all AWS Polly voices | |
# Author Michael Ludvig | |
import boto3 | |
from audio_helper import play_audio_stream | |
polly = boto3.client('polly') |
NewerOlder