For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
| Backend publishes 2 APIs | |
| 1. Fetch Near-to-Infected list | |
| Near-to-Infected list entry consists of: | |
| - userIDs that have been near to an infected person | |
| - Time when the userID was near an infected person | |
| This can be a static text file that gets updated when E-2 happens. | |
| 2. Append Near-to-Infected list | |
| This is going to be called when a person was diagnosed as positive. | |
| See E. |
| ;;; package --- Fix permissions for Emacs.app on macOS Catalina | |
| ;;; Author: Artem Loenko | |
| ;;; Mail-To: <[email protected]> | |
| ;;; Commentary: | |
| ;;; Code: | |
| (defconst _default-emacs-app-plist-path "/Applications/Emacs.app/Contents/Info.plist") | |
| (defconst _temp-buffer-name "*fixing Emacs permissions*") | |
| (defconst _temp-buffer (get-buffer-create _temp-buffer-name)) | |
| (with-current-buffer _temp-buffer (erase-buffer)) |
| #!/bin/bash | |
| group_name='<log-group-name>' | |
| start_seconds_ago=3600 | |
| aws_cmd_opts= # e.g. "--profile <profile-name>" | |
| # Usage: get_loglines "<log-group-name>" <start-time> | |
| get_loglines() { | |
| aws $aws_cmd_opts --output text logs filter-log-events \ | |
| --log-group-name "$1" \ |
| """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward |
| """ | |
| Copies all keys from the source Redis host to the destination Redis host. | |
| Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are | |
| restricted (e.g. on Amazon ElastiCache). | |
| The script scans through the keyspace of the given database number and uses | |
| a pipeline of DUMP and RESTORE commands to migrate the keys. | |
| Requires Redis 2.8.0 or higher. |
| # Steps we will take: | |
| # 1. Change boot2docker image type (this will take long) | |
| # 2. Resize image | |
| # 3. Resize partion (using GParted) | |
| # | |
| # Also see: https://docs.docker.com/articles/b2d_volume_resize/ | |
| # Stop boot2docker | |
| boot2docker stop |
| package main | |
| import ( | |
| "fmt" | |
| "net/url" | |
| "reflect" | |
| "strconv" | |
| ) | |
| type Person struct { |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]
| // | |
| // WirelessBandManager.m | |
| // CmdScanner | |
| // | |
| // Created by Andras Kovi on 2013.04.05.. | |
| #import <Foundation/Foundation.h> | |
| #import <IOBluetooth/IOBluetooth.h> |