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 / main.go
Created March 4, 2021 16:00
Visual graph for Drone pipelines
package main
import (
"fmt"
"log"
"os"
"github.com/drone/drone-yaml/yaml"
"github.com/goccy/go-graphviz"
"github.com/goccy/go-graphviz/cgraph"
@akhenakh
akhenakh / gist:f88bd8522aacb90953ea8a3b09df386d
Last active April 9, 2024 11:55
Useful online tools, usually without backend interaction, full js or wasm
@akhenakh
akhenakh / nodes.png
Last active March 26, 2024 01:49
Resolve VR180 nodes
nodes.png
@akhenakh
akhenakh / guess.go
Last active March 13, 2024 13:18
Guess an image format in Golang
package main
import (
"image"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"io"
"mime"
@akhenakh
akhenakh / gps.c
Last active February 14, 2024 16:19
A working TTGO T-BEAM v0.7 (the one with only 2 push buttons) LoRa device client for the thing network
#include "gps.h"
HardwareSerial GPSSerial(1);
void gps::init()
{
GPSSerial.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX);
GPSSerial.setTimeout(2);
}
@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 / 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 / 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 / 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 / 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