Skip to content

Instantly share code, notes, and snippets.

@oeon
oeon / landsat_notes.md
Last active April 27, 2017 05:21
notes from processing Harmony Landsat post

##This workflow is only for the pansharpened images

####red-green-blue
gdalbuildvrt -separate -q -srcnodata "0 0 0" -vrtnodata "0 0 0" rgb.vrt LC80430352013339LGN00_B4.tif LC80430352013339LGN00_B3.tif LC80430352013339LGN00_B2.tif

####NIR, SWIR, and visible red
gdalbuildvrt -separate -q -srcnodata "0 0 0" -vrtnodata "0 0 0" false.vrt LC80430352013339LGN00_B5.tif LC80430352013339LGN00_B6.tif LC80430352013339LGN00_B4.tif

####color infrared
gdalbuildvrt -separate -q -srcnodata "0 0 0" -vrtnodata "0 0 0" cir.vrt LC80430352013339LGN00_B5.tif LC80430352013339LGN00_B3.tif LC80430352013339LGN00_B4.tif

@jfroche
jfroche / create_serf_deb.sh
Created November 22, 2013 10:14
serf deb package
#!/bin/bash
mkdir serf
cd serf/
wget https://dl.bintray.com/mitchellh/serf/0.2.1_linux_amd64.zip
unzip 0.2.1_linux_amd64.zip
fpm -s dir -t deb -n "serf" -v 0.2.1 --prefix /usr/local/bin serf
@toastdriven
toastdriven / outofsorts.py
Created October 30, 2013 10:00
A bit of code kata for me. Brushing back up on some sorting algorithms... Requires ``pip install chrono`` to run.
Total time for 500 runs.
Bubble sort [average]: 0.00372815132141 seconds
Bubble sort [worst]: 0.00349998474121 seconds
Bubble sort [best]: 0.00349807739258 seconds
Bubble sort [huge]: 6.59933185577 seconds
Quick sort [average]: 0.00668597221375 seconds
Quick sort [worst]: 0.0066499710083 seconds
Quick sort [best]: 0.00685095787048 seconds
@dustin
dustin / make-go-compilers
Last active December 20, 2015 22:39
my x-compile script
#!/bin/sh
hg purge -v --all
./make.bash
for os in darwin freebsd linux netbsd openbsd plan9 windows
do
for arch in 386 amd64 arm
do
env GOOS=$os GOARCH=$arch ./make.bash --no-clean
@pbailis
pbailis / gist:5660980
Last active April 27, 2020 11:46
Assorted distributed database readings

Context: I was asked for a list of interesting reading relating to "distributed databases, behavior under partitions and failures, failure detection." Here's what I came up with in about an hour.

For textbooks, "Introduction to Reliable and Secure Distributed Programming" is a superb introduction to distributed computing from a formal perspective; it's really not about "programming" or "engineering" but about distributed system fundamentals like consensus, distributed registers, and broadcast. Used in Berkeley's Distributed Computing course (and HT to @lalithsuresh) Book Site

Notes from courses like Lorenzo Alvisi's Distributed Computing class can be great.

There are a bunch of classics on causality, [Paxos](ht

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 05:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@sway
sway / fontawesome.sty
Created July 12, 2012 23:14
FontAwesome mapping for XeLaTeX
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX
% Author: Honza Ustohal <honza@egoistic.biz>
%
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter
% This might be reworked into a full blown package in the near future
%
% Prerequisite:
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX
%
% Usage:
@adamfast
adamfast / requiredreading.txt
Created July 6, 2012 15:20
Preserved for #lawrence history, this was the "required reading" list of totally-non-work-related inside jokes of the World Online crew.
DJ Ango, yo!
http://railsenvy.com/2007/9/10/ruby-on-rails-vs-django-commercial-7
The Whistles
[now broken] http://www.youtube.com/watch?v=ccgXjA2BLEY
http://www.youtube.com/watch?gl=US&hl=en&client=mv-google&v=Nnzw_i4YmKk
Do it live!
http://www.youtube.com/watch?v=2tJjNVVwRCY
REMIX: http://www.youtube.com/watch?v=5j2YDq6FkVE&NR=1
@tshedor
tshedor / Ellington to Wordpress PHP Script
Created June 18, 2012 04:15
A very rough way to convert Ellington data into a Wordpress XML file. Tested with WP 3.4. Use at your own risk.
<?php
/* THIS IS ALPHA. PLEASE EXAMINE SCRIPT CAREFULLY TO REPLACE NECESSARY VARS WITH YOUR ORGANIZATION */
/*
The MIT License
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
-- Base64-encoding
-- Sourced from http://en.wikipedia.org/wiki/Base64
-- BSD licensed
require('math')
local index_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'