Skip to content

Instantly share code, notes, and snippets.

View Can-Sahin's full-sized avatar

Can Sahin Can-Sahin

  • Bern, Switzerland
View GitHub Profile
@Can-Sahin
Can-Sahin / deploy-to-s3.md
Last active April 15, 2024 04:23
Script to deploy static website's build folder to AWS with necessary cache invalidations in S3 and in Cloudfront.

Automated Deployment to AWS S3

A helper script that will deploy build folder to s3 and invalidates caches of service worker, s3 and cloudfront to avoid [not updating problem]

deploy-to-s3.sh:

# Enable printing executed commands
set x
trap "exit" INT
@Can-Sahin
Can-Sahin / cognito-idtoken-cli.sh
Last active February 14, 2023 21:22
Simple shell script to obtain a IdToken from Cognito User Pool. Just like logging in.
#!/bin/bash
username="COGNITO_USER_NAME"
password="PASSWORD"
clientid="APP_CLIENT_ID"
region="eu-west-1"
aws_profile="AWS_CLI_PROFILE"
response_json=""
json_field='IdToken'
@Can-Sahin
Can-Sahin / macosx_starter.md
Last active July 1, 2019 07:56
Personal list of packages and apps that is good be installed or be noted down somewhere
@Can-Sahin
Can-Sahin / download-youtube-interval.sh
Created December 2, 2019 09:33
Download specific inverval (range) of youtube videos
ffmpeg -ss 00:00:00 -i $(youtube-dl -f best -g 'YOUTUBE_URL') -t 00:01:00 -c copy DOWNLOAD_NAME.mp4
## prerequisite -> ffmpeg, youtube-dl
## installation commands:
# brew install ffmpeg
# brew install youtube-dl