Skip to content

Instantly share code, notes, and snippets.

View lukecampbell's full-sized avatar

Luke Campbell lukecampbell

View GitHub Profile
@lukecampbell
lukecampbell / ffmpeg-examples
Created April 13, 2017 14:57
ffmpeg example executions
# Converts .mov to high quality mp4 with lower bitrate
ffmpeg -i Untitled.mov -b:v 720k -bt 1200k -vcodec libx264 -an screen-cast.mp4

In decimal degrees, 5 decimal places is accurate to within +-1 meter, 6 decimal places accurate down to cm. This pull request has it set to 5 decimal places, I'd recommend setting precision to 5-6 decimal places, beyond that and it implies an accuracy that does not likely exist.

netcdf STCPBY1_2017-03-16 {
dimensions:
maxStrlen64 = 64 ;
time = 55 ;
variables:
float lat ;
lat:units = "degrees_north" ;
lat:standard_name = "latitude" ;
lat:long_name = "station latitude" ;
lat:axis = "Y" ;
@lukecampbell
lukecampbell / convert.py
Created February 7, 2017 20:36
Convert valid_min/valid_max strings to numeric data types
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
convert.py
Copyright 2016 RPS
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
#!/usr/bin/env python
#-*- coding: utf-8 -*-
'''
cbibs.adaptors
~~~~~~~~~~~~~~~~~
This module provides the interface between jobs (and the job context). Each job
uses one or more adaptors to perform calculations or generate netcdf files.
..
@lukecampbell
lukecampbell / Dockerfile
Created February 2, 2017 15:47
Docker container demonstrating lxml bug
FROM phusion/baseimage:0.9.18
MAINTAINER Luke Campbell <[email protected]>
# General dependencies:
RUN apt-get update && \
apt-get install -y wget git build-essential libxml2 libicu52
# Install nodejs/npm and friends:
RUN (curl -sL https://deb.nodesource.com/setup_6.x | bash) && \
#!/bin/sh
BOOT2DOCKER_CERTS_DIR=/var/lib/boot2docker/certs
CERTS_DIR=/etc/ssl/certs
CAFILE=${CERTS_DIR}/ca-certificates.crt
for cert in $(/bin/ls -1 ${BOOT2DOCKER_CERTS_DIR}); do
SRC_CERT_FILE=${BOOT2DOCKER_CERTS_DIR}/${cert}
CERT_FILE=${CERTS_DIR}/${cert}
HASH_FILE=${CERTS_DIR}/$(/usr/local/bin/openssl x509 -noout -hash -in ${SRC_CERT_FILE} 2>/dev/null)
@lukecampbell
lukecampbell / create_ca.sh
Last active May 2, 2022 09:15
Generic script to create openssl based Certificate Authority
#!/bin/bash
set -e
echo "Creating new OpenSSL Certificate Authority"
echo -n "Enter path to CA [.]: "
read ca_path
ca_path=${ca_path:-$PWD}
if [[ "$ca_path" != /* ]]; then
ca_path="$PWD/$ca_path"
netcdf IOOS_Glider_NetCDF_v3.0-qartod {
dimensions:
time = UNLIMITED ; // (0 currently)
traj_strlen = 20 ;
variables:
char trajectory(traj_strlen) ;
trajectory:cf_role = "trajectory_id" ;
trajectory:comment = "A trajectory is a single deployment of a glider and may span multiple data files." ;
trajectory:long_name = "Trajectory/Deployment Name" ;
double time(time) ;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.