Skip to content

Instantly share code, notes, and snippets.

@si3mshady
si3mshady / generate_packet_in.py
Created June 21, 2023 01:09
Unlocking System Performance: Strategies, Tools, and Insights from SREs
import boto3
import subprocess
from time import sleep
def generate_ssh_connection_strings():
ec2 = boto3.resource('ec2') # Assuming you have configured AWS CLI or provided credentials
instances = ec2.instances.filter(
Filters=[{'Name': 'instance-state-name', 'Values': ['running']}]
)
@si3mshady
si3mshady / generate_capacity_report.py
Created June 10, 2023 14:14
Optimizing Server Capacity Planning with Python and Boto3: A Comprehensive Report on Resource Utilization for Effective Capacity Management
import boto3
from datetime import datetime, timedelta
def generate_capacity_report():
# Set the time range for the report (last 24 hours)
start_time = datetime.now() - timedelta(hours=1)
end_time = datetime.now()
# Initialize the AWS clients
cloudwatch_client = boto3.client('cloudwatch')
@andrewmcodes
andrewmcodes / iOS Shortcuts Catalog.md
Created June 11, 2021 21:47 — forked from brucebentley/iOS Shortcuts Catalog.md
This is a public resource designed to help people get started with Siri Shortcuts & the Shortcuts app. It’s made up of the Shortcuts Library, a collection of over 125+ shortcuts grouped into folders, and the Action Directory, a documentation of 125+ of the actions in the Shortcuts app used to build shortcuts.

Bruce's iOS Shortcut Catalog

Hello and welcome to my Shortcuts Catalog!

This is a public resource designed to help people get started with Siri Shortcuts and the Shortcuts app.

It’s made up of the Shortcuts Library, a collection of over 125+ shortcuts grouped into folders, and the Action Directory, a documentation of 125+ of the actions in the Shortcuts app used to build shortcuts.

Enjoy!

@vanroy86
vanroy86 / requestUnicorn.js
Created July 31, 2019 10:17 — forked from connor11528/requestUnicorn.js
Lambda function for requesting a Unicorn to come pick us up. Part of the WildRydes AWS application
randomBytes = require('crypto').randomBytes;
const AWS = require('aws-sdk');
const ddb = new AWS.DynamoDB.DocumentClient();
const fleet = [
{
Name: 'Bucephalus',
Color: 'Golden',
@vanroy86
vanroy86 / slackpost.sh
Created June 22, 2019 18:21 — forked from elnygren/slackpost.sh
Post to Slack webhook with curl & jq
#!/usr/bin/env bash
# CONFIG
URL="https://hooks.slack.com/services/..."
PAYLOAD='{
"channel": "#test",
"username": "Ghost",
"text": "no-message",
"icon_emoji": ":ghost:"
}'
@vanroy86
vanroy86 / slack_webhook_post.py
Created June 22, 2019 17:22 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@vanroy86
vanroy86 / download_flickr_image.py
Created January 31, 2019 10:18 — forked from yunjey/download_flickr_image.py
downloading images from flickr using python-flickr
# First, you should install flickrapi
# pip install flickrapi
import flickrapi
import urllib
from PIL import Image
# Flickr api access key
flickr=flickrapi.FlickrAPI('c6a2c45591d4973ff525042472446ca2', '202ffe6f387ce29b', cache=True)
@tstrohmeier
tstrohmeier / resize_ec2_ubuntu_disk.txt
Last active June 30, 2023 11:57
Resize Ubuntu disk on EC2 after changing EBS volume size
#https://askubuntu.com/questions/24027/how-can-i-resize-an-ext-root-partition-at-runtime
growpart /dev/xvda 1 # Grows the partition; note the space
resize2fs /dev/xvda1 # Grows the filesystem
@DavidWells
DavidWells / aws-lambda-redirect.js
Created June 28, 2018 20:48
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
@tstrohmeier
tstrohmeier / bitbucket-pipelines.yml
Last active September 3, 2025 10:29
AWS ECS: Script for creating a new revision of a task definition and update a service
# enable Docker for your repository
options:
docker: true
pipelines:
branches:
development:
- step:
# python image with aws-cli installed