Formulas for bytes and duration

Capturing a couple formulas for future reference. I was using restic backup stats and wanted to convert the time a job ran into hours and minutes. Also convert bytes process to TB. bytes to TB example: total_bytes_processed: 5773378 / 1000000000000 == 1.502888851889 duration to HH:MM example using libre calc:total_duration: 15870.197288027…

restic set tags

In a follow up to previous post https://blog.ls-al.com/restic-create-backup-and-set-tag-with-date-logic here is some code I used to set tags on old snapshots to comply with my new tagging and pruning. # cat backup-tags-set.sh #!/bin/bash create_tag () { tag=daily if [ $(date -d $1 +%a) == Sun ]; then tag=weekly ; fi if…

AWS Cloudwatch Cron

I was trying to schedule a once a week snapshot of a EBS volume and getting “Parameter ScheduleExpression is not valid”. Turns out I missed something small. If you schedule using a cron expression note this important requirement: One of the day-of-month or day-of-week values must be a question mark…

Oracle OCI CLI Query

Some bash snippets of using –query, jq and interacting with Bash to manipulate into variables. Collect boot volume’s id Collect instance ocid Stop instance and collect the id (or whatever you need from the json) Collect the work-request-id to monitor in a loop after I export a custom image to…

SHIPS Password Rotation

As explained on the website “unique and rotated local super user or administrator passwords for environments where it is not possible or not appropriate to disable these local accounts”. I tested as a proof of concept how to: setup a SHIPS server on CentOS7 configure SHIPS folder and ACL’s for…