• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Archives for August 2018

Create Image on GCP

August 8, 2018

Here’s the command to create an image from an existing VM instance. You can create an image from disks, snapshots, images or from a cloud storage file. You can use images you built to launch and restore VM instances, as well as create Instance Templates.

gcloud compute --project=your-project images create your-server --source-disk=your-server --source-disk-zone=us-central1-c

gcloud compute --project=your-project images create your-server --source-disk=your-server --source-disk-zone=us-central1-c

Filed Under: Cloud Tagged With: gcp, images

Take A GCP Snapshot

August 8, 2018

Here’s the gcloud command to create a snapshot of your GCP instance.

gcloud compute disks snapshot your-server \
--snapshot-names=your-server-180808 \
--project=your-project \
--zone=us-central1-c

gcloud compute disks snapshot your-server \ --snapshot-names=your-server-180808 \ --project=your-project \ --zone=us-central1-c

Filed Under: Cloud Tagged With: gcp, snapshot

Cloning A GCP Repo

August 3, 2018

Here are the steps on how to clone a Google Cloud Platform (GCP) repository. This is assuming you already installed Google Cloud SDK.

gcloud init
gcloud source repos clone name_of_repo --project=project_name
cd name_of_repo
git commit -a -m "your comment"
git push -u origin master

gcloud init gcloud source repos clone name_of_repo --project=project_name cd name_of_repo git commit -a -m "your comment" git push -u origin master

Filed Under: Cloud Tagged With: gcp, git, repo

Git Diff

August 2, 2018

When working with version control, sometimes you would like to know what files were committed locally vs what’s on the master origin repository. One way to know the difference is to use the git diff or the git log commands. Here are the commands to check the differences between the local and master origin repositories. Diff is better in my opinion since it actually displays the code changes instead of just displaying the commit ID.

$ git diff origin/master..HEAD
$ git log origin/master..HEAD

$ git diff origin/master..HEAD $ git log origin/master..HEAD

Filed Under: Cloud, Linux Tagged With: diff, git

URL Encode

August 2, 2018

If you need to special characters encoded in a URL, these sites really come handy. Why is there a need to encode? URLs accepts only alphanumeric characters and a limited number of special characters. For example, : and / are common characters you’ll find in URLs. Meanwhile spaces are not allowed, but instead are represented as %20 when encoded. There are other special characters that will need to be encoded.

Here are a couple of sites to help you encode:

https://www.urlencoder.org/
https://www.url-encode-decode.com/

Filed Under: HTML Tagged With: encode, url

  • Home
  • About
  • Archives

Copyright © 2023