This file contains hidden or 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
| #Install ZNC | |
| sudo apt-get update | |
| sudo apt-get install znc | |
| #Configure Timezone on server | |
| echo "Europe/Madrid" | sudo tee /etc/timezone | |
| sudo dpkg-reconfigure --frontend noninteractive tzdata | |
| #This is for running on a EBS Only t2.micro instance (covered under the free tier) | |
| #No need to mount EBS volume separately, root fs is already RW and EBS backed |
This file contains hidden or 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 python | |
| import argparse | |
| import tempfile | |
| import subprocess | |
| import traceback | |
| def u(somebytes): | |
| return None if somebytes is None else somebytes.decode('utf-8') |
This file contains hidden or 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 | |
| ## Launch the latest daily Ubuntu in AWS, optionally with user-data | |
| ## provided in a file and tagged with a name | |
| function usage() { | |
| echo "$0: [-r region] [-V ubuntu_version] [-i instance_type] \\" | |
| echo " [-u user_data_file] [-n instance_name] [-d disk_size] \\" | |
| echo " [-D] to disable termination via the API" | |
| echo " [-I] iam instance profile [-a AMI ID]" | |
| echo " [-P profile] aws cli profile" |
This file contains hidden or 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
| # Get the Ubuntu cloud image of your choosing (this example uses the latest Xenial daily) | |
| wget http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img | |
| # Set the cloud-init datasource to use explicitly (this example uses the EC2 datasource) | |
| sudo mount-image-callback xenial-server-cloudimg-amd64-disk1.img -- \ | |
| sh -c 'echo "datasource: Ec2" > $MOUNTPOINT/etc/cloud/ds-identify.cfg' | |
| # Confirm the current datasource configuration | |
| sudo mount-image-callback xenial-server-cloudimg-amd64-disk1.img -- \ | |
| chroot _MOUNTPOINT_ cat /etc/cloud/ds-identify.cfg |
This file contains hidden or 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 | |
| SOURCE=/volume1 | |
| DEST=/volume2 | |
| APPDIR=\@appstore | |
| ASK=true | |
| while getopts ":y" opt; do | |
| case $opt in |
This file contains hidden or 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
| # log from ipython as I played with the pricing api | |
| #index.json from https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json | |
| # Per http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html#download-the-offer-index | |
| # But this may no longer be supported as it (EC2) is not part of the parent index of all services any longer | |
| import json | |
| with open('index.json', 'r') as foo: | |
| data = json.read(foo) | |
| with open('index.json', 'r') as foo: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 > meta-data | |
| instance-id: iid-local01 | |
| local-hostname: cloudimg | |
| EOF | |
| cat <<EOF > user-data | |
| #cloud-config | |
| ssh_import_id: [ yourlaunchpadid ] |
This file contains hidden or 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 to download all the books in a humble bundle. | |
| May work for other resources, but don't have anything to test against. | |
| To use, run from the directory you want to download the books in. | |
| Pass the "game" key as the first argument (look in the URL of your normal download page). | |
| To restrict to certain formats, pass them as extra positional arguments on the command line. | |
| Example: | |
| python humble_bundle_download abcdef12345 mobi pdf |
This file contains hidden or 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/sh | |
| cat > lifecycle.json <<EOF | |
| { | |
| "Rules": [ | |
| { | |
| "Expiration": { | |
| "Days": 7 | |
| }, | |
| "ID": "Expire, delete, and cancel", |