This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Cloud

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

Cloud computing refers to the delivery of computing services over the internet, including storage, processing power, and applications. It allows users to access and manage data and applications from anywhere with an internet connection, providing flexibility and scalability. Cloud services are typically offered on a pay-as-you-go basis, reducing the need for upfront investment in hardware and infrastructure.

Cloud computing is divided into several models, including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). IaaS provides virtualized computing resources over the internet, PaaS offers a platform for developing and deploying applications, and SaaS delivers software applications over the internet on a subscription basis.

One of the key benefits of cloud computing is its ability to scale resources up or down based on demand. This elasticity allows businesses to handle varying workloads efficiently and cost-effectively. Additionally, cloud services often include built-in redundancy and disaster recovery options, ensuring high availability and data protection.

Security is a critical aspect of cloud computing, with providers implementing various measures to protect data and ensure compliance with regulations. These measures include encryption, access controls, and regular security audits. Users must also follow best practices to secure their data and applications in the cloud.

Overall, cloud computing offers numerous advantages, including cost savings, flexibility, and enhanced collaboration. It enables businesses to innovate and respond quickly to changing market conditions. As technology continues to evolve, cloud computing is becoming an integral part of modern IT infrastructure, driving digital transformation across industries.

1 - 🖥️aws

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the aws command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#   █████╗ ██╗    ██╗███████╗
#  ██╔══██╗██║    ██║██╔════╝
#  ███████║██║ █╗ ██║███████╗
#  ██╔══██║██║███╗██║╚════██║
#  ██║  ██║╚███╔███╔╝███████║
#  ╚═╝  ╚═╝ ╚══╝╚══╝ ╚══════╝

# install aws cli
pip install awscli

# configure AWS CLI
aws configure

# describe instances in the current account
aws ec2 describe-instances --instance-ids i-01234567

# list public IP addresses of instances
aws ec2 describe-instances \
  --query "Reservations[*].Instances[*].PublicIpAddress" \
  --output=text

# start instance with the specified id
aws ec2 start-instances --instance-ids i-12345678c

# copy directory to S3
aws s3 cp ${directory} s3://${bucket}/${directory} --recursive

# sync directory with S3
aws s3 sync ${directory} s3://${bucket}/${directory} --exclude *.tmp

# list s3 buckets
aws s3 ls

# remove s3 bucket
aws s3 rb --force s3://${bucket_name}

# get bucket logging
aws s3api get-bucket-logging --bucket ${bucket_name}

# AWS cloudformation list stacks
aws cloudformation list-stacks \
 --stack-status-filter [ CREATE_COMPLETE | UPDATE_COMPLETE | etc.. ]

# other useful commands:
# https://github.com/toddm92/aws/wiki/AWS-CLI-Cheat-Sheet
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

2 - 🖥️az

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the az command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#   █████╗ ███████╗
#  ██╔══██╗╚══███╔╝
#  ███████║  ███╔╝ 
#  ██╔══██║ ███╔╝  
#  ██║  ██║███████╗
#  ╚═╝  ╚═╝╚══════╝

# Microsoft Azure CLI 2.0
# Command-line tools for Azure

# Install Azure CLI 2.0 with one curl command.
curl -L https://aka.ms/InstallAzureCli | bash

# create a resource group named "MyResourceGroup" in the westus2 region of Azure
az group create -n MyResourceGroup -l westus2 

# create a Linux VM using the UbuntuTLS image, with two attached storage disks of 10 GB and 20 GB
az vm create -n MyLinuxVM -g MyResourceGroup --ssh-key-value $HOME/.ssh/id_rsa.pub --image UbuntuLTS --data-disk-sizes-gb 10 20

# list VMs
az vm list --output table

# list only VMs having distinct state
az vm list -d --query "[?powerState=='VM running']" --output table

# delete VM (with the name MyLinuxVM in the group MyResourceGroup)
az vm delete -g MyResourceGroup -n MyLinuxVM --yes

# Delete all VMs in a resource group
az vm delete --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

# Create an Image based on a running VM
az vm deallocate -g MyResourceGroup -n MyLinuxVM
az vm generalize -g MyResourceGroup -n MyLinuxVM
az image create --resource-group MyResourceGroup --name MyTestImage --source MyLinuxVM

# Running VM based on a VHD
az storage blob upload --account-name "${account_name}"  \
   --account-key "${account_key}" --container-name "${container_name}" --type page \
   --file "${file}" --name "${vhd_name}"
az disk create \
   --resource-group ${resource_group} \
   --name myManagedDisk \
   --source https://${account_name}.blob.core.windows.net/${container_name}/${vhd_name}

# open port
az vm open-port --resource-group MyResourceGroup --name MyLinuxVM --port 443 --priority 899

# Show storage accounts
az storage account list --output table

# Show contaniers for an account
az storage container list --account-name mystorageaccount --output table

# Show blobs in a container
az storage blob list --account-name mystorageaccount --container-name mycontainer  --output table

# list account keys
az storage account keys list  --account-name STORAGE_NAME --resource-group RESOURCE_GROUP

# Show own images
az image list --output table

# Configure default storage location
az configure --defaults location=eastus2

# Show disks
az disk list --output table

# Copy blob
az storage blob copy start \
	--source-uri 'https://md-ldh5nknx2rkz.blob.core.windows.net/jzwuuuzzapn0/abcd?sv=2017-04-17&sr=b&si=68041718-6828-4f5e-9e6e-a1b719975062&sig=XXX' \
	--account-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX== \
	--account-name destaccount \
	--destination-container vms \
	--destination-blob DESTINATION-blob.vhd

# List virtual networks
az network vnet list --output table

# List virtual networks adapters
az network nic list --output table

# List public IP addresses used by the VMs
az vm list-ip-addresses --output table

# create snapshot
az snapshot create --resource-group IC-EXASOL-001 --source vm1-disk1 -n vm1-snap1

# create SAS url for a snapshot
az snapshot grant-access --resource-group IC-EXASOL-001 --name vm1-snap1 --duration-in-seconds 36000 --query '[accessSas]' -o tsv

# attach disk
az vm disk attach --vm-name vm1 -g RESOURCE_GROUP --disk DISK1_ID

# detach disk
az vm disk detach --vm-name vm1 -g RESOURCE_GROUP --name DISK1_ID
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

3 - 🖥️azure

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the azure command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#   █████╗ ███████╗██╗   ██╗██████╗ ███████╗
#  ██╔══██╗╚══███╔╝██║   ██║██╔══██╗██╔════╝
#  ███████║  ███╔╝ ██║   ██║██████╔╝█████╗  
#  ██╔══██║ ███╔╝  ██║   ██║██╔══██╗██╔══╝  
#  ██║  ██║███████╗╚██████╔╝██║  ██║███████╗
#  ╚═╝  ╚═╝╚══════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝

# install azure-cli
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm install -g azure-cli

# This will output an url and a device code for you to use browser to login  
azure login

# This will prompt for your password in the console
azure login -u <your organizational ID email address>

# This will login in using a service principal
azure login -u "<service-principal-id>" -p "<key>" --service-principal --tenant "<tenant-id>"

# find images with Linux in name
azure vm image list | grep "Linux"

# start a new VM (in asm mode)
azure vm create ${vm_name} ${image_name} -u ${azureuser} -p "${password}" -z "Small" -e -l "West US"

# List VMs disks
azure vm disk list

# Remove all disks of VMs labeled with LABEL
for disk in $(azure vm disk list | grep LABEL | awk '{print $2}')
do 
    azure vm disk delete --blob-delete "$disk"
done

# Create storage account $myacct in location 'West US'
azure storage account create ${storage_account} --label ${storage_account} --location 'West US'

# Set default account environment variables
export AZURE_STORAGE_ACCOUNT=$account_name
export AZURE_STORAGE_ACCESS_KEY=$account_key

# Create a VM image based on a storage file
azure vm image create ${image_name} --os linux  -l 'West Europe' --blob-url https://${storage_account}.blob.core.windows.net:443/vms/${image_name}.vhd -v

# Share a file (a vm image for example) with the world:
azure storage blob sas create -a ${storage_account} --container ${container} --blob ${filename} --permissions r

# Download a file from a blob storage using curl/wget
# values of the header variables can be calculated like here: https://gist.github.com/jrwren/ff46f4ba177f042ccdc48c080c198f60
curl -v \
  -H "$x_ms_date_h" \
  -H "$x_ms_version_h" \
  -H "$authorization_header" \
"$URL"
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

4 - 🖥️cloudup

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the cloudup command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#   ██████╗██╗      ██████╗ ██╗   ██╗██████╗ ██╗   ██╗██████╗ 
#  ██╔════╝██║     ██╔═══██╗██║   ██║██╔══██╗██║   ██║██╔══██╗
#  ██║     ██║     ██║   ██║██║   ██║██║  ██║██║   ██║██████╔╝
#  ██║     ██║     ██║   ██║██║   ██║██║  ██║██║   ██║██╔═══╝ 
#  ╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝╚██████╔╝██║     
#   ╚═════╝╚══════╝ ╚═════╝  ╚═════╝ ╚═════╝  ╚═════╝ ╚═╝     

# cloudup (Bash-Snippets)
# Backs up a users github repositories to your bitbucket account.

# Backup all of a single github users repositories
cloudup -a

# Backup a single github repository
cloudup

# Backup a single github repository (supplying the name of repo as argument)
cloudup repositoryName
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░