Skip to content

Instantly share code, notes, and snippets.

View akhenakh's full-sized avatar
🏠
Working from home

Fabrice Aneche akhenakh

🏠
Working from home
View GitHub Profile
@akhenakh
akhenakh / nodes.png
Last active March 26, 2024 01:49
Resolve VR180 nodes
nodes.png
@akhenakh
akhenakh / config.toml
Created January 2, 2024 03:21
Helix Config
theme = "solarized_dark"
[editor]
true-color = true
bufferline = "multiple"
cursorline = true
color-modes = true
[editor.cursor-shape]
insert = "bar"
@akhenakh
akhenakh / notes.md
Last active October 30, 2023 16:24
Quick setup to experiment with Envoy Gateway on a Mac

Note to quickly deploy Envoy Gateway for experiment on a Mac using Colima (or a Linux)

Mac Requirement (M1/M2)

# clean up colima install BEWARE!! older version of colima sometimes are failing
rm -rf ~/.colima ~/.lima

# start colima with kubernetes option and disable Traefik
colima start --kubernetes --kubernetes-disable=traefik  --arch aarch64 --vm-type=vz --vz-rosetta --cpu 2 --memory 4
@akhenakh
akhenakh / llama.sh
Last active November 30, 2023 22:16
Use a llama model on your mac
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make -j
pip3 install huggingface-hub
huggingface-cli download TheBloke/zephyr-7B-alpha-GGUF zephyr-7b-alpha.Q5_K_M.gguf --local-dir ./models --local-dir-use-symlinks False
export MODEL=./models/zephyr-7b-alpha.Q5_K_M.gguf
./examples/server-llama2-13B.sh
# go to http://localhost:8080
@akhenakh
akhenakh / load_spatialite.sql
Created September 15, 2023 14:51
Jetbrains SQLite and SpatiaLite
-- Save this file somewhere with the path of your extension (on Silicon Mac: /opt/homebrew/lib/mod_spatialite.dylib)
select load_extension("/opt/homebrew/lib/mod_spatialite.dylib");
@akhenakh
akhenakh / overturemaps.sql
Last active October 26, 2023 13:32
Querying into Overturemap data using duckdb
-- rename files to parquet: find . -type f -exec mv {} {}.parquet \;
-- easier for tools detection like tad
LOAD spatial;
SELECT count(*)
from read_parquet('./theme=places/type=*/*.parquet', filename=true, hive_partitioning=1);
SELECT ST_AsText(ST_GeomFromWkb(geometry)) AS geometry, JSON(names) AS names, JSON(categories)->'$.main' AS category
from read_parquet('./theme=places/type=*/*.parquet', filename=true, hive_partitioning=1)
@akhenakh
akhenakh / gist:f88bd8522aacb90953ea8a3b09df386d
Last active April 9, 2024 11:55
Useful online tools, usually without backend interaction, full js or wasm
@akhenakh
akhenakh / start.sh
Last active October 16, 2023 17:48
FreeBSD on M1/M2 with ssh access to localhost
qemu-system-aarch64 -m 4096M -cpu host -M virt,accel=hvf \
-bios edk2-aarch64-code.fd -serial mon:stdio -nographic \
-drive if=virtio,file=FreeBSD.qcow2,id=hd0 \
-device virtio-net,netdev=vmnic \
-netdev user,id=vmnic,hostfwd=tcp:127.0.0.1:9022-:22
# on the guest service sshd onestart or enable sshd in rc.conf
# bios can be found here wget https://lxr.missinglinkelectronics.com/qemu/+save\=pc-bios/edk2-aarch64-code.fd.bz2
@akhenakh
akhenakh / README.md
Created July 25, 2023 13:58
Allow loading unsigned extension for DuckDB in DBeaver

Right click on your connection: Edit Connection, then Driver Settings, Driver Properties tab.

Add allow_unsigned_extensions to true.

@akhenakh
akhenakh / main.go
Created May 29, 2023 18:04
Convert big GeoJSON FeatureCollections into a line by line features without loading the full file into memory
package main
import (
"bufio"
"encoding/json"
"io"
"os"
"github.com/peterstace/simplefeatures/geom"
)