Skip to content

Instantly share code, notes, and snippets.

@glw
glw / port_forward
Created June 5, 2018 21:14
tensorboard from cloud to your local machine
source: https://stackoverflow.com/questions/37987839/how-can-i-run-tensorboard-on-a-remote-server#40413202
ssh -L 16006:127.0.0.1:6006 user@my_server_ip
$ tensorboard --logdir=/path/
* open browser on local machine. >> localhost:16006
@glw
glw / NDVI-calc.sh
Last active October 11, 2023 21:42
NDVI calculation
# gets read from a database, hardwired here
NDVI_COLORMAP="006600 008800 00BB00 00FF00 CCFF00 FFFF00 FFCC00 FF8800 FF0000 EE0000 DD0000 CC0000 BB0000 AA0000 990000 880000 770000"
NIR_INPUT=nir_input.tif
NIR_OUTPUT=nir_output.tif
RED_INPUT=red_input.tif
RED_OUTPUT=red_output.tif
NDVI_IMAGE=new_ndvi.tif
@glw
glw / covariance-matrix-notes.md
Created April 23, 2018 16:16
covariance matrix
@glw
glw / tiff_2_jpg_convert.py
Last active April 20, 2018 21:20
convert tiff to jpg and transfer exif tags
import argparse
import pyexiv2
import cv2
import os.path
import numpy as np
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--input", required=True, help="input image name.")
args = vars(ap.parse_args())
@glw
glw / search_for_altitude.sh
Created April 13, 2018 16:40
search for altitude in image exif tags output to csv
echo "name, altitude" > output.csv
for tif in ./path/to/images/0003/*.TIF; do
name=$(exiftool $tif | grep 'Original Raw File Name')
alt=$(exiftool $tif | grep 'GPS Altitude :')
echo "$name, $alt" >> output.csv
done
@glw
glw / pyexiv2_install.md
Last active March 15, 2018 18:52
install pyexiv2 in python virtualenv

Installing pyexiv2 into a virtualenv

exiv2 is already installed via apt-get

download deb package

sudo aptitude download python-pyexiv2 #has libboost-python1.58.0 dependency

my best guess is that this has to be installed on the OS

@glw
glw / advanced_rasterio_features.ipynb
Created December 17, 2017 00:21 — forked from sgillies/advanced_rasterio_features.ipynb
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@glw
glw / todoList.js
Last active November 13, 2017 05:14
todoList
var todoList = {
todos: [],
addTodo: function(todoText) {
this.todos.push({
todoText: todoText,
completed: false
});
},
changeTodo: function(position, todoText) {
this.todos[position].todoText = todoText;
@glw
glw / tar.md
Last active April 1, 2019 19:55
tar/untar a directory (becuase i always forget how)

tar/compress

tar -zcvf archive.tar.gz directory/

untar/decompress

tar -xvzf archive.tar.gz directory/