Skip to content

Instantly share code, notes, and snippets.

View frank-dspeed's full-sized avatar
🇩🇪
I Engineer

Frank Lemanschik frank-dspeed

🇩🇪
I Engineer
View GitHub Profile

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

@frank-dspeed
frank-dspeed / buildGraal.py
Created August 22, 2021 10:01 — forked from lazar-mitrovic/buildGraal.py
Build latest GraalVM CE (Java 8 / 11)
#!/usr/bin/python3
import os, sys
import platform
import subprocess
import shutil
from argparse import ArgumentParser, REMAINDER
my_env = os.environ.copy()
current_os = platform.system().lower()
version = "python-1.0.4"
@frank-dspeed
frank-dspeed / index.js
Created August 18, 2021 11:25 — forked from Frando/index.js
hyperdrive & hypergraph in same hyperdb
var hyperdb = require('hyperdb')
var sub = require('subhyperdb')
var hyperdrive = require('hyperdrive')
var hypergraph = require('hyper-graph-db')
var hyperdriveMessages = require('hyperdrive/lib/messages')
var dbName = process.argv[2]
var op = process.argv[3]
if (op !== 'read' && op !== 'write') {
@frank-dspeed
frank-dspeed / async-engine.js
Created February 12, 2021 04:34 — forked from jonschlinkert/async-engine.js
PoC of an async template engine using native template literals and async-await. Response to https://twitter.com/doowb/status/1072688034485805058
const compile = (input, helpers, thisArg) => {
return async data => {
let ctx = { ...thisArg, ...data };
let keys = [];
let vals = [];
if (helpers) {
for (let key of Object.keys(helpers)) {
if (ctx[key] === void 0) {
ctx[key] = (...args) => helpers[key].call(ctx, ...args);
@frank-dspeed
frank-dspeed / Knex-Migrations-Seeding.md
Created January 6, 2021 12:26 — forked from NigelEarle/Knex-Migrations-Seeding.md
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@frank-dspeed
frank-dspeed / puppeteer_on_termux.md
Created December 30, 2020 12:41 — forked from rishabhrpg/puppeteer_on_termux.md
Run puppeteer inside termux

Run Puppeteer inside termux

Assumptions

  • You have termux installed and have sufficient permissions
  • You have loggedin as root user
  • You are okay with running Puppeteer inside a container (Alpine)

Gotchas

  • There is no build of Google Chrome available for ARM at this moment, so using chromium instead.
  • Installing chromium on Termux directly requires snap which is another big hurdle so alternively using alpine distro here.
@frank-dspeed
frank-dspeed / example-kotlin-vertx-tcp-prometheus.kt
Last active December 26, 2020 07:34 — forked from asad-awadia/vertx-tcp-prom.kt
Example Kotlin Vert.x tcp server with prometheus metrics
fun main() {
// init prometheus registry
val registry = PrometheusMeterRegistry(PrometheusConfig.DEFAULT)
// bind micrometer metrics
ClassLoaderMetrics().bindTo(registry)
JvmMemoryMetrics().bindTo(registry)
JvmGcMetrics().bindTo(registry)
ProcessorMetrics().bindTo(registry)
JvmThreadMetrics().bindTo(registry)
UptimeMetrics().bindTo(registry)
@frank-dspeed
frank-dspeed / how-to-install-graalvm-linux.md
Created August 30, 2020 16:51 — forked from ricardozanini/how-to-install-graalvm-linux.md
How to install GraalVM on Linux with alternatives

How to Install GraalVM Community Edition on Linux

Note: Tested on Fedora only

  1. Download the new release of GraalVM and unpack it anywhere in your filesystem:
$ tar -xvzf graalvm-ce-1.0.0-rc14-linux-amd64.tar.gz
@frank-dspeed
frank-dspeed / kvm_minikube.md
Created April 9, 2020 17:19 — forked from alexellis/kvm_minikube.md
Run multiple minikube Kubernetes clusters on Ubuntu Linux with KVM

Ramp up your Kubernetes development, CI-tooling or testing workflow by running multiple Kubernetes clusters on Ubuntu Linux with KVM and minikube.

In this tutorial we will combine the popular minikube tool with Linux's Kernel-based Virtual Machine (KVM) support. It is a great way to re-purpose an old machine that you found on eBay or have gathering gust under your desk. An Intel NUC would also make a great host for this tutorial if you want to buy some new hardware. Another popular angle is to use a bare metal host in the cloud and I've provided some details on that below.

We'll set up all the tooling so that you can build one or many single-node Kubernetes clusters and then deploy applications to them such as OpenFaaS using familiar tooling like helm. I'll then show you how to access the Kubernetes clusters from a remote machine such as your laptop.

Pre-reqs

  • This tutorial uses Ubuntu 16.04 as a base installation, but other distributions are supported by KVM. You'll need to find out how to install
@frank-dspeed
frank-dspeed / package.json
Created March 16, 2020 05:06 — forked from confraria/package.json
rollup with typescript
{
"name": "topz2",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"couch:start": "docker run -p 5984:5984 -it -v $(pwd)/couchdata:/opt/couchdb/data -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=local_development_password topzcouch"
},
"keywords": [],
"author": "",