Skip to content

Instantly share code, notes, and snippets.

View rossedman's full-sized avatar
🚀
COMPUTERS IN SPACE.

Ross Edman rossedman

🚀
COMPUTERS IN SPACE.
View GitHub Profile
#!/bin/bash
#
# kubectl-otk-ssh
#
# this script provides a way to SSH/SSM into hosts. this is backed
# by AWS SSM and is not a true ssh. this scripts provides the functionality
# to select random hosts by status or labels or directly choose a host.
#
# Install:
#
@rossedman
rossedman / taint.sh
Created September 6, 2022 18:55
Taint All Terraform Module Resources
# this will find all resources listed under a module and then parse
# the output to xargs and taint each resource that lives under the module
terraform state list module.eks | xargs -d '\n' -n1 terraform taint
@rossedman
rossedman / main.tf
Last active September 8, 2024 22:40
Scale homelab into cloud with Tailscale, Terraform and cloud-init
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
}
}
}
provider "digitalocean" {
}
@rossedman
rossedman / latest.sh
Created February 24, 2021 21:34
Retrieve latest release tag from a github repo
#!/bin/bash
REPO="actions/runner"
curl -s "https://api.github.com/repos/${REPO}/releases/latest" \
| jq -r .tag_name \
| cut -d'v' -f2
@rossedman
rossedman / main.go
Last active November 6, 2020 20:12
Consistent hashing server that will determine a key path to write information to across a key space
package main
import (
"flag"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/lafikl/consistent"
@rossedman
rossedman / pipeline.go
Last active October 8, 2020 21:35
Examples of concurrency patterns in Go
package main
import (
"log"
)
func main() {
// turn tasks into a channel
tasks := generator(
Task{Name: "one"},
@rossedman
rossedman / main.go
Created September 9, 2020 20:18
Go Fan Out/In Example
package main
import (
"fmt"
"sync"
)
func main() {
ids := generator("id1", "id2", "id3", "id4", "id5", "id6")
@rossedman
rossedman / main.go
Last active May 8, 2020 21:38
Gorrila Mux Router Mounting
package main
func main() {
r := mux.NewRouter()
mount(r, "/api/v1", handler.Router(), auth)
...
}
// mount will take routers from a handler and add it with a pathprefix
// mount will take routers from a handler and add it with a pathprefix
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"os/signal"
"sync"
[Unit]
Description=VSCode server for internal network and vpn
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop vscode
ExecStartPre=-/usr/bin/docker rm vscode