Skip to content

Instantly share code, notes, and snippets.

View tomwassenberg's full-sized avatar

Tom Wassenberg tomwassenberg

  • The Netherlands
View GitHub Profile

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

On Twitter the other day, I was lamenting the state of OCSP stapling support on Linux servers, and got asked by several people to write-up what I think the requirements are for OCSP stapling support.

  1. Support for keeping a long-lived (disk) cache of OCSP responses.

    This should be fairly simple. Any restarting of the service shouldn't blow away previous responses that were obtained. This doesn't need to be disk, just stable - and disk is an easy stable storage for most server

@lucaswerkmeister
lucaswerkmeister / weak-gpg-sigs
Last active February 23, 2017 17:33
Print weak signatures of your PGP keys (with GnuPG)
#!/bin/bash
# source: https://www.gnupg.org/documentation/manuals/gpgme/Hash-Algorithms.html
digests=(
nil
MD5
SHA1
RMD160
MD2
TIGER
@arianvp
arianvp / systemd.md
Created June 26, 2019 19:37
Systemd for github deployments

Using systemd + journald for GitHub deployments

At https://svsticky.nl/ we heavily make use of Systemd for all kinds of sysadmin tasks. We deploy the website from the https://github.com/svsticky/static-sticky repository, and people working on the website want to know why deployments failed if they do.

On https://github.com/svsticky/static-sticky/deployments you can find a list of deployments that were created for the website. If you click on the deployment, you can find the logs of the deployment. E.g. https://svsticky.nl/logs/acd2a99e348c40c58d6b13e4bd896a7c