Skip to content

Instantly share code, notes, and snippets.

@lostbean
lostbean / attic.Dockerfile
Created January 29, 2024 12:56
Attic - nix cache with docker
FROM ghcr.io/zhaofengli/attic:latest
COPY ./attic.toml /attic/server.toml
RUN mkdir -p /cache
RUN mkdir -p /data
EXPOSE 8080
CMD ["-f", "/attic/server.toml", "--mode", "monolithic"]
@lostbean
lostbean / nginx.conf
Last active March 6, 2024 13:01
Local reverse proxy to test local server UI (yarn start) with Kloud instance
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format proxy_log
'[$time_local] $remote_addr - $remote_user "$host$request_uri" '
@lostbean
lostbean / Main.hs
Last active July 25, 2020 18:50
Vector parallelization
module Main where
import GHC.Conc (numCapabilities)
import Control.Parallel.Strategies
import qualified Data.Vector as V
import qualified Data.Vector.Generic as G
autoParVector :: (G.Vector v a, NFData (v a), NFData a) => Strategy (v a)
autoParVector = autoChunkStrategy id