Skip to content

Instantly share code, notes, and snippets.

View devops-rob's full-sized avatar
🏠
Working from home

DevOps Rob devops-rob

🏠
Working from home
View GitHub Profile
@nicholasjackson
nicholasjackson / readme.md
Last active March 10, 2023 11:28
Boundary HCP Demo

Boundary Demo

Providing remote access to applications and systems requires secure routing to the destination and credentials to authenticate the user. Traditionally, you achieve this using a Virtual Private Network (VPN) or a Bastion server to bridge into the private network. Credentials are generally provided individually, created as part of a manual process, and with password rotation on a best-intention basis. This is problematic as access is usually too broad, difficult to audit, and complex to maintain.

@nicholasjackson
nicholasjackson / deregister.sh
Last active August 24, 2023 17:38
Boundary Worker Registration
#!/bin/sh -e
echo "[$(date +%T)] Deregister boundary worker"
# Read the worker id from the file written on startup
worker_id=$(cat ./worker_id)
# Base url for the HCP cluster
base_url="https://${cluster_id}.boundary.hashicorp.cloud/v1"
auth_url="${base_url}/auth-methods/${auth_method_id}:authenticate"
dereg_url="${base_url}/workers/${worker_id}"
@kawsark
kawsark / vault-agent-pki
Last active December 20, 2023 12:50
Vault Agent with PKI certificate rendering
### Configure variables
These variables will be used for this snippet. Please substitute accordingly.
```bash
export RootCAName="root_ca"
export InterCAName="inter_ca"
export CommonName="hashidemos.io"
export InterCommonName="inter.hashidemos.io"
export Root_CA_ttl="730h"
export Inter_CA_ttl="350h"
export Cert_ttl="8h"
@joatmon08
joatmon08 / app.tf
Last active March 13, 2024 10:40
Terraform Example for Azure App Gateway & App Service
locals {
app_services = [
{
kind = "Linux"
sku = {
tier = "Standard"
size = "S1"
}
},
{
@mimoo
mimoo / compress_tar_gzip.go
Last active March 5, 2024 03:53
How to compress a folder in Golang using tar and gzip (works with nested folders)
package main
import (
"archive/tar"
"bytes"
"compress/gzip"
"fmt"
"io"
"os"
"path/filepath"
@michaljemala
michaljemala / tls-client.go
Last active April 10, 2024 01:57
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@ryanfitz
ryanfitz / golang-nuts.go
Created December 2, 2012 22:45
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl