Skip to content

Instantly share code, notes, and snippets.

View gcagle3's full-sized avatar

gcagle3

View GitHub Profile
@gcagle3
gcagle3 / lambda_boto3_stop_ec2_instances.py
Created May 1, 2021 03:32
AWS - Simple Lambda (python/boto3) function to stop EC2 instances
import boto3
def lambda_handler(event, context):
# Get list of regions
ec2_client = boto3.client('ec2')
regions = [region['RegionName']
for region in ec2_client.describe_regions()['Regions']]
# Iterate over each region
@gcagle3
gcagle3 / boto3_stop_instances_without_tag.py
Last active May 1, 2021 03:35
Boto3 Python Script to Stop Instances Unless Tagged "KEEP:KEEP"
import boto3
# Get list of regions
ec2_client = boto3.client('ec2')
regions = [region['RegionName']
for region in ec2_client.describe_regions()['Regions']]
# Iterate over each region
for region in regions:
ec2 = boto3.resource('ec2', region_name=region)
@gcagle3
gcagle3 / invertingBinaryTreeInPython.py
Last active October 26, 2021 16:28
Inverting Binary Tree in Python
#!/usr/bin/env python3
class Node():
"""
Node class used to build a binary tree
"""
def __init__(self, val):
self.val = val
self.left = None
self.right = None
@gcagle3
gcagle3 / bitbucket-dark.css
Created February 4, 2022 21:21
CSS: bitbucket.org dark theme
/*bitbucket.org dark css theme*/
body, aside {
background: #222 !important;
background-color: #222 !important;
color: #bbb !important;
}
h1, h2, h3, h4, h5, span {
background-color: transparent !important;
color: #FFC963 !important;
Key Purpose
fn+1, 2 or 3 Hold 3 seconds for Bluetooth pairing or press to change to paired device.
fn+S+O Battery Saver: Hold for 4 seconds to turn backlight off after 10 minutes idle on Bluetooth mode.
fn+X+L (Windows only) Hold for 4 seconds to switch F1-F12 keys from multimedia keys to standard function keys.
fn+right,left arrows (RGB Model only) Change color of backlight.
fn+backlight Turns backlight on and off.
fn+I+D Inverts Del/Insert bahavior. Hold 3 seconds to swap del, fn+del to insert to insert, fn+del to delete.
fn+Caps+P Toggle Caps backlight indicator. Hold 3 seconds to toggle betwen Caps Lock being lit when on or following the backlight pattern.
fn+B Hold to show battery level suing the backlight, at 70%+ the whole keybord is lit, 70~30% the first row will be off, 30%- the first two rows will be off.