⚠️ 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
# script to decompose/recompose llama model in different number of shards | |
# note that it loads the full model * 2 in cpu memory | |
import os | |
import json | |
import sys | |
import torch | |
import glob | |
if len(sys.argv) != 4: |
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
# default target so running 'make' by itself wll download and build nginx | |
build: nginx | |
cd nginx && ./configure --with-pcre=../pcre2 && make | |
nginx: pcre2 | |
curl -O https://nginx.org/download/nginx-1.21.6.tar.gz | |
tar -xzvf nginx-*.tar.gz | |
mv nginx-*/ nginx | |
rm nginx-*.tar.gz |
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
{ | |
"editor.bracketPairColorization.enabled": true, | |
"editor.cursorStyle": "block", | |
"editor.dragAndDrop": false, | |
"editor.hover.enabled": false, | |
"editor.linkedEditing": false, | |
"editor.minimap.enabled": true, | |
"editor.minimap.showSlider": "always", | |
"editor.minimap.size": "fill", | |
"editor.renderWhitespace": "selection", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Hello</title> | |
<link rel="stylesheet" href="main.css"> | |
</head> | |
<body> |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)