Skip to content

Instantly share code, notes, and snippets.

@yoshiso
yoshiso / app.py
Last active April 18, 2022 22:34
numerai leaderboard streamlit app
"""
Visualization app data from https://www.jofaichow.co.uk/numerati/data.html
# Usage:
Download data from the website and give it to app
$ streamlit app.py $CSV_FILE_PATH $BENCHMARK_MODEL_NAMES
# Example:
$ streamlit app.py \
//...
Map<dynamic, dynamic> deviceInfo = {};
if (defaultTargetPlatform == TargetPlatform.android) {
deviceInfo = await DeviceInfoPlugin.channel.invokeMethod('getAndroidDeviceInfo');
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
deviceInfo = await DeviceInfoPlugin.channel.invokeMethod('getIosDeviceInfo');
}
extra['device_info'] = deviceInfo.map((key, value) => MapEntry(key.toString(), value.toString()));
//...

In order to be issued a certificate, Let's Encrypt needs to verify you have control over the domain. This process is automated through challenges, such as setting up a local webserver, or adding DNS TXT records. I don't like the DNS-TXT challenge, as it requires giving every host a DNS service account.

I came up with my own solution. The .well-known/acme-challenge can be hosted using S3, allowing Let's Encrypt to perform an HTTP-01 challenge.

This method requires the least amount of privileges on the host (no ports need to be open)

Why do internal hosts need valid certs?

The primary reason I want internal hosts to have valid certs is quite simple - invalid/untrusted certificates break things! A secondary reason is that constant browser warning are annoying and false alarms are detrimental to security.

@slightfoot
slightfoot / error_capture.dart
Last active April 26, 2021 12:03
Crash Reporting / Error Capture for Flutter
///
/// Flutter Captured Error Reporting
/// Created by Simon Lightfoot
///
/// Copyright (C) DevAngels Limited 2018
/// License: APACHE 2.0 - https://www.apache.org/licenses/LICENSE-2.0
///
import 'dart:async';
import 'dart:io';
import 'dart:ui' as ui show window;
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active June 18, 2024 15:27
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

@mgoodness
mgoodness / k8s-svc-annotations.md
Last active March 11, 2024 16:24
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@dersmon
dersmon / prediction.py
Created November 12, 2015 10:23
Using trained caffe model in python script, added value scaling and mean.
import sys
import caffe
import cv2
import Image
import numpy as np
from scipy.misc import imresize
caffe_root = "/home/simon/Workspaces/caffe/"
#MODEL_FILE = caffe_root + 'models/placesCNN/places205CNN_deploy.prototxt'