Skip to content

Instantly share code, notes, and snippets.

View verhulstm's full-sized avatar
🏠
Working from home

Michael Verhulst verhulstm

🏠
Working from home
View GitHub Profile
@verhulstm
verhulstm / gist:be3d43370918818bc4ff23d4cf618ff3
Created March 19, 2025 02:28 — forked from milesich/gist:d81298122c56f265e10092a8f02b9fcc
accessing host machine ports from Kind pods
https://github.com/kubernetes-sigs/kind/issues/1200#issuecomment-1304855791
For those interested I think I came with a simpler solution to route network to the host machine, using headless or ExternalName services. The solution is different for Linux and Mac/Window (the latter using Docker desktop).
Linux solution: headless service + endpoint:
---
apiVersion: v1
kind: Endpoints
metadata:
@verhulstm
verhulstm / simple-https-python-server.py
Created November 20, 2024 23:23 — forked from Alexufo/simple-https-python-server.py
Simple Python https server example py 3.10+ ( multithread, wasm, gzip )
import http.server
import http.cookiejar
import io
import socket
from http import HTTPStatus
import ssl
import os
import zlib
server_address = ('0.0.0.0', 4443)
@verhulstm
verhulstm / rcserver.py
Created November 9, 2024 04:49 — forked from rudi-c/rcserver.py
Python key-value server
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from urlparse import urlparse, parse_qs
global_store = {}
class KeyServerHandler(BaseHTTPRequestHandler):
def get_request(self, query_components):
if "key" in query_components:
@verhulstm
verhulstm / rest-server.py
Created June 26, 2019 19:01 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
install anaconda
```
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b
export PATH="~/miniconda3/bin:$PATH"
rm Miniconda3-latest-Linux-x86_64.sh
```
@verhulstm
verhulstm / generate-ssh-key.sh
Created June 23, 2019 19:47 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@verhulstm
verhulstm / http-proxy.go
Last active July 2, 2019 18:24 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@verhulstm
verhulstm / proxy-py2.py
Last active May 15, 2019 20:34 — forked from voorloopnul/proxy.py
A python proxy in less than 100 lines of code
#!/usr/bin/python
# This is a simple port-forward / proxy, written using only the default python
# library. If you want to make a suggestion or fix something you can contact-me
# at voorloop_at_gmail.com
# Distributed over IDC(I Don't Care) license
import socket
import select
import time
import sys
@verhulstm
verhulstm / ipv6-httpd.py
Created April 12, 2019 03:03 — forked from akorobov/ipv6-httpd.py
quick ipv6 http server using python's SimpleHttpServer
import socket
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class MyHandler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/ip':
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*