Skip to content

Instantly share code, notes, and snippets.

@aroder
aroder / ssh-deploy-key-wrapper.sh
Last active January 1, 2021 00:37 — forked from mpdude/ssh-deploy-key-wrapper.sh
Wrapper around `ssh` to pick the right one from several GitHub deploy keys
#!/bin/bash
regex_repo_name="\/([^\/]*\.git)"
if [[ ${!#} =~ $regex_repo_name ]]
then
repo_name="${BASH_REMATCH[1]}"
else
echo "Could not find a repo name in ${!#}"
fi

Datateer platform architecture

graph TD
    user
    subgraph aws[AWS]
      subgraph s3[S3 & CloudFront]
        web[web app]
      end
 subgraph ecs[ECS]
@aroder
aroder / s3cmdclearfiles
Created September 12, 2022 22:26 — forked from JProffitt71/s3cmdclearfiles
Uses s3cmd to manually remove files older than specified date (##d|m|y) in a specified bucket
#!/bin/bash
# Usage: ./s3cmdclearfiles "bucketname" "30d"
s3cmd ls s3://$1 | grep " DIR " -v | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -j -f "%Y-%m-%d %H:%M" "$createDate" +%s`
olderThan=`date -j -v-$2 +%s`
if [[ $createDate -lt $olderThan ]]