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 / 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 September 10, 2024 13:04
Querying into Overturemap data using duckdb
-- rename files to parquet: find . -type f -exec mv {} {}.parquet \;
-- easier for tools detection like tad
LOAD spatial;
-- Update with Geoparquet
FROM read_parquet('/opt/public_files/overturemaps/theme=places/type=place/*', filename=true, hive_partitioning=1)
where bbox.xmin > -71.2 and bbox.xmax < -71.1 and bbox.ymin > 46.7 and bbox.ymax < 46.9
LIMIT 1;
@akhenakh
akhenakh / gist:f88bd8522aacb90953ea8a3b09df386d
Last active November 1, 2025 18:01
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"
)
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const target = b.standardTargetOptions(.{ .default_target = .{ .abi = .gnu } });
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("hello-gamedev", "src/main.zig");
exe.setTarget(target);
exe.setBuildMode(mode);
@akhenakh
akhenakh / featurecollection.yaml
Created May 10, 2023 01:55
Exploding GeoJSON feature collection to feature with Benthos
input:
label: input_geojson
stdin:
codec: all-bytes
max_buffer: 1e+06
pipeline:
processors:
- mapping: root = this.features
- unarchive:
format: json_array