Skip to content

Instantly share code, notes, and snippets.

@Vuzee01
Vuzee01 / gist:96e64ee0a1628fb5fd56c0b15de6f5e8
Created March 1, 2024 08:23
How to synchronize files between AWS S3 buckets using AWS CLI
# Synchronize files between two buckets
aws s3 sync s3://source-bucket s3://target-bucket
# Make synchronized files publicly available
aws s3 sync s3://source-bucket s3://target-bucket --acl public-read
# Or private
aws s3 sync s3://source-bucket s3://target-bucket --acl private
@Vuzee01
Vuzee01 / gist:95daac2348a79ca0775c4e3bd55a4431
Created March 1, 2024 08:22
Assuming AWS IAM role using AWS CLI
aws sts assume-role \
--role-arn "arn:aws:iam::123456789012:role/MyRole" \
--role-session-name "MySession" \
--duration-seconds 3600 # one hour, optional
@Vuzee01
Vuzee01 / gist:43b2cefa3360e8c333bfdf5f8e46f20d
Created March 1, 2024 08:22
How to get all S3 buckets using AWS CLI
aws s3api list-buckets --query 'Buckets[].Name' --output text
@Vuzee01
Vuzee01 / gh-remove.sh
Created October 19, 2023 12:23
This Bash script is designed to delete a specified number of the latest workflow runs for a GitHub repository using the GitHub CLI (gh)
#!/usr/bin/env bash
set -o nounset
set -o errtrace
set -o pipefail
IFS=$'\n\t'
# Input vars
REPO_NAME=${1}
@Vuzee01
Vuzee01 / install.sh
Last active August 4, 2020 09:47
Percona noninteractive install
wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb &&
sudo dpkg -i percona-release_latest.generic_all.deb &&
sudo percona-release enable ps-80 release &&
sudo apt-get update &&
sudo apt install debconf-utils &&
export DEBIAN_FRONTEND=noninteractive &&
echo "percona-xtradb-cluster-server-5.7 percona-xtradb-cluster-server-5.7/root-pass password randompassword" | debconf-set-selections &&
echo "percona-xtradb-cluster-server-5.7 percona-xtradb-cluster-server-5.7/re-root-pass password randompassword" | debconf-set-selections &&
sudo apt update &&
sudo apt-get install -y percona-xtradb-cluster-57