Skip to content

Instantly share code, notes, and snippets.

View StrandedKitty's full-sized avatar
💙

StrandedKitty

💙
View GitHub Profile
@StrandedKitty
StrandedKitty / delete_all_object_versions_expect_recent.sh
Created June 13, 2023 17:58
Delete all outdated versions of an object in S3
#!/bin/bash
S3_ENDPOINT="https://ams3.digitaloceanspaces.com"
S3_BUCKET="osm-tiles"
S3_OBJECT_KEY="vector/planet.mbtiles"
# Retrieve the list of all versions of the S3 object
versions=$(aws s3api list-object-versions --endpoint $S3_ENDPOINT --bucket $S3_BUCKET --prefix $S3_OBJECT_KEY --query 'Versions[].VersionId' --output text)
# Get the latest version ID
@StrandedKitty
StrandedKitty / planetiler.sh
Last active August 23, 2023 13:14
streets_gl_planetiler
#!/bin/sh
echo "Starting planetiler.sh..."
sudo -i -u ubuntu bash << EOF
cd ~/planetiler
git pull
sudo mkdir /mnt
cd /mnt
sudo mkdir big