start new:
tmux
start new with session name:
tmux new -s myname
| #!/usr/bin/env python -O | |
| import argparse | |
| import sys | |
| import numpy | |
| import h5py | |
| import csv | |
| class ColType: | |
| UNKNOWN = 1 |
| -- Run script that dumps DB data into csv over S3 | |
| -- Run EMR script to while will process the data - maybe executed as cron from our ec2? | |
| -- Saves processed data in CSV over s3 | |
| -- Scripts runs and puts the data from CSV into PGSQL DB. | |
| -- Remove old CSV, new CSV and close the EMR instance. |
| ''' | |
| PIL's Image.thumbnail() returns an image that fits inside of a given size (preserving aspect ratios) | |
| but the size of the actual image will vary and is certainly not guaranteed to be the requested size. | |
| This is often inconvenient since the size of the returned thumbnail cannot be predicted. The django-thumbs | |
| library solves this for square thumbnails by cropping the image to a square and then resizing it. However, | |
| this only works for exact squares. | |
| This function generalizes that approach to work for thumbnails of any aspect ratio. The returned thumbnail | |
| is always exactly the requested size, and edges (left/right or top/bottom) are cropped off to adjust to | |
| make sure the thumbnail will be the right size without distorting the image. |