⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
This file contains hidden or 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 has to be parametrized by the compiler version, the project path and the Cabal version | |
# that is being used. Also the relevant packages to the project will change. In this case I | |
# just created an empty dummy project to generate the instructions. | |
# Find ghci script | |
> stack exec -- which ghci | |
/usr/local/bin/ghci | |
# Find ghc script |
This file contains hidden or 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
# Parameters: | |
prob_nodefail = 0.001 # Probability of a single node failing | |
replication_factor = 3 # Number of copies of each partition (r) | |
partitions_per_node = 256 # Number of partitions per node | |
max_nodes = 10000 # Maximum number of nodes to consider | |
# (n - r)! / n! == r! / (n choose r) | |
# Intuitively: the fraction of the n! possible permutations of n nodes that | |
# results in the replicas of one particular partition to be mapped to three | |
# particular nodes, in a particular order. |
This file contains hidden or 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
#/bin/bash | |
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
if [ -z "$REPO_URL" ]; then | |
echo "-- ERROR: Could not identify Repo url." | |
echo " It is possible this repo is already using SSH instead of HTTPS." | |
exit | |
fi |