Skip to content

Instantly share code, notes, and snippets.

View golubov-andrey's full-sized avatar

Golubov Andrey golubov-andrey

View GitHub Profile
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: v1.14.3 # change according to kubeadm supported version
apiServer:
certSANs:
- 127.0.0.1
- cluster-api.example.com # change according to your requirements
extraArgs:
authorization-mode: Node,RBAC
feature-gates: "TTLAfterFinished=true"
@lagunoff
lagunoff / variant.ts
Last active September 19, 2019 18:01
typescript variants
// Alternative sum types for typescript. Variants may be more convenient than unions
// because they easier to manipulate (see `Mapped types`)
// - [https://www.typescriptlang.org/docs/handbook/advanced-types.html](Mapped types)
// - [https://github.com/natefaubion/purescript-variant]
const variantSymbol = Symbol('Variant');
type Variant<T> = { 0: keyof T, 1: T[keyof T]; [variantSymbol]: T };
// Variant constructor
function variant<T, K extends keyof T>(key: K, value: T[K]): Variant<T> {
# PASSENGER DEV OK
server {
listen 80;
listen 443 ssl http2;
listen [::]:80;
listen [::]:443 ssl http2;
server_name webapp.example.com;
location /.well-known/acme-challenge/ { alias /opt/le/.acme-challenges/; }
upstream my-web-app-here {
server 127.0.0.1:8080;
}
server {
listen 80;
listen 443 ssl http2;
listen [::]:80;
listen [::]:443 ssl http2;
@teknoraver
teknoraver / unixhttpc.go
Last active November 26, 2025 20:43
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@remarkablemark
remarkablemark / Dockerfile
Last active March 25, 2026 14:35
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@Rubentxu
Rubentxu / maybe.go
Created September 24, 2015 23:34
Implementing the Maybe monad in Golang
package main
import (
"fmt"
"errors"
)
type Maybe interface {
Return(value interface{}) Maybe
Bind(func(interface{}) Maybe) Maybe
@filewalkwithme
filewalkwithme / main.go
Last active March 17, 2025 15:20
Listening multiple ports on golang http servers (using http.Handler)
package main
import (
"net/http"
)
func main() {
go func() {
http.ListenAndServe(":8001", &fooHandler{})
}()
@willurd
willurd / web-servers.md
Last active May 5, 2026 10:35
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@sr75
sr75 / wildcard-ssl-cert-for-testing-nginx-conf.md
Created June 1, 2013 18:35
create a self signed wildcard ssl cert for testing with nginx.conf example

just change out app_name for your purposes

openssl genrsa 2048 > app_name-wildcard.key

openssl req -new -x509 -nodes -sha1 -days 3650 -key app_name-wildcard.key > app_name-wildcard.cert

# Common Name (eg, your name or your server's hostname) []:*.app_name.com

openssl x509 -noout -fingerprint -text &lt; app_name-wildcard.cert &gt; app_name-wildcard.info