Skip to content

Instantly share code, notes, and snippets.

View so-jelly's full-sized avatar
🍑
Peachy

Shawn O'Dell so-jelly

🍑
Peachy
  • @Wärtsilä
  • Milwaukee, WI
View GitHub Profile
@so-jelly
so-jelly / gcloud_connect
Created November 22, 2022 22:30
cloud vm
#!/bin/bash
set -eEo pipefail
set -x
print_usage() {
cat <<HELP_USAGE
Usage:
$0 [-p <project>] [-z <zone>] <vm_name>
-p Project the VM belongs to
@so-jelly
so-jelly / gcp project validate
Last active February 9, 2023 17:35
terraform
variable "project_id" {
description = "The name of the Google Project ID where the keys will be stored. eg: 'my-project'"
type = string
}
data "google_projects" "prj" {
filter = "id:${var.project_id}"
lifecycle {
postcondition {
condition = length(self.projects) == 1
BUCKET=foo-bucket
USER=name@domain.com
gsutil iam get gs://$BUCKET |
jq -r '.bindings |
map(select(any(
.members[]; contains("user:'$USER'")))
|.role)[]'
@so-jelly
so-jelly / pod.yaml
Created April 13, 2023 14:18
es-zone
apiVersion: v1
kind: Pod
metadata:
name: myapp
labels:
name: myapp
spec:
containers:
- name: myapp
image: &elasticsearch_image docker.io/bitnami/elasticsearch:8.3.3-debian-11-r5
@so-jelly
so-jelly / ftp_client.go
Created July 20, 2023 15:49
ftp client
package main
import (
"context"
"fmt"
"io"
"log"
"path/filepath"
"sync"
@so-jelly
so-jelly / dag.go
Created August 21, 2023 13:32
dag, hypergraph.. whatver
package main
import (
"errors"
"fmt"
)
// Node represents a node in the DAG.
type Node struct {
ID int