gcp list disk types

To list all disk types available in your project in all regions. Result is truncated. $ gcloud compute disk-types list NAME ZONE VALID_DISK_SIZES pd-balanced 10GB-65536GB pd-ssd 10GB-65536GB pd-standard 200GB-65536GB pd-balanced 10GB-65536GB ... To list a specific region, use the filter option. $ gcloud compute disk-types list --filter="zone~'us-central1'" NAME ZONE VALID_DISK_SIZES pd-balanced us-central1-a 10GB-65536GB pd-extreme us-central1-a 500GB-65536GB pd-ssd us-central1-a 10GB-65536GB pd-standard us-central1-a 10GB-65536GB pd-balanced us-central1-b 10GB-65536GB pd-extreme us-central1-b 500GB-65536GB pd-ssd us-central1-b 10GB-65536GB pd-standard us-central1-b 10GB-65536GB pd-balanced us-central1-c 10GB-65536GB pd-extreme us-central1-c 500GB-65536GB pd-ssd us-central1-c 10GB-65536GB pd-standard us-central1-c 10GB-65536GB pd-balanced us-central1-f 10GB-65536GB pd-extreme us-central1-f 500GB-65536GB pd-ssd us-central1-f 10GB-65536GB pd-standard us-central1-f 10GB-65536GB pd-balanced us-central1-d 10GB-65536GB pd-extreme us-central1-d 500GB-65536GB pd-ssd us-central1-d 10GB-65536GB pd-standard us-central1-d 10GB-65536GB To a list a specific region and local SSDs only. ...

December 22, 2021 · 1 min · ulysses

create aws vpc using terraform

Creating a VPC in AWS using Terraform. The script will do the following: Create a VPC Create a Subnet Create an Internet Gateway Create a route in the default route table using the Internet Gateway Contents of main.tf terraform { required_providers { aws = { source = "hashicorp/aws" } } } provider "aws" { profile = "tfc" region = "us-west-1" } resource "aws_vpc" "my-vpc" { cidr_block = "10.0.4.0/24" instance_tenancy = "default" tags = { Name = "my-vpc" } } resource "aws_subnet" "my-subnet" { vpc_id = aws_vpc.my-vpc.id cidr_block = "10.0.4.0/24" availability_zone = "us-west-1a" tags = { Name = "my-subnet-us-west-1a" } } resource "aws_internet_gateway" "my-igw" { vpc_id = aws_vpc.my-vpc.id tags = { Name = "my-internet-gateway" } } resource "aws_default_route_table" "my-rt" { default_route_table_id = aws_vpc.my-vpc.default_route_table_id route { cidr_block = "0.0.0.0/0" gateway_id = aws_internet_gateway.my-igw.id } tags = { Name = "my-route-table" } }

December 21, 2021 · 1 min · ulysses

gcs fuse

GCS Fuse allows you to mount a Google bucket as a file system. It’s similar to S3FS. Setup repo sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null Yum install sudo yum install gcsfuse For Ubuntu or Linux Mint, download the deb package. curl -L -O https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v0.39.2/gcsfuse_0.39.2_amd64.deb sudo dpkg --install gcsfuse_0.39.2_amd64.deb rm gcsfuse_0.39.2_amd64.deb Check if installed. gcsfuse -v Login. gcloud auth login gcloud auth application-default login Setup mount. mkdir -p /path/to/mount chown username:username /path/to/mount Mount it. gcsfuse my-bucket /path/to/mount Alternative using service account key. ...

December 21, 2021 · 1 min · ulysses

enable core dumps

Core dumps are triggered by kernel when a program crashses. It saves memory to a file. How to enable core dumps. ulimit -S -c unlimited Enable core dumps permanently. Edit /etc/security/limits.conf. Add the following. * soft core unlimited Disable core dumps. ulimit -S -c 0 Disable core dumps permanently. Edit /etc/security/limits.conf. Add the following. * soft core 0 * hard core 0

December 13, 2021 · 1 min · ulysses

uninstall ibm tivoli system automation

How to uninstall IBM Tivoli System Automation from Linux. Check if domain is online. lsrpdomain Stop the domain. stoprpdomain <domain> </domain> Uninstall. cd /opt/IBM/tsamp/sam/uninst/ ./uninstallSAM Check the logs. /tmp/uninstallSAM..log

December 13, 2021 · 1 min · ulysses

rebuild docker containers

How to rebuild your application from scratch using Docker. #!/bin/bash docker-compose down -v docker rmi $(docker images -a -q) docker-compose up -d docker-compose restart -t 10 Steps Purge the containers. Delete docker images. Reinitiate docker. Restart docker.

December 12, 2021 · 1 min · ulysses

run mysql in a docker container

How to run MySQL commands in a Docker container. #!/bin/bash set -a; source /dev/null The first command loads the content of .env to environment variables. The MySQL password can then be used using the ${MYSQL_PASSWORD} variable. I’m using sed to get around the special characters in the password. The second command runs docker exec on wp_db container. The last 3 commands are the actual sql commands. We are selecting to use the db1 database. Then we run select statements from the wp_options table. Finally, 2>/dev/null suppresses errors and warning to null.

December 12, 2021 · 1 min · ulysses

install docker on amazon linux 2

Steps how to install Docker and Docker Compose on Amazon Linux 2. Install Docker $ sudo amazon-linux-extras install docker $ sudo service docker start $ sudo usermod -a -G docker ec2-user Start at boot. $ sudo chkconfig docker on Install git (optional). $ sudo yum install -y git Install Docker Compose $ sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) \ -o /usr/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose Check docker --version docker-compose --version

December 11, 2021 · 1 min · ulysses

stop and remove all docker containers

How to stop and remove all Docker containers. Stop all containers $ docker kill $(docker ps -q) Remove all containers $ docker rm $(docker ps -a -q) Delete all docker images $ docker rmi $(docker images -q)

December 11, 2021 · 1 min · ulysses

docker container logs

How to check Docker container logs. Look for the container ID. $ docker ps -a 3e2c1193915f To view the logs for the container. docker logs 3e2c1193915f # or docker container logs 3e2c1193915f

December 10, 2021 · 1 min · ulysses