Skip to content

Instantly share code, notes, and snippets.

View CodeFreezr's full-sized avatar

CodeFreezr CodeFreezr

View GitHub Profile
@CodeFreezr
CodeFreezr / ffmpeg-cheatsheet.md
Created September 15, 2022 20:50 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@CodeFreezr
CodeFreezr / helm-cheatsheet.md
Created May 8, 2021 16:19 — forked from tuannvm/cka.md
#Helm #Kubernetes #cheatsheet, happy helming!
@CodeFreezr
CodeFreezr / ExportKindle.js
Created May 18, 2020 22:13 — forked from jkubecki/ExportKindle.js
Amazon Kindle Export
// The following data should be run in the console while viewing the page https://read.amazon.com/
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension
var db = openDatabase('K4W', '2', 'thedatabase', 1024 * 1024);
getAmazonCsv = function() {
// Set header for CSV export line - change this if you change the fields used
var csvData = "ASIN,Title,Authors,PurchaseDate\n";
db.transaction(function(tx) {
@CodeFreezr
CodeFreezr / get-aws-s3-size.sh
Created September 24, 2019 17:27
List all my S3 buckets and their size.
for bucket in $(aws s3api list-buckets --query "Buckets[].Name" --output text); do aws cloudwatch get-metric-statistics --namespace AWS/S3 --metric-name BucketSizeBytes --dimensions Name=BucketName,Value=$bucket Name=StorageType,Value=StandardStorage --start-time $(date --iso-8601)T00:00 --end-time $(date --iso-8601)T23:59 --period 86400 --statistic Maximum | echo $bucket: $(numfmt --to si $(jq -r ".Datapoints[0].Maximum // 0")); done;
@CodeFreezr
CodeFreezr / get-aws-snapshots-per-volume.sh
Created September 24, 2019 17:23
List all Snapshots by their Volumes Count and Size.
aws ec2 describe-snapshots --owner-ids self | jq '.Snapshots | [ group_by(.VolumeId)[] | { (.[0].VolumeId): { "count": (.[] | length), "size": ([.[].VolumeSize] | add) } } ] | add'
@CodeFreezr
CodeFreezr / get-aws-snapshots-volumesize.sh
Last active September 24, 2019 17:21
Get Total-Volume-Sizes of all Snapshots together
aws ec2 describe-snapshots --owner-ids self | jq '[.Snapshots[].VolumeSize] | add'
@CodeFreezr
CodeFreezr / get-aws-count-snapshots.sh
Created September 24, 2019 17:18
Counts the number of snapshots
aws ec2 describe-snapshots --owner-ids self | jq '.Snapshots | length'
@CodeFreezr
CodeFreezr / get-aws-count-ebs-gb.sh
Created September 24, 2019 17:17
Count the ebs volumes and the amount of Gigabytes per state.
aws ec2 describe-volumes | jq -r '.Volumes | [ group_by(.State)[] | { (.[0].State): ([.[].Size] | add) } ] | add'
@CodeFreezr
CodeFreezr / get-aws-ec2-by-stack.sh
Created September 24, 2019 17:14
List all EC2 Instance which are created by a CF-Stack (long running)
for stack in $(aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE | jq -r '.StackSummaries[].StackName'); do aws cloudformation describe-stack-resources --stack-name $stack | jq -r '.StackResources[] | select (.ResourceType=="AWS::EC2::Instance")|.PhysicalResourceId'; done;
@CodeFreezr
CodeFreezr / get-aws-count-stacks-by-state.sh
Created September 24, 2019 17:12
Counts Cloudformation Stacks by Status
aws cloudformation list-stacks | jq '.StackSummaries | [ group_by(.StackStatus)[] | { "status": .[0].StackStatus, "count": (. | length) }]'