Skip to content

Instantly share code, notes, and snippets.

View Donnie's full-sized avatar

Donnie Ashok Donnie

View GitHub Profile
@Donnie
Donnie / weekend.py
Last active April 12, 2024 09:41
A script to calculate the distribution of weekdays for each date (1st to 31st) for every month in 2024. Find out how often each date falls on a Saturday or Sunday. This is to avoid Revolut extra charges for weekends.
import calendar
def count_weekends(year):
# Dictionary to hold the count of Saturdays and Sundays for each date
weekend_counts = {date: 0 for date in range(1, 32)}
# Process each month and each date in the month
for month in range(1, 13):
# Get the number of days in the month
num_days = calendar.monthrange(year, month)[1]
@Donnie
Donnie / Readme.md
Last active August 3, 2022 08:52
AWS MFA Automation through 1Password

Requirements

  1. 1password OP CLI
  2. AWS CLI
  3. JQ

Setup

  1. Setup your AWS account on 1password with TOTP 1password
  2. Configure AWS locally awsprofile