- Put
ci.yaml
into.github/workflows/
- Follow https://github.com/cachix/cachix-action#usage to setup Cachix and benefit from quick CI build times.
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
from transformers import AutoTokenizer, T5ForConditionalGeneration | |
# Model Init | |
n_gpu = 8 | |
tokenizer = AutoTokenizer.from_pretrained("google/flan-ul2") | |
model = T5ForConditionalGeneration.from_pretrained("google/flan-ul2") | |
heads_per_gpu = len(model.encoder.block) // n_gpu | |
device_map = { | |
gpu: list( | |
range( |
Next.js, Nginx with Reverse proxy, SSL certificate
- UPDATE (07/20/2021):
- This process got simplified over the years of this gist being out
- Older version of this gist (without certbot): https://gist.github.com/kocisov/2a9567eb51b83dfef48efce02ef3ab06/33fdd88872a0801bdde58fccce430fa48737ae10
- I would also now recommend deploying to Vercel if you don't need custom server support
Postgres lacks convenient operators for modifying JSON or JSONB values. A common operation one might want to do is to change one property in a JSON column across multiple rows, like:
UPDATE example SET json_col = json_col || '{ "prop": true }'::jsonb WHERE <conditions>;
The ||
operator is the natural choice for this because it is also used for array and jstore concatenation in Postgres.
This short PLV8 function adds the JSON concatenation operator. It is significantly more powerful than the array and hstore counterparts, and are capable of:
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
[Unit] | |
Description=Loggly Forwarder | |
[Service] | |
ExecStart=/bin/sh -c "journalctl -o short -f | awk '{ print \"\<34\>1\", $0; fflush(); }' | awk '{ print $0, \"[your-consumer-token-from-loggly@41058 tag='deis']\" }' | ncat --ssl logs-01.loggly.com 6514" | |
[Install] | |
WantedBy=multi-user.target | |
[X-Fleet] |
Various blog posts related to Nix and NixOS
- https://nixos.org/wiki/Main_Page Nix wiki. Awesome resource containing huge amount of manuals and documentation with examples.
- http://aflatter.de/nixos/ Alexander Flatter - NixOS. Installing NixOS inside a VirtualBox with a real-world
configuration.nix
example. - http://lethalman.blogspot.it/search/label/nixpills Luca Bruno - Nix Pills. Series of posts describing how to install nix into some environment and how to use it.
- http://looprecur.com/blog/from-ubuntu-to-nixos/ Tim Sears - From Ubuntu to NixOS. Talk about experience migrating from Ubuntu to NixOS.
This gist contains the nginx and tor configurations for the [mike.tig.as][mta] servers, mainly to show:
- Use of the
chris-lea/nginx-devel
PPA to allow use of SPDY. ssl_ciphers
selection to mitigate BEAST attack, enable [perfect forward secrecy][pfs] if possible and select the strongest possible ciphers within those bounds. (Exception is made for several ciphers at the end of list, for compatibility reasons.)
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
> module Paxos.Basic where | |
> import Data.List (maximumBy) | |
> import Data.Maybe (catMaybes) | |
Phase 1a: Prepare | |
================= | |
A Proposer (the leader) creates a proposal identified with a number N. This | |
number must be greater than any previous proposal number used by this Proposer. | |
Then, it sends a Prepare message containing this proposal to a Quorum o |
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
{------------------------------------------------------------------------------ | |
reactive-banana | |
Implementation of an "industry strength" game loop with fixed time step | |
and variable fps. | |
See also http://gafferongames.com/game-physics/fix-your-timestep/ | |
-------------------------------------------------------------------------------} | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
module Main where |
NewerOlder