diskutil list
Get the EC2 instance type from within an EC2 instance.
Modified from Getting the AWS instance ID from within the EC2 instance.
curl https://169.254.169.254/latest/meta-data/instance-type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get a list of GPUs in a system | |
# | |
# Useful nvidia-smi Queries | |
# https://nvidia.custhelp.com/app/answers/detail/a_id/3751/~/useful-nvidia-smi-queries | |
# Get GPU names as a bach array, replace spaces with underscores | |
gpu_names=($(nvidia-smi --query-gpu=gpu_name --format=csv,noheader | tr -s ' ' '_')) | |
for name in "${gpu_names[@]}" |
General notes on using and scripting Bash.
Here's a nice article on the topic of argument parsing in Bash: Bash: Argument Parsing
From the article:
NewerOlder