Skip to content

Instantly share code, notes, and snippets.

View rcoup's full-sized avatar

Robert Coup rcoup

View GitHub Profile
@rcoup
rcoup / rsync_parallel.sh
Created April 10, 2013 21:52
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
@rcoup
rcoup / .gitignore
Last active October 17, 2023 15:14
PROJ in a browser demo via Enscriptem+WASM
/proj
/proj-build
/sqlite
/sqlite-amalgamation-*.zip
/one-native
/one-native.dSYM
/one.data
/one.html
/one.js
/one.wasm
@rcoup
rcoup / cloc.sh
Created September 20, 2023 10:09
Simple bash script to run cloc across a big pile of repositories
#!/bin/bash
set -euo pipefail
# simple repo cloc report
# * ignores submodules
GIT_REMOTE="git@github.com:myorg"
REPOS=(
myfirstrepo
mysecondrepo
@rcoup
rcoup / .gammurc
Last active September 13, 2023 20:22
Gammu config and script for receiving SMS via a USB modem attached to an OSX computer and forwarding it into iMessage, where it will appear on all your devices.
[gammu]
port = /dev/tty.HUAWEIMobile-Modem
connection = at19200
model = at
synchronizetime = yes
logfile = /Users/me/.gammu/log
logformat = errorsdate
gammucoding = utf8
[smsd]
@rcoup
rcoup / test_vsi.py
Created August 16, 2023 09:25
GDAL VSI Python file wrappers and associated IO functions, and tests.
"""
Tests for VSI-File
Copyright Koordinates Limited
License MIT
"""
import io
import logging
import os
@rcoup
rcoup / elf-validate.sh
Created April 24, 2023 18:51
ELF binary validation script
#!/bin/bash
set -eu
command -v eu-elflint >/dev/null || (echo "eu-elflint not found, install elfutils"; exit 1)
command -v scanelf >/dev/null || (echo "scanelf not found, install pax-utils"; exit 1)
BINARIES=$(scanelf -EET_EXEC -RBF %F "${1-.}")
ERRS=0
for BINARY in $BINARIES; do
@rcoup
rcoup / blocksync.py
Last active January 17, 2023 03:25
Block device sync between remote hosts. Based off http://www.bouncybouncy.net/programs/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <justin@bouncybouncy.net>
Copyright 2011 Robert Coup <robert@coup.net.nz>
License: GPL
Getting started:
@rcoup
rcoup / conftest.py
Created June 27, 2019 15:02
Click CliRunner with PDB working better under pytest
import contextlib
import io
import warnings
import pytest
from click.testing import CliRunner
"""
In your tests:
@rcoup
rcoup / Dockerfile
Last active August 31, 2021 12:47
Docker container for SWIG. Helpful when you need a specific version to avoid massive diffs.
# Usage
#
# To build:
# $ docker build --build-arg SWIG_VERSION=3.0.10 -t swig .
#
# To run:
# host$ docker run --rm -it -v $(pwd):/src swig
# cont$ swig ...
#
# For SWIG 4.x use bullseye, for 3.x use buster
@rcoup
rcoup / index.html
Created August 23, 2021 10:34
GeoServer docs root index update. Fix broken header links.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GeoServer Documentation</title>
<link rel="stylesheet" href="_static/blueprint/screen.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="_static/blueprint/print.css" type="text/css" media="print" />
<!--[if IE]>