Skip to content

Instantly share code, notes, and snippets.

@skarllot
skarllot / enum.go
Created June 18, 2015 14:04
Enum-like types for Go (golang) that provides string representation
package main
import "fmt"
var enums []string
type Enum int
func (e Enum) String() string {
return enums[int(e)]
@popravich
popravich / PostgreSQL_index_naming.rst
Last active July 19, 2024 06:03
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@gabrieljcs
gabrieljcs / vm-secureboot.md
Last active May 25, 2024 14:49
Instructions on signing VirtualBox and VMware modules for Secure Boot

Signing VirtualBox & VMware modules

Source

Creating a key

You can change "MOK".priv/.der to any desired name; "CN=" MUST hold your username, signing the modules may not work otherwise (on shim, possibly due to a bug).

$ openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=John Doe/"
@abhi
abhi / calico_route_reflector.md
Last active September 20, 2022 00:24
Steps to deploy Route Reflectors

Steps to deploy Route Reflector on UCP 3.0

Note: If you are using UCP 3.0 on Azure deploying route reflectors is not required. The networking control plane is handled by Azure SDN and not calico.

  1. On one of the nodes in Docker EE cluster, download the calicoctl binary from
    curl -O -L https://github.com/projectcalico/calicoctl/releases/download/v3.1.1/calicoctl
    chmod +x calicoctl
    

$PATH=$PATH:/