-
Go to Cloud Storage https://console.cloud.google.com/storage/browser
-
Enter into a bucket for uploading sql file
-
Click select file and upload sql
-
Go to sql interface: https://console.cloud.google.com/sql/instances
-
Select the database instance
{
"lifecycle": {
"rule": [
{
"action": {"type": "Delete"},
"condition": {
"age": 7,
}
}
- Download: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-204.0.0-linux-x86_64.tar.gz
- Uncompress
- RUN:
./google-cloud-sdk/install.sh
gcloud auth login
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common -y && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
sudo apt-key fingerprint 0EBFCD88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
egrep -m3 '^Unseal Key' vault-key.txt | cut -f2- -d: | tr -d ' ' | while read key; do vault unseal ${key}; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import environ as env | |
from novaclient import client | |
VERSION="2" | |
USERNAME=env['OS_USERNAME'] | |
PASSWORD=env['OS_PASSWORD'] | |
PROJECT_ID=env['OS_PROJECT_NAME'] | |
AUTH_URL=env['OS_AUTH_URL'] | |
nova = client.Client(VERSION, USERNAME, PASSWORD, PROJECT_ID, AUTH_URL) |
for podname in $(kubectl get pods -o json| jq -r '.items[].metadata.name'); do kubectl cp "${podname}":/opt ${podname}; done
- Run single pod
kubectl run --generator=run-pod/v1 foobar --image=nginx
- Get yaml without unusable variables
kubectl get deployments ghost --export -n ghost -o yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE=test2; tail -F $FILE 2>/dev/null | ( while read; do NEWHASH=$(md5sum $FILE | cut -d\ -f1); if [ "$HASH" != "$NEWHASH" ]; then echo "File changed!"; HASH=$NEWHASH; fi; done; ) |