• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

cloud

GCP Cloud Shell Vim Settings

March 10, 2021

I had an issue with using the backspace in Vim in GCP’s Cloud Shell. Every time I’m in the insert mode and I want to edit using backspace, it doesn’t delete the characters. It shows these characters “^?” instead. Well, it turned out to be a backspace setting that you can set within .vimrc. So, here’s my working setup.

colo desert
syntax on
set backspace=indent,eol,start
set nocompatible

colo desert syntax on set backspace=indent,eol,start set nocompatible

  • The first line uses the desert theme.
  • The second line turns on syntax highlighting. It’s on by default.
  • The third line fixes the backspace issue I mentioned above.

Filed Under: Cloud Tagged With: backspace, cloud, gcp, shell, vim, vimrc

GCP CLI Create Firewall

March 12, 2019

Here’s how to add a firewall rule in Google Cloud Platform CLI

gcloud compute firewall-rules create "firewall-name" \
--description="firewall-description" \
--priority "1000" \
--direction INGRESS \
--action allow \
--network "network-name" \
--target-service-accounts="service@account.net" \
--source-ranges="10.0.0.0/8" \
--rules tcp:9001

gcloud compute firewall-rules create "firewall-name" \ --description="firewall-description" \ --priority "1000" \ --direction INGRESS \ --action allow \ --network "network-name" \ --target-service-accounts="service@account.net" \ --source-ranges="10.0.0.0/8" \ --rules tcp:9001

Describe firewall rule.

gcloud compute firewall-rules describe firewall-name

gcloud compute firewall-rules describe firewall-name

Delete firewall rule.

gcloud compute firewall-rules delete firewall-name

gcloud compute firewall-rules delete firewall-name

Filed Under: Cloud Tagged With: cli, cloud, create, delete, describe, firewall, gcp, google

GCP CLI Start Stop Instances

March 12, 2019

Here’s the CLI commands to start and stop Google Cloud instances.

gcloud compute instances start server-name --zone=us-central1-c
gcloud compute instances stop server-name --zone=us-central1-c
gcloud compute instances reset server-name --zone=us-central1-c

gcloud compute instances start server-name --zone=us-central1-c gcloud compute instances stop server-name --zone=us-central1-c gcloud compute instances reset server-name --zone=us-central1-c

Filed Under: Cloud Tagged With: cloud, google, instances, start, stop

Cloud Filestore

January 10, 2019

Cloud Filestore is a managed file service by Google Cloud. It’s a shared file system similar to Amazon’s Elastic File System offering. Users of Cloud Filestore will experience something similar to when using a NAS drive (network attached storage). Filestore is used for both Compute and Kubernetes Engine instances. Unlike EFS where storage is unlimited, you have to specify a storage size when creating a new Filestore.

Create a Filestore:

gcloud beta filestore instances create nfs-server \
    --project=your-project-id \
    --location=your-region \
    --tier=STANDARD \
    --file-share=name="vol1",capacity=1TB \
    --network=name="default",reserved-ip-range="10.0.0.0/29"

gcloud beta filestore instances create nfs-server \ --project=your-project-id \ --location=your-region \ --tier=STANDARD \ --file-share=name="vol1",capacity=1TB \ --network=name="default",reserved-ip-range="10.0.0.0/29"

Delete a Filestore:

gcloud beta filestore instances delete nfs-server --project=your-project-id --location=your-region

gcloud beta filestore instances delete nfs-server --project=your-project-id --location=your-region

Instance clients can connect to the Filestore using a NFS client.

sudo apt-get -y update
sudo apt-get -y install nfs-common
sudo mkdir /mnt/test
sudo mount 10.0.0.59:/vol1 /mnt/test
sudo chmod go+rw /mnt/test

sudo apt-get -y update sudo apt-get -y install nfs-common sudo mkdir /mnt/test sudo mount 10.0.0.59:/vol1 /mnt/test sudo chmod go+rw /mnt/test

Filed Under: Cloud Tagged With: aws, cloud, efs, filestore, gcp, google, nas

Install S3cmd on Ubuntu

December 22, 2014

If you want to backup your Linux server to Amazon S3 (Simple Storage Service), you need to install a utility called S3cmd which allows you to interact with Amazon’s cloud storage service. You’ll be able to create s3 buckets, upload and retrieve files from your Linux server to the S3.

You can install S3cmd from Ubuntu.

sudo apt-get install s3cmd

sudo apt-get install s3cmd

Next, you need to configure S3cmd using your S3 credentials. You’ll need an Access key and a Secret key from Amazon’s Security Credentials page which you can access from Amazon’s IAM Management Console.

sudo s3cmd --configure

sudo s3cmd --configure

For details on how to fully implement S3cmd, please take a look at this article.

Filed Under: Cloud, Linux Tagged With: amazon, cloud, s3, storage

  • Home
  • About
  • Archives

Copyright © 2023