Skip to content

Instantly share code, notes, and snippets.

@PayasR
PayasR / routing_algorithm_implementations.txt
Last active December 25, 2023 08:52 — forked from systemed/gist:be2d6bb242d2fa497b5d93dcafe85f0c
Routing algorithm implementations
**Interesting/widely used implementations of pathfinding algorithms.
==========================================================================
A* Ruby https://github.com/georgian-se/shortest-path
A* (bidirectional with shortcuts) C++ https://github.com/valhalla/valhalla
A* Unity https://arongranberg.com/astar/front
NBA* JS https://github.com/anvaka/ngraph.path
NBA* Java https://github.com/coderodde/GraphSearchPal
NBA* Java https://github.com/coderodde/FunkyPathfinding
NBA* (Parallel) C++ https://github.com/janhsimon/PNBAStar
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@inkrement
inkrement / clickhousedump
Created August 19, 2017 14:26
dump all clickhouse databases and tables
#!/bin/bash
OUTDIR=.
while read -r db ; do
while read -r table ; do
if [ "$db" == "system" ]; then
echo "skip system db"
continue 2;
@negz
negz / kubedump.sh
Last active March 6, 2024 18:42
Dump Kubernetes cluster resources as YAML
#!/usr/bin/env bash
set -e
CONTEXT="$1"
if [[ -z ${CONTEXT} ]]; then
echo "Usage: $0 KUBE-CONTEXT"
exit 1
fi
@gkbrk
gkbrk / Cargo.toml
Last active March 4, 2019 05:37
Asynchronous server example in Rust
[package]
name = "rust-async-qotd"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <webdosusb@gmail.com>"]
[dependencies]
tokio = { git = "https://github.com/tokio-rs/tokio" }
rand = "0.3"
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@eirikb
eirikb / clicktest.md
Last active April 9, 2021 16:49
Automated click testing in bash

About

This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.

Dependencies

@drmalex07
drmalex07 / README-setup-socket-activated-systemd-service.md
Last active December 26, 2023 05:13
An example inetd-like socket-activated service. #systemd #inetd #systemd.socket

README

This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.

Define a socket unit

The key point here is to specify Accept=yes, which will make the socket accept connections (behaving like inetd) and pass only the resulting connection socket to the service handler.

@drmalex07
drmalex07 / README-python-service-on-systemd-activated-socket.md
Last active January 13, 2024 12:53
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at /opt/foo/serve.py.

@dromanov
dromanov / triangles_to_VTK.py
Last active July 15, 2021 14:10
Demonstration of creation VTK file with unstructured grid using Python low level calls of evtk library.
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
from evtk.vtk import VtkFile, VtkUnstructuredGrid, VtkTriangle, VtkVertex
import numpy as np
from copy import deepcopy
"""