Skip to content

Instantly share code, notes, and snippets.

@tteskac
tteskac / tm_hide_aws_regions.js
Last active July 10, 2022 20:23 — forked from wmathes/tm_hide_aws_regions.js
TamperMonkey: Hide AWS regions from dropdown menu.
// ==UserScript==
// @name ScreenCloud AWS: region dropdown cleanup
// @namespace http://tampermonkey.net/
// @version 0.2
// @author wolf@screencloud.io
// @include https://*.console.aws.amazon.com/*
// @grant none
// ==/UserScript==
(function() {
@tteskac
tteskac / simple-ec2-scheduler.js
Last active March 21, 2024 15:35
Simple EC2 scheduler with AWS Lambda function (start during working hours only, stop otherwise)
// Simple EC2 scheduler with AWS Lambda (NodeJs) function (start during working hours only, stop otherwise).
// https://gist.github.com/tteskac/0ab34617652433d70b8fc59eb444a85f
//
// The example code below checks if specific EC2 instance should be running or be stopped to save money.
// This is extremely useful e.g. for development/testing instances to be running only during working hours.
// Below in the code it is specified to run it Monday-Friday between 5-16 (UTC).
// In addition, it will not shutdown the instance if the CPU usage is above idle state,
// e.g. if someone is still using it a bit more outside working hours or some long processing is still happening.
// Use EventBridge (CloudWatch Events) to trigger this lambda function every hour.
//