- Log in to AWS
- Go to a sensible region
- Start a new instance with Ubuntu Trusty (14.04) - compute-optimised instances have a high vCPU:memory ratio, and the lowest-cost CPU time.
c4.2xlargeis a decent choice. - Set security group (firewall) to have ports 22, 80, and 443 open (SSH, HTTP, HTTPS)
- If you want a static IP address (for long-running instances) then select Elastic IP for this VM
- If you want to use HTTPS, you'll probably need a paid certificate, or to use Amazon's Route 53 to get a non-Amazon domain (to avoid region blocking).
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
| #include <vector> | |
| void MakeGeometry() { | |
| TGeoManager *geom = new TGeoManager ("simple1", "Simple geometry"); | |
| //--- define some materials | |
| TGeoMaterial *matVacuum = new TGeoMaterial ("Vacuum", 0, 0, 0); | |
| TGeoMaterial *matAl = new TGeoMaterial ("Al", 26.98, 13, 2.7); | |
| //--- define some media | |
| TGeoMedium *Vacuum = new TGeoMedium ("Vacuum", 1, matVacuum); |
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
| import boto3 | |
| # For a Boto3 client. | |
| ddb = boto3.client('dynamodb', endpoint_url='http://localhost:8000') | |
| response = ddb.list_tables() | |
| print(response) | |
| # For a Boto3 service resource | |
| ddb = boto3.resource('dynamodb', endpoint_url='http://localhost:8000') | |
| print(list(ddb.tables.all())) |
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 MySQLdb | |
| f = open('hodo_channels_daq.csv', 'r') | |
| lines = f.readlines() | |
| lines = lines[1:] | |
| records = [] | |
| for l in lines: | |
| rec = l.strip().split(',') |
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
| import multiprocessing | |
| from multiprocessing import Pool | |
| def power(x): | |
| if x==0: | |
| exponent=.5 | |
| elif x==1: | |