Cloud Shell External IP Address
export CLOUD_SHELL_IP=$(curl ifconfig.me)
echo Cloud Shell IP: $CLOUD_SHELL_IP
Cloud Shell External IP Address
export CLOUD_SHELL_IP=$(curl ifconfig.me)
echo Cloud Shell IP: $CLOUD_SHELL_IP
| FROM ubuntu | |
| RUN apt update -y && apt install -y postgresql-client | |
| ENV PGUSER=postgres | |
| ENV PGPASSWORD=admin | |
| ENV PGHOST=127.0.0.1 | |
| ENV PGPORT=5432 |
| import os | |
| import subprocess | |
| import re | |
| from packaging.version import parse | |
| # Get the cache directory | |
| cache_dir = subprocess.run(["pip", "cache", "dir"], capture_output=True, text=True).stdout.strip() | |
| # Get the list of cached files | |
| cached_files = subprocess.run(["pip", "cache", "list"], capture_output=True, text=True).stdout.strip().splitlines() |
| import json | |
| from google.cloud import aiplatform | |
| def extract_metrics_dict(metrics_value): | |
| """Extract metrics from various protobuf structures into a JSON-serializable dictionary.""" | |
| if isinstance(metrics_value, (int, float, str, bool)): | |
| return metrics_value # Base case: simple value | |
| elif hasattr(metrics_value, "value"): | |
| return metrics_value.value # Handle scalar values | |
| elif hasattr(metrics_value, "items"): # Check if it's a MapComposite |
| source="solutions-template-e2etest/microservices" | |
| target="{{cookiecutter.project_id}}/microservices1" | |
| echo $source $target | |
| cd $source | |
| pwd | |
| find . -type d -print | ( | |
| cd - > /dev/null | |
| pushd $target > /dev/null | |
| pwd | |
| while read dirnamewithpath; do |
| docker login -u oauth2accesstoken -p "$(gcloud auth print-access-token)" https://gcr.io | |
| docker pull gcr.io/<project>/<image> | |
| # Copy credentials file to your home directory | |
| docker run -it --entrypoint /bin/bash -v /home/$USER:/root gcr.io/<project>/<image> | |
| #!/bin/bash | |
| # Copyright © 2017 Google Inc. | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
| Actions (Verb) | |
| -------------- | |
| d delete | |
| c change | |
| > indent | |
| v visual mode | |
| y yank | |
| . repeat | |
| Motions (Noun) |