This page was created as a tribute to Albert Einstein.
A Pen by Danny Spell on CodePen.
# S3 buckets are global | |
# If you want to know the buckets for a specific region, you need to specify the bucket endpoint (region) | |
# to use the bucket-region parameter. | |
aws s3api list-buckets --region "us-west-2" \ | |
--bucket-region "us-west-2" \ | |
--query "Buckets[].[CreationDate,Name]" \ | |
--output text |
# Add this to .zshrc or .zprofile | |
# Function to display battery percentage with a fuel gauge | |
bat() { | |
# Get the battery percentage | |
local CHARGE | |
CHARGE=$(system_profiler SPPowerDataType -json 2>/dev/null | jq -r '.SPPowerDataType[] | select(._name == "spbattery_information").sppower_battery_charge_info.sppower_battery_state_of_charge' 2>/dev/null) | |
# Validate input | |
if [[ ! $CHARGE =~ '^[0-9]+$' ]]; then | |
echo "Error: Could not retrieve valid battery percentage" |
# Prerequisit: | |
# Aggregate indexing to us-east-1 for all of the regions enabled for the account to us-east-1, | |
# or whatever region is standard for your organization | |
# Details can be found here: | |
# https://aws.amazon.com/blogs/aws/introducing-aws-resource-explorer-quickly-find-resources-in-your-aws-account/ | |
# This list can be huge, thus dumping to a file where it can be viewed through an editor or a utility such as 'less'. | |
aws resource-explorer-2 list-resources --region "us-east-1" \ |
This page was created as a tribute to Albert Einstein.
A Pen by Danny Spell on CodePen.