chore(dblab): dump findings

This commit is contained in:
Michele Cereda
2025-08-25 23:06:41 +02:00
parent e460a4c988
commit 32018fae3e
4 changed files with 346 additions and 16 deletions

View File

@@ -1,17 +1,20 @@
#!/usr/bin/env fish
# Get Name and Description of all AMIs by Amazon for arm64 that are in the 'available' state
# and which name starts for 'al2023-ami-'
# Get Name and Description of all AMIs matching the filters
aws ec2 describe-images --output 'yaml' \
--owners 'amazon' \
--filters \
'Name=architecture,Values=['arm64']' \
'Name=state,Values=['available']' \
--query '
Images[]
.{"Name":@.Name,"Description":@.Description}
' \
| yq '.[]|select(.Name|test("^al2023-ami-"))' -
"Name=state,Values=['available']" \
"Name=architecture,Values=['arm64']" \
"Name=name,Values=['al2023-ami-*']" \
--query 'Images[].{"Name":@.Name,"Description":@.Description}'
aws ec2 describe-images --output 'yaml' \
--owners 'amazon' 'aws-marketplace' \
--filters \
"Name=state,Values=['available']" \
"Name=architecture,Values=['x86_64']" \
"Name=name,Values=['ubuntu/images/*-noble-*']" \
--query 'Images[].{"Name":@.Name,"Description":@.Description}'
# Show information about AMIs
aws ec2 describe-images --image-ids 'ami-01234567890abcdef'
@@ -125,8 +128,8 @@ aws ec2 describe-instances --instance-ids 'i-0123456789abcdef0' --output 'json'
# Start stopped instances
# Requires the 'ec2:StartInstances' permission for the instances
# Also requires the 'kms:GenerateDataKeyWithoutPlaintext' and 'kms:CreateGrant' permissions for the keys used by the
# instances, if any.
# See https://docs.aws.amazon.com/ebs/latest/userguide/how-ebs-encryption-works.html#how-ebs-encryption-works-encrypted-snapshot
# instances, if any.
# See https://docs.aws.amazon.com/ebs/latest/userguide/how-ebs-encryption-works.html#how-ebs-encryption-works-encrypted-snapshot
aws ec2 start-instances --instance-ids 'i-0123456789abcdef0'
# Stop started instances

13
snippets/selinux.fish Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env fish
# install tools
apt install 'policycoreutils'
# check status
getenforce
sestatus
# change enforcement
# requires a reboot to take place
sed -i'.bak' 's/^SELINUX\s*=\s*[a-z]*/SELINUX=permissive/' '/etc/selinux/config'
sed -i'.bak' -E 's/^(SELINUX\s*=\s*)[a-z]*/\1disabled/' '/etc/selinux/config'

View File

@@ -61,7 +61,7 @@ zdb -S 'rpool'
###
# File Systems
# --------------------------------------
# data set = file system
# dataset = file system
###
# List available datasets
@@ -87,3 +87,7 @@ zfs snapshot 'vault/good_memories@2024-12-31'
# Check key parameters are fine
zfs get -r checksum,compression,readonly,canmount 'tank'
# Delete datasets
zfs destroy 'vault/good_memories@2024-12-31' # snapshot
zfs destroy 'vault/good_memories' # filesystem