AWS EC2 log userdata output to cloudwatch logs

I’m doing pre-processing tasks using EC2. I execute shell commands using the userdata variable. The last line of my userdata has sudo shutdown now -h. So the instance gets terminated automatically once the pre-processing task completed. This is how my code looks like. import boto3 userdata = ”’#!/bin/bash pip3 install boto3 pandas scikit-learn aws s3… Read More AWS EC2 log userdata output to cloudwatch logs

When a laptop running Ubuntu 20 does not have battery, can you simply turn off the power supply to shut it down?

If there is a difference, can you rather put the laptop in sleep and then turn off the power? What if you close all the running applications and then shut-down? Would these measures ensure the software/hardware of the laptop are not disrupted by the sudden power-off? What difference could it possibly make compared to shut-down?… Read More When a laptop running Ubuntu 20 does not have battery, can you simply turn off the power supply to shut it down?