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 / 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 / spatialite.sql
Last active September 11, 2023 16:18
DBeaver and Spatialite
-- load the extension (usually mod_spatialite)
select load_extension("/opt/homebrew/lib/mod_spatialite.dylib");
-- display the current version to prove it's loaded
select spatialite_version();
-- Transform the geometry to st_astext in your queries
select st_astext(GEOM) as geom from not_enabled_airspace;
-- or as binary
@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
@akhenakh
akhenakh / h3gosvg.ipynb
Last active March 24, 2023 01:03
Go Jupyter kernel demonstrate how to use h3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@akhenakh
akhenakh / app.yaml
Last active March 4, 2023 19:22
Example of graceful shutdown with grpc healthserver * httpserver
readinessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 1
livenessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 2
imagePullPolicy: IfNotPresent
@akhenakh
akhenakh / cmd.md
Last active January 19, 2023 13:59
Nice shell for kubernetes

Tools

Install required tools

brew install fzf
brew install kubectx
brew install stern
brew install kube-ps1
brew install kubecolor/tap/kubecolor
@akhenakh
akhenakh / tempo.yaml
Created January 17, 2023 21:15
Quick and dirty Grafana Tempo deployment for Kubernetes, 1 hour retention, good for development
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: tempo
namespace: tempo
spec:
selector:
matchLabels:
app: tempo
serviceName: "tempo"