start new:
tmux
start new with session name:
tmux new -s myname
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import os | |
| class FileSampler: | |
| def __init__(self): | |
| self.parse_args(sys.argv) |
| /* | |
| Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
| May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
| */ | |
| SET NAMES utf8; | |
| SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
| DROP TABLE IF EXISTS postcodes_geo; |
| # Pylab BOXPLOTS in 538 style | |
| import matplotlib.pyplot as plt | |
| import itertools | |
| def box_plot(boxes, figsize=(5,4), ymax=None, title=None, xlabels=[]): | |
| def setBoxColors(bp): | |
| colours = ["#30a2da","#6d904f","#8b8b8b","#fc4f30","#e5ae38"] | |
| n_boxes = len(bp['boxes']) | |
| fte = list(itertools.islice(itertools.cycle(colours), n_boxes)) |
| ############################# | |
| # | |
| # Appends the camera model, | |
| # extracted from the EXIF data | |
| # to the file name. | |
| # | |
| # RAW file support comes via | |
| # a Perl command-line tool | |
| # called `exiftool` | |
| # |
| import os | |
| import sys | |
| import re | |
| import boto3 | |
| import zipfile | |
| def parse_s3_uri(url): | |
| match = re.search('^s3://([^/]+)/(.+)', url) | |
| if match: | |
| return match.group(1), match.group(2) |