gcp create service account

Here’s how to create a GCP Service Account. gcloud beta iam service-accounts create service-account-name \ --description "service account description" \ --display-name "service account display name"

September 22, 2019 · 1 min · ulysses

gcp create service account key

Here’s how to create a key for the GCP Service Account. Create Key. gcloud iam service-accounts keys create ~/key.json \ --iam-account service-name@project-id.iam.gserviceaccount.com Activate Key gcloud auth activate-service-account service-name@project-id.iam.gserviceaccount.com \ --key-file=key.json Revoke Key. gcloud auth revoke service-account@project-id.iam.gserviceaccount.com Delete Key gcloud iam service-accounts keys delete key-id \ --iam-account service-name@project-id.iam.gserviceaccount.com

September 22, 2019 · 1 min · ulysses

gcp sdk update

Here’s how to update your Google Cloud Platform SDK (Software Development Kit) which is aka the CLI for interacting with Google’s API. Get Current Version gcloud version Get the Components List gcloud components list Update gcloud components update

September 22, 2019 · 1 min · ulysses

gcloud interactive shell

If you already have Google SDK installed, you can activate GCloud Interactive Shell, which is still in beta by the way, by typing the following command from the Google SDK terminal. gcloud beta interactive The interactive shell environment has auto-completion. It shows you who’s logged in and which project you are currently set in. To exit the interactive shell, just Press F9 to quit.

September 21, 2019 · 1 min · ulysses

gcp compute disks move

Here’s how to move a GCP disk between zones. Make sure disk is detached from instance. Use the GCloud Disk Move command. # Detach disk from instance gcloud compute instances detach-disk server --disk=server-boot # Move disk from us-central1-b to us-central1-f gcloud compute disks move example-disk-1 --zone us-central1-b --destination-zone us-central1-f

September 21, 2019 · 1 min · ulysses

codeigniter base url

I have a CodeIgniter dev site in Google Cloud. The instance obtains a new IP address at every start. You can set the base URL to a domain or IP address in the “/application/config/config.php” file. Since it’s only a dev box, I don’t have a domain assigned. It’s accessible via IP address only which changes every time the instance is started. So here’s the workaround. I added some extra code in the config file to obtain the external IP address. ...

September 19, 2019 · 1 min · ulysses

windows + tab

Found another gem to display all Windows by using … Windows + Tab

September 18, 2019 · 1 min · ulysses

gcp create instance from snapshot

There are two steps in creating an instance from a snapshot. Create a disk from snapshot Create an instance from the disk Create a disk from snapshot. gcloud compute disks create "hostname-boot" \ --project "project-id" \ --zone "us-central1-a" \ --source-snapshot "snapshot-name" \ --type "pd-standard" \ --size "100" Create an instance from disk. gcloud beta compute instances create hostname \ --project=project-id \ --zone=us-central1-a \ --subnet=your-subnetwork \ --machine-type=n1-standard-1 \ --no-address \ --maintenance-policy=MIGRATE \ --service-account=service.account@developer.gserviceaccount.com \ --disk=name=instance-1,device-name=instance-1,mode=rw,boot=yes,auto-delete=yes \ --reservation-affinity=any \ --labels=builtby=john.doe \ --tags=web \ --scopes= \ --metadata=

September 17, 2019 · 1 min · ulysses

nitro-based instance volumes

AWS introduced Nitro-based instances which are modular. They are meant for high performance, high availability, and high security systems. Nitro building blocks provide direct access to high-speed local storage over a PCI interface and transparently encrypts all data using dedicated hardware. It also provides hardware-level isolation between storage devices and EC2 instances so that bare metal instances can benefit from local NVMe storage. The following are Nitro-based instances: A1, C5, C5d, C5n, I3en, M5, M5a, M5ad, M5d, p3dn.24xlarge, R5, R5a, R5ad, R5d, T3, T3a, and z1d. Bare metal: c5.metal, c5n.metal, i3.metal, i3en.metal, m5.metal, m5d.metal, r5.metal, r5d.metal, u-6tb1.metal, u-9tb1.metal, u-12tb1.metal, and z1d.metal. ...

September 17, 2019 · 2 min · ulysses

force umount if busy

If device is busy and you can’t umount it, try it with -l option (lazy unmount). Or you can force it. # standard umount /mnt/data # lazy umount umount -l /mnt/data # force umount -f /mnt/data Lazy unmount is safer since it will detach immediately and clean up all references to the file system. Force is a bit more drastic.

September 16, 2019 · 1 min · ulysses