Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Bail on errors!
set -e
set -u
# Change to a temporary directory:
cd /tmp
# Version of Syncthing we'll install:
@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
# 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 / 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"
@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.
'''
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.