Skip to content

Instantly share code, notes, and snippets.

View fwenzel's full-sized avatar
😈

Fred Wenzel fwenzel

😈
View GitHub Profile
@fwenzel
fwenzel / b2.md
Last active July 31, 2023 04:40
Mastodon --> Backblaze B2

Using Mastodon with Backblaze B2

Mastodon can store its assets in Amazon S3 (it speaks the S3 protocol). But it does not, by default, speak to Backblaze B2.

There are a couple of reasons why you might want that:

  • you already know and trust B2
  • it's cheaper
  • you do not want to make your instance dependent on AWS
  • etc.
#!/usr/bin/env python
import json
import re
from xml.etree import ElementTree as ET
NS = {'genc': 'http://api.nsgreg.nga.mil/schema/genc/2.0'}
ent = lambda name, ns: '{%s}%s' % (NS[ns], name)
tree = ET.parse('genc.xml')
@fwenzel
fwenzel / gist:8848aebe89e349367719
Created May 13, 2015 20:37
Comparison of Mozilla product details regions and ISO 3166.
--- existing.json 2015-05-13 12:59:19.000000000 -0700
+++ slim.json 2015-05-13 13:35:50.000000000 -0700
@@ -1,12 +1,11 @@
{
"ad": "Andorra",
- "ae": "U.A.E.",
+ "ae": "United Arab Emirates",
"af": "Afghanistan",
"ag": "Antigua and Barbuda",
"ai": "Anguilla",
@fwenzel
fwenzel / gist:5259ec6ec8b98d90cab1
Created May 13, 2015 20:01
Comparison of Mozilla product details regions and US GENC standard.
--- existing.json 2015-05-13 12:59:19.000000000 -0700
+++ genc.json 2015-05-13 12:54:02.000000000 -0700
@@ -1,12 +1,11 @@
{
"ad": "Andorra",
- "ae": "U.A.E.",
+ "ae": "United Arab Emirates",
"af": "Afghanistan",
"ag": "Antigua and Barbuda",
"ai": "Anguilla",
@fwenzel
fwenzel / irccloud-darkmatter.userstyle.css
Last active October 8, 2015 19:31
A dark user style for irccloud, based on "Dark Matter", tweaked for irccloud.mozilla.com
@-moz-document domain("irccloud.com"), domain("irccloud.mozilla.com") {
/* Dark Matter Reloaded
* Version 2.3 - 03/02/2015
*
* Author: @xupisco - xupisco.net */
/* Square corners, pls */
* {
border-radius: 0 !important;
border-top-right-radius: 0 !important;
@fwenzel
fwenzel / gist:4cc97d8976821e8d9e4b
Created November 4, 2014 20:08
pyobjc 2.4 install error
running install_lib
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/fred/.virtualenvs/upshot/build/pyobjc-core/setup.py", line 492, in <module>
zip_safe = False,
@fwenzel
fwenzel / rc4.js
Last active August 29, 2015 14:08 — forked from ttaubert/rc4.js
function*r(k){t=x=>(y=x%n)in s?s[y]:y;w=_=>t((s[i%n]=t(j+=f=t(i++)))+(s[j%n]=f));for(n=256,s=[i=j=0];i<n;)w(j+=k[i%k.length]);for(j=0,i=1;;)yield w()}
// A raw RC4 stream.
// Works in Firefox only (needs lots of ES6).
// 150 chars
// Usage:
for (var b of r([65,65,65])) {
console.log(b);
}
https://twitter.com/kathleenbot/status/483625820645519361/photo/1
"Easily the best NYT News Alert I've ever gotten"
Picture says: "Supreme Court Ruling in Contraception Case", then underneath:
"The Supreme Court has ruled on whether for-profit corporations may advance claims based on religious freedom."
Then highlighted: "Our reporters are reading the decision and will update this article as soon as they feel confident about its basic meaning."
@fwenzel
fwenzel / gist:36b655c8f87cf9a7715f
Last active August 29, 2015 14:01
Linode speedtest
130 fred@athena ~ % curl http://speedtest.newark.linode.com/100MB-newark.bin > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
85 100M 85 85.4M 0 0 2433k 0 0:00:42 0:00:35 0:00:07 2380k^C
130 fred@athena ~ % curl http://speedtest.atlanta.linode.com/100MB-atlanta.bin > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
61 100M 61 61.6M 0 0 2396k 0 0:00:42 0:00:26 0:00:16 2258k^C
130 fred@athena ~ % ping speedtest.newark.linode.com
PING speedtest.newark.linode.com (50.116.57.237): 56 data bytes
@fwenzel
fwenzel / cordovasample-demo.sh
Created March 11, 2014 19:33
Demo script for cordovasample
#!/bin/sh
## Script to build Cordova Sample app, as described in this blog post:
# https://hacks.mozilla.org/2014/02/building-cordova-apps-for-firefox-os/
# Note, this assumes you have Cordova installed.
# More info: http://cordova.apache.org/
rm -rf cordovasample