- Run
yarn build
ornpm run build
on your local machine.scp
it over to the EC2 box (you can compress it into abuild.zip
file and thenunzip
once it's copied). - Install
docker
anddocker-compose
on the EC2 box following these instructions. - Create sym link for docker-compose:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- Install
git
on the EC2 if you haven't already. Then clone this repo onto the box.cd
into the repo. - Following the
README
from the above repo, update all necessary configurations (email address, server names). - Run
sudo "PATH=$PATH" sh init-letsencrypt.sh
. - The generated certs should be at
./data/certbox/live/sub.mysite.com/fullchain.pem
and./data/certbox/live/sub.mysite.com/privkey.pem
. Look at thevolumes
section in thedocker-compose.yml
in case the configuration is different. - Now, you
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import os | |
def log_with_time(msg: str): | |
print("Time: {} - {}".format(time.strftime("%H:%M:%S"), msg)) | |
def main(): | |
iters = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this script was used to convert instrumentation data from IMSLP | |
# to a collection of objects, decoupling instrument count and misc. | |
# notes from the long string blob | |
import os | |
import json | |
import re | |
files = os.listdir(".") | |
jsons = filter(lambda x: x.endswith(".json"), files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _solver_try(y, face_val, num_periods, coupon_payment): | |
result = 0 | |
for t in range(1, num_periods + 1): | |
result += coupon_payment / (1 + y) ** t | |
if t == num_periods: | |
result += face_val / (1 + y) ** t | |
return result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set background=dark | |
:set t_Co=256 | |
" :set number | |
:set relativenumber | |
:set rnu | |
" default tab settings | |
:set expandtab | |
:set shiftwidth=4 | |
:set tabstop=4 |
To run our Ring app in production with a valid signed certificate, we need to do a few things.
- Generate the signed certificate/chain and private key by following steps 1-3 on Certbot here. The two files generated will be at
/etc/letsencrypt/live/mydomain.com/fullchain.pem
/etc/letsencrypt/live/mydomain.com/privkey.pem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { compress, decompress } from './compress' | |
test('basic-compress', () => { | |
const input = [100, 0, 0, 0, 43, 4, 43, 43] | |
expect(compress(input)).toBe('100,0:3,43,4,43:2') | |
}) | |
test('long-compress', () => { | |
const longInput = [ | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exercise page can be found at | |
// https://tour.golang.org/concurrency/8 | |
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;----------------------------------------------------------------- | |
;; SEQUENCES | |
;; https://aphyr.com/posts/304-clojure-from-the-ground-up-sequences | |
;;----------------------------------------------------------------- | |
;; [] vector | |
;; #{} hashset? | |
; Problems |
NewerOlder