Skip to content

Instantly share code, notes, and snippets.

@cnlpete
cnlpete / runInBackground.py
Created November 1, 2022 16:05
run in the background, download and generate cloud images and call xplanet every so often
import time
import sched
import subprocess
import os
import json
import requests
from PIL import Image
# The ID of the satellite product to use, if you want realistic clouds you
'''
A Script for automatically downloding earth based image tiles and stitching
them into a single image file. Designed for downloading and stitching together
a cloud map file for use with xplanet. But it could be used for other things.
Images are obtained from the Space Science and Engineering Center (SSEC)
at the University of Wisconsin-Madison through their RealEarth project.
RealEarth is a data discovery and visualization platform developed at
SSEC/CIMSS at the University of Wisconsin-Madison to support outreach
and collaboration efforts of scientists.
@cnlpete
cnlpete / sh2ju.sh
Created October 19, 2021 11:58 — forked from eschmidscs/sh2ju.sh
junit bash commands
#!/bin/bash
### Copyright 2010 Manuel Carrasco Moñino. (manolo at apache.org)
### Copyright 2016 Patrick Double (pat at patdouble.com)
###
### Licensed under the Apache License, Version 2.0.
### You may obtain a copy of it at
### http://www.apache.org/licenses/LICENSE-2.0
###
### A library for shell scripts which creates reports in jUnit format.
@cnlpete
cnlpete / multiple-git-hooks.sh
Created April 27, 2020 14:16 — forked from mjackson/multiple-git-hooks.sh
Run multiple scripts for the same git hook
#!/bin/sh
# This script should be saved in a git repo as a hook file, e.g. .git/hooks/pre-receive.
# It looks for scripts in the .git/hooks/pre-receive.d directory and executes them in order,
# passing along stdin. If any script exits with a non-zero status, this script exits.
script_dir=$(dirname $0)
hook_name=$(basename $0)
hook_dir="$script_dir/$hook_name.d"
# If there is no version tag in git this one will be used
VERSION = 0.1.0
# Need to discard STDERR so get path to NULL device
win32 {
NULL_DEVICE = NUL # Windows doesn't have /dev/null but has NUL
} else {
NULL_DEVICE = /dev/null
}
@cnlpete
cnlpete / githook-astyle.sh
Created November 27, 2015 14:15 — forked from kblomqvist/githook-astyle.sh
Git pre-commit hook to check C/C++ source file format using astyle (Artistic Style)
#!/bin/bash
# Installation:
# cd my_gitproject
# wget -O pre-commit.sh http://tinyurl.com/mkovs45
# ln -s ../../pre-commit.sh .git/hooks/pre-commit
# chmod +x pre-commit.sh
OPTIONS="-A8 -t8 --lineend=linux"
RETURN=0
#!/bin/sh
# Bail on errors!
set -e
set -u
# Change to a temporary directory:
cd /tmp
# Version of Syncthing we'll install:
@cnlpete
cnlpete / gatherimages.sh
Created August 12, 2014 19:33
metapixel-helper to gather images and sort them via metapixel-sizesort and afterwards use prepare them via metapixel-prepare with appropriate aspect ratios
#!/bin/zsh
convert=/usr/bin/convert
metapixelsizesort=/usr/bin/metapixel-sizesort
dir=$1
targetdir=$2
root=`pwd`
@cnlpete
cnlpete / gist:11180100
Created April 22, 2014 13:53
keybase.md
### Keybase proof
I hereby claim:
* I am cnlpete on github.
* I am cnlpete (https://keybase.io/cnlpete) on keybase.
* I have a public key whose fingerprint is B465 0389 31FB F96A 01FE 905E C9A1 FE6F 665A EEE3
To claim this, I am signing this object:
@cnlpete
cnlpete / crontab
Created May 27, 2011 12:25
/etc/init.d/minecraft script to handle minecraft auto-start and backups...
5 */6 * * * /etc/init.d/minecraft backup #backup four times a day, meaning every 6 hours
15 */2 * * * /etc/init.d/minecraft map #generate map every two hours
10 1 * * * /etc/init.d/minecraft clean #clean old files daily