Skip to content

Instantly share code, notes, and snippets.

View SamWhited's full-sized avatar

Sam Whited SamWhited

View GitHub Profile
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 / ejabberd.yml
Last active November 17, 2022 12:44
Example ejabberd config
### =======
### LOGGING
##
## loglevel: Verbosity of log files generated by ejabberd.
## 0: No ejabberd log at all (not recommended)
## 1: Critical
## 2: Error
## 3: Warning
## 4: Info
@SamWhited
SamWhited / rawextract.py
Last active March 28, 2023 07:49
Extract metadata from Canon CR2 and Nikon NEF raw files
#!/usr/bin/env python
import sys
import os
from rawphoto.cr2 import Cr2
from rawphoto.nef import Nef
def print_entries(raw, ifd, level=1):
for name in ifd.entries:
@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:

@SamWhited
SamWhited / .block
Last active April 25, 2016 19:54
Go bcrypt benchmarks
license: gpl-3.0
@SamWhited
SamWhited / .gitignore
Last active August 31, 2016 15:22
Jitsi Meet mod_token_auth ASAP test server
testtoken
main
*.sw[op]
@SamWhited
SamWhited / fake_enums.md
Last active December 21, 2020 12:21
Experience report about attempting to ensure compile time correctness of values using the type system

Faking Enumeration Types with Consts and Unexported Types

What I Wanted to Do

While working on an implementation of the wire protocol from a network standard, I needed to implement an error response. These errors may come in one of several flavors which is encoded and sent along with the error:

  • Cancel