Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Max Ogden maxogden

  • Internet
View GitHub Profile
maxogden /
Created Mar 27, 2019
upload large file to zenodo from command line (curl)
# in zenodo ui create a deposition. get the id
curl -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" "$DEPOSITION"
# get the bucket id from above
curl --progress-bar -o /dev/null --upload-file ./$FILE$BUCKET/$FILE?access_token=$TOKEN
maxogden / list.txt
Created Sep 17, 2018
yay installed packages arch xps 9370
View list.txt
alsa-firmware 1.0.29-2
alsa-oss 1.1.6-1
alsa-utils 1.1.6-1
android-file-transfer 3.4-1
arch-backup 0.8.11-2
arch-install-scripts 19-1
asoundconf 1:1.2-1
autoconf 2.69-4
automake 1.15.1-1
bind-tools 9.13.2-1
maxogden /
Last active Jun 29, 2018
compile gdal with poppler from miniconda
source ~/.bashrc
conda config --add channels conda-forge
conda install poppler
export IFOLDER="/mnt/bigdisk/miniconda2/include"
export LFOLDER="/mnt/bigdisk/miniconda2/lib"
./configure --with-python --with-poppler=/mnt/bigdisk/miniconda2 --with-spatialite --with-pg --with-curl
maxogden / index.js
Created Jun 14, 2018
tar.gz browser storage import test
View index.js
// tar.gz browser storage import test
// test 1: 233mb zipped, 22 files, 10MB per file, jpg
// sw cache: 6s
// idb: did not finish (froze browser)
// test 2: 55mb zipped, 600 files, ~100kb per file, map tiles
// sw cache: 5s
// idb: 49s
maxogden / map.geojson
Last active May 14, 2018
Temple City Bicycle Routes GeoJSON (Hand Mapped From Table In Adopted Bicycle Master Plan 2011)
View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
maxogden / index.js
Created May 4, 2018
proxy multicast from one interface to another (node.js)
View index.js
// proxies from eth0 wlan0
var dgram = require('dgram')
var os = require('os')
var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true })
socket.bind(5004, function () {
socket.addMembership('', getIpForInterface('eth0'))
maxogden /
Last active May 5, 2018
capture rtsp and create movie (ffmpeg)
# enable multicast route so ffmpeg can resolve 2nd interface data
sudo route add -net dev eth0
# grab 1 frame of video as jpg
run-every 60 ffmpeg -i udp://@ -f image2 -frames:v 1 -strftime 1 "%F-%H-%M-%S.jpg"
# convert jpgs to movie
rm -rf cropped
mkdir cropped
mogrify -path cropped/ -extract 1400x990+0+0 *.jpg
maxogden / index.js
Last active May 21, 2018
youtube playlist downloader
View index.js
var path = require('path')
var fs = require('fs')
var ytdl = require('youtube-dl')
function playlist (url) {
var video = ytdl(url) // add , ['--audio-format=mp3'] for mp3 only
video.on('error', function error (err) {
console.log('error 2:', err)
maxogden / index.js
Created Feb 27, 2018
read NCBI Blast seqdb sequence database .nin file metadata
View index.js
// $ node read.js nt.00.nin
var fs = require('fs')
var int53 = require('int53')
f = process.argv[2]
function read (fd, start, end, cb) {
var len = end - start + 1
var buf = new Buffer(len), buf, 0, len, start, function (err) {
cb(err, buf)
maxogden / Containerfile
Last active May 4, 2018
CALeDNA container (build with npm i mkcontainer -g)
View Containerfile
FROM ubuntu:xenial
# set unlimited bash history
# nspawn needs resolv.conf to be set up for internet to work
# password gets changed so we can login later
RUN mkdir /usr/local/anacapa && \
cd /usr/local/anacapa && \
echo "export HISTFILESIZE=" >> .bashrc && \
echo "export HISTSIZE=" >> .bashrc && \
You can’t perform that action at this time.