Skip to content

Instantly share code, notes, and snippets.

View SamWhited's full-sized avatar

Sam Whited SamWhited

View GitHub Profile
@SamWhited
SamWhited / README.md
Last active August 29, 2015 13:58
A simple server that accepts HTTP post requests

This is a simple server example that accepts geojson features as POST requests (fair warning, it does no validation to make sure anything is geojson conformant) and spits out a geojson file with all the features wrapped in a feature array.

This is just an example. It does lots of bad things (like reading / writing the entire file every time it gets a post request) and is easily abused. The authentication isn't exactly secure either. By default it listens on :2230.

@SamWhited
SamWhited / spec.md
Last active August 29, 2015 14:05
API spec for a simple, universal commenting system

Simple comments API 1.0.0-draft01

Copyright

This work is licensed under a [Creative Commons Attribution 4.0 International License][ccby].

Introduction

@SamWhited
SamWhited / lincolnletter.tex
Created October 14, 2014 14:14
Open letter to the city council of Lincoln
\documentclass{letter}
\signature{Sam Whited}
\address{Atlanta, GA}
\begin{document}
\begin{letter}{Lincoln Town Office \\ PO Box 25 \\ Lincoln, NH 03251}
\opening{To whom it may concern:}
@SamWhited
SamWhited / rendermontage.sh
Created October 20, 2014 18:40
Script to render a montage of many images with an overlay
#!/bin/sh
#
# Requires: ImageMagick
# Usage:
# rendermontage.sh thumbsize overlayimage outputimage
#
montage -geometry $1x$1>+0+0 *.{jpeg,jpg,png} $3
composite -gravity center -background none $2 $3 $3
@SamWhited
SamWhited / gist:aaf1ff4353de9f06a502
Created December 18, 2014 18:37
Test ejabberd SSL ciphers with openssl
#!/bin/bash
CIPHERS=`grep ^s2s_ciphers /etc/ejabberd/ejabberd.yml | cut -d\" -f2 | sed 's,:,\n,g'`
for CIPHER in $CIPHERS; do
echo "Testing: ${CIPHER}..."
openssl s_client -connect samwhited.com:5269 -starttls xmpp -cipher ${CIPHER} || echo "Fail"
done
source env/bin/activate; python -m photoshell
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2158, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
@SamWhited
SamWhited / ciphers.md
Created February 2, 2015 13:43
Ciphers supported in Android (Conversations prefered order first, then system ciphers)

Android 4.4:

02-02 08:40:53.293    2514-2530/eu.siacs.conversations D/conversations﹕ Using
ciphers: [TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA,
SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA,
TLS_ECDH_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA,
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
@SamWhited
SamWhited / thinklight.go
Created May 30, 2015 22:38
Turn on or off the ThinkLight (or keyboard backlight) on various ThinkPad laptops
package main
import (
"flag"
"log"
"os"
)
func btoi(n bool) byte {
if n {
@SamWhited
SamWhited / Makefile
Last active August 29, 2015 14:22
Print all cameras supported by the currently linked version of libraw
.PHONY: build
all: cameras
cameras: cameras.c
gcc -I/usr/include/libraw $< -o $@ -lraw
@SamWhited
SamWhited / keybase.md
Created June 28, 2015 02:52
Keybase verification

Keybase proof

I hereby claim:

  • I am SamWhited on github.
  • I am samwhited (https://keybase.io/samwhited) on keybase.
  • I have a public key whose fingerprint is 9761 51DE E472 01CE 4A85 9F70 5408 3AE1 04EA 7AD3

To claim this, I am signing this object: