Skip to content

Instantly share code, notes, and snippets.

@x-yuri
x-yuri / GCE: make `gcloud compute ssh` use instance metadata.md
Last active March 28, 2024 01:22
GCE: make `gcloud compute ssh` use instance metadata

GCE: make gcloud compute ssh use instance metadata

main.tf:

provider "google" {
  project = "PROJECT_ID"
}

resource "google_compute_instance" "test-ce" {
@x-yuri
x-yuri / GCE: IAP.md
Created March 28, 2024 00:59
GCE: IAP

GCE: IAP

main.tf:

provider "google" {
  project = "PROJECT_ID"
}

resource "google_compute_instance" "test-ce" {
@x-yuri
x-yuri / GCE: OS Login.md
Last active March 28, 2024 00:46
GCE: OS Login

GCE: OS Login

main.tf:

provider "google" {
  project = "PROJECT_ID"
}

resource "google_compute_instance" "test-ce" {
@x-yuri
x-yuri / gcloud compute ssh adds users to every VM (CE).md
Last active March 28, 2024 00:14
gcloud compute ssh adds users to every VM (CE)

gcloud compute ssh adds users to every VM (CE)

main.tf:

provider "google" {
  project = "PROJECT_ID"
}

resource "google_compute_instance" "test-ce" {
@x-yuri
x-yuri / Connecting to a private GKE cluster node.md
Last active March 27, 2024 09:47
Connecting to a private GKE cluster node

Connecting to a private GKE cluster node

main.tf:

provider "google" {
  project = "PROJECT_ID"
}

resource "google_container_cluster" "test-gke" {
@x-yuri
x-yuri / GKE: private cluster and VPN.md
Last active March 27, 2024 07:55
GKE: private cluster and VPN

GKE: private cluster and VPN

main.tf:

provider "google" {
  project = "PROJECT_ID"
}
@x-yuri
x-yuri / GKE: a minimally-privileged IAM service account.md
Last active March 27, 2024 07:34
GKE: a minimally-privileged IAM service account
@x-yuri
x-yuri / GKE: workload identity federation.md
Last active March 26, 2024 16:59
GKE: workload identity federation

GKE: workload identity federation

main.tf:

provider "google" {
  project = "PROJECT_ID"
}

data "google_project" "project" {}
@x-yuri
x-yuri / sudo and escaping.md
Last active March 25, 2024 01:22
sudo and escaping

sudo and escaping

sudo started to escape arguments supposedly on [2010-06-16][a], which corresponds to tag SUDO_1_8_0 and [PACKAGE_VERSION=1.8.0b1][b].

Then they made a change on [2011-01-25][c], which corresponds to tag SUDO_1_8_0 and [PACKAGE_VERSION=1.8.0b3][d]. According to NEWS the change was made in 1.7.5.

And then was another [change][e] on [2011-07-29][f] (SUDO_1_8_2, [PACKAGE_VERSION=1.8.x][g], [PACKAGE_VERSION=1.8.2][h]).

a.sh:

@x-yuri
x-yuri / sudo: libintl_dgettext: symbol not found.md
Last active March 25, 2024 01:18
sudo: libintl_dgettext: symbol not found

sudo: libintl_dgettext: symbol not found

Building versions before [c865a462c][a] ([96b7c1f0f][h] or earlier) on Alpine Linux >= 3.5 fails:

a.sh:

docker run --rm alpine:"$1" sh -euxc '
    apk update
    apk add build-base linux-pam-dev git