Skip to content

Instantly share code, notes, and snippets.

View godber's full-sized avatar
😺

Austin Godber godber

😺
View GitHub Profile
@godber
godber / planetaryimage_example_1
Last active August 29, 2015 14:22
Using PlanetaryImage
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Testing out PlanetaryImage"
]
},
{
@godber
godber / Test_All.ipynb
Created June 14, 2015 00:40
Test Lots of Planetary Data Types
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@godber
godber / mission_data.json
Last active August 29, 2015 14:23
JSON data file with names of planetary data.
{
"0044ML0205000000E1_DXXX.img": {
"url": "http://"
},
"0778ML0033700000400205E01_XXXX.LBL": {
"url": "http://",
"datafile": "0778ML0033700000400205E01_XXXX.LBL",
"skip": "True"
},
"0778ML0033700000400205I01_XXXX.LBL": {
import os
from glob import glob
def file_dir_glob_list(inlist=None):
"""Given a list of files, directories or globs, returns a fully expanded
list of files
"""
file_list = []
if inlist:
@godber
godber / dtype_ex1.py
Last active August 29, 2015 14:26
Creating an ndarray with a given dtype.
import numpy as np
dt = np.dtype([
('time', [('min', int), ('sec', int)]),
('temp', float)
])
# create array with dtype
x = np.zeros((5,5), dtype=dt)
#!/usr/bin/env bash
# rebundle.sh - Rebundles, uploads and registers an AMI.
# For blogpost:
# http://blog.crunch.io/user-managed-kernel-amis-from-existing-ubuntu
# Austin Godber <godber@crunch.io>
if [ `id -u` != '0' -o "$AWS_USER_ID" == "" ]; then
echo "ERROR: You must run this with 'sudo -E' or as the root user"
exit 1
ec2-run-instances ami-2d4aa444 \
--instance-type m1.small \
--region us-east-1 \
--key ${EC2_KEYPAIR_US_EAST_1}
#!/usr/bin/env bash
# prep.sh - Prepares an Ubuntu AMI for Rebundling
# For blogpost:
# http://blog.crunch.io/user-managed-kernel-amis-from-existing-ubuntu
# Austin Godber <godber@crunch.io>
if [ `id -u` != '0' ]; then
echo "ERROR: You must run this with 'sudo -E' or as the root user"
exit 1
default 0
timeout 3
hiddenmenu
title Ubuntu EC2 Kernel
root (hd0)
kernel /boot/vmlinuz-2.6.32-305-ec2 root=/dev/sda1 ro
initrd /boot/initrd.img-2.6.32-305-ec2
cd /tmp
wget -q http://gist.github.com/raw/481553/04b30b8a4ea2c9cb5b757844f48ba7fa02f03de8/prep.sh
sudo -E bash prep.sh
# scp your keys to the AMI as instructed by prep.sh
vi /mnt/tmp/environment # set you AWS credentials and paths
. /mnt/tmp/environment
sudo wget -q -O /boot/grub/menu.lst http://gist.github.com/raw/481560/6e70d54e1dc6ea43130916ed054cf56cd33cb97f/menu.lst
cd /mnt/tmp/
wget -q http://gist.github.com/raw/481551/af5a315b59f9b7e4874880491d0cc6dc5f3c7b9c/rebundle.sh
vi rebundle.sh # set your bucket