Skip to content

Instantly share code, notes, and snippets.

View koleror's full-sized avatar

Hugo Defrance koleror

  • Epic games
  • Paris
View GitHub Profile
@koleror
koleror / sleep_timer.sh
Last active February 16, 2025 11:06
Sleep timer - Auto pause music after given amount of time
#!/bin/bash -e
#############
# CONSTANTS #
#############
DIM_SCREEN_DELAY=5
FADE_OUT_STEP=3
MUSIC_APPLICATION_NAME="Spotify"
FADE_OUT_LIMIT=15
@koleror
koleror / cleanup_lambda_versions.py
Last active June 19, 2020 15:05
Cleanup lambda functions versions
import boto3
client = boto3.client('lambda')
def _clean_function(function_data, dry_run, max_versions):
skipped_items = 0
while True: # list_versions_by_function returns up to 50 versions per call
versions = client.list_versions_by_function(
FunctionName=function_data['FunctionArn']
@koleror
koleror / migrate_s3.py
Last active March 5, 2018 14:53
Migrate AWS S3 bucket content to another bucket, keeping metadatas
import boto3
old_access_key_id = '***'
old_secret_access_key = '***'
old_bucket_name = '***'
new_access_key_id = '***'
new_secret_access_key = '***'
new_bucket_name = '***'