Skip to content

Instantly share code, notes, and snippets.

@MyKEms
MyKEms / Exchange_Sync.applescript
Created February 1, 2024 12:24
AppleScript to copy all of the events from an Exchange calendar to an iCloud calendar via calendar.app.
tell application "Calendar"
-- Execute this script first manually via osascript Exchange_Sync.applescript to allow all security pop-ups. Make sure you use empty destination calendar because it will be wiped each run!
-- Don't forget to grant full calendar rights from System settings > Privacy & Security > Calendars > App > Options > Full calendar access
-- Schedule it via crontab -e and paste: "0 9,14 * * * osascript /Users/user.name/macOS_Cronjobs/Exchange_Sync.applescript > /Users/user.name/macOS_Cronjobs/cronjob.log"
-- Get the current date and time
set currentDate to current date
-- Set the start date range to 7 days ago
set startDateRange to currentDate - (7 * days)
-- Set the end date range to 30 days in the future
set endDateRange to currentDate + (30 * days)
@MyKEms
MyKEms / simplelogin_bulk_alias_creation.sh
Created November 14, 2023 08:46
SimpleLogin.io Bulk Email Alias Creation Script
# Documentation: https://github.com/simple-login/app/blob/master/docs/api.md#post-apiv3aliascustomnew
# This script facilitates the bulk creation of email aliases on SimpleLogin.io by automating the API calls needed for each alias. It ensures compliance with rate limits and handles the retrieval of domain-specific signed_suffixes for each alias creation request.
# Author: https://github.com/MyKEms
#!/bin/bash
# Adjust variables
api_key="API_TOKEN"
domain="contoso.com"
@MyKEms
MyKEms / Convert_RSA_to_PEM_macOS
Created December 28, 2021 11:10
Convert RSA to PEM on macOS
brew install putty
puttygen id_rsa -O private-openssh -o id_rsa.pem
@MyKEms
MyKEms / Calculate_Pub_SSH_Key_Fingerprint
Last active April 26, 2021 06:57
Calculate Public SSH Key fingerprint (GitHub)
# SHA256:
ssh-keygen -lf ~/.ssh/id_rsa.pub
# MD5:
ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub
# Calculate from known_hosts/authorized_keys:
find /etc/ssh /home/*/.ssh /Users/*/.ssh -name '*.pub' -o -name 'authorized_keys' -o -name 'known_hosts'
@MyKEms
MyKEms / Remove-DockerImage.ps1
Last active September 23, 2020 06:48
Artifactory docker cleanup script (max unique tags + exclude tags)
# This script will keep defined number of max unique tags, exclude specific tags and remove the rest.
# Compatible with PowerShell Core 6+
# Author: https://github.com/MyKEms
#Settings
[string]$userName = "ArtifactoryUsername"
[string]$userPassword = "ArtifactoryUserPassword/Token"
$max_unique_tags = 17
$exclude_tags = "latest|mater"
$repository = "docker-repository"
@MyKEms
MyKEms / .zshrc
Created September 14, 2020 11:16 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@MyKEms
MyKEms / Get-DDBScan.ps1
Last active March 22, 2020 12:07
Use AWS CLI to retreive all items from DynamoDB via PowerShell
function Get-DDBScan ($table) {
$Items = aws dynamodb scan --table-name $table | ConvertFrom-Json
$Items.items
}
#Usage
Get-DDBScan -table Music
#Depends on - https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
#Recommended to read - https://aws-cli-eq-pwsh.shibata.tech/dynamodb/