The C equivalent would be:
open("atomic.file", O_RDWR|O_CREAT|O_EXCL, 0644);PicoLisp:
: (make-csv "Testing,csv,\"parsing,a,csv\",test")
-> ("Testing" "csv" "\"parsing,a,csv\"" "test")
: (make-lst '("n" "g" "," "\"" "p" "a" "," "a" "," "c" "s" "v" "\"" "," "t") ",")
-> (("n" "g") (("\"" "p" "a" "," "a" "," "c" "s" "v" "\"")) ("t"))
: (make-quot '("n" "g" "," "\"" "p" "a" "," "a" "," "c" "s" "v" "\"" "," "t"))
Proxmox VE 6.x release includes a feature to add custom cloud-init configs. Unfortunately there is poor documentation, so I had to figure this out by adding pieces of information together.
The cloud-init files need to be stored in a snippet. This is not very well documented:
Storage View -> Storage -> Add -> Directorysnippets, and specify any path on your host such as /snippetsContent choose Snippets and de-select Disk image (optional)user-data, meta-data, network-config files to your proxmox server in /snippets/snippets/ (the directory should be there if you followed steps 1-3)| # load this code after loading http.l | |
| # ex: pil http.l headers-patch.l --server 8000 yourcode.l | |
| (patch _htHead | |
| '(T (if (eol) (char) (line T) @S)) | |
| (fill '(T (if (eol) (char) (when @ (push '*Headers (list @ (cdr (line)))))) | |
| . @S) ) ) |
| #!/usr/bin/env pil | |
| # 64-bit max | |
| # | |
| # functions to set/clear/toggle a specific bit in an 64-bit integer (8 bytes) | |
| [de lpad (Int) | |
| (pad 64 (bin Int) ] | |
| [de getbit (Int Pos) | |
| (& 1 (>> Pos Int) ] |
This obtains the twos complement of a signed integer (from signed -> unsigned), or reverse (from unsigned -> signed)
(de twos-complement (Int Size)
(if (lt0 Int)
(+ Int (>> (- Size) 1))
(if (=0 (& Int (>> (- (- Size 1)) 1)))
Int| #![no_std] | |
| #![no_main] | |
| use panic_halt as _; | |
| use embedded_graphics::fonts::{Font12x16, Text}; | |
| use embedded_graphics::pixelcolor::Rgb565; | |
| use embedded_graphics::prelude::*; | |
| use embedded_graphics::primitives::Rectangle; | |
| use embedded_graphics::{primitive_style, text_style}; |
| setxkbmap -option altwin:swap_alt_win |
| # To avoid running Claude or Codex in a way that could be considered "dangerous" | |
| # | |
| # Install Ubuntu Noble into a local dir | |
| sudo apt install -y debootstrap systemd-container | |
| sudo debootstrap --variant=minbase noble ~/ai-sandbox-rootfs http://archive.ubuntu.com/ubuntu | |
| # Enter your sandbox and bind-mount your code dir | |
| sudo systemd-nspawn \ | |
| -D ~/ai-sandbox-rootfs \ |