Press the function button four times rapidly and then hold it a fifth time until you hear a ringing chime.

locals { | |
secrets = yamldecode(file("${path.module}/secrets/secrets-staging.plain.yml")) | |
# Derive numeric versions from the first 15 characters of the SHA-256 hash of the secret values | |
# to trigger replacement when the secret value changes. | |
secret_data_wo_versions = { | |
for key, value in local.secrets : key => | |
parseint(substr(sha256(tostring(value)), 0, 15), 16) | |
} |
function gcpsqlh --description "Run cloud-sql-proxy with current GCP project, optionally impersonating a service account" | |
# Get the current GCP project | |
set -l current_project (gcloud config get-value project) | |
if test -z "$current_project" | |
echo "No GCP project is currently set. Please set a project using 'gcloud config set project PROJECT_ID'" | |
return 1 | |
end | |
# Get the instance connection name |
--- | |
image: google/cloud-sdk:latest | |
steps: | |
- step: &test-id-fed | |
name: Test | |
services: | |
- docker | |
oidc: true | |
script: |
import argparse | |
import datetime | |
import logging | |
from google.api import metric_pb2 | |
from google.cloud import monitoring_v3 | |
from google.protobuf import timestamp_pb2 | |
import google.auth | |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s") |
from flask import Flask, request, Response | |
from flask_cors import CORS | |
import requests | |
import json | |
import subprocess | |
import google.auth | |
import google.auth.exceptions | |
from google.auth.transport.requests import Request | |
import logging |
from google.cloud import compute_v1 | |
import google.auth | |
from dataclasses import dataclass | |
from typing import List | |
import questionary | |
from questionary import Choice | |
@dataclass | |
class LogConfig: |
OAUTH_CLIENT_ID=1234567890-j9onig1ofcgle7iogv8fceu04v8hriuv.apps.googleusercontent.com | |
[email protected] | |
URL=https://your-iap-protected-endpoint | |
ID_TOKEN=$( | |
gcloud auth print-identity-token \ | |
--audiences $OAUTH_CLIENT_ID \ | |
--include-email \ | |
--impersonate-service-account $AUTHORIZED_SA | |
) |
function gcpswitch -d "Switch GCP project" | |
# Retrieve all GCP projects in JSON format | |
set -l projects_json (gcloud projects list --format=json) | |
# Parse JSON to extract project IDs | |
set -l projects (echo $projects_json | jq -r '.[].projectId') | |
# Define the regex patterns to filter projects | |
set -l patterns "hadv-" "hadvimpexp-" "alpen-" "alen-" |
// ==UserScript== | |
// @name Link Extractor | |
// @namespace http://tampermonkey.net/ | |
// @version 0.6 | |
// @description Extract and display links from web sites pages based on specific patterns | |
// @author You | |
// @match https://my-url.com/* | |
// @grant none | |
// ==/UserScript== |