This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.8" | |
| services: | |
| changedetection: | |
| container_name: changedetection | |
| hostname: changedetection | |
| image: ghcr.io/dgtlmoon/changedetection.io:latest | |
| environment: | |
| - TZ=America/Los_Angeles | |
| - PLAYWRIGHT_DRIVER_URL=ws://playwright-chrome:3000/?stealth=1&--disable-web-security=true&token=<redacted> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this Code will help to schedule stop the RDS databasrs using Lambda | |
| # Yesh | |
| # Version -- 2.0 | |
| # Adapted from https://aws.amazon.com/blogs/database/schedule-amazon-rds-stop-and-start-using-aws-lambda/ | |
| import boto3 | |
| import os | |
| import sys | |
| import time | |
| from datetime import datetime, timezone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Handler } from 'aws-lambda'; | |
| import * as AWS from 'aws-sdk'; | |
| const rds = new AWS.RDS(); | |
| enum InstanceStatus { | |
| STOPPED = 'stopped', | |
| AVAILABLE = 'available', | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fetch from 'node-fetch'; | |
| /** | |
| * @description Get flags from AWS AppConfig. | |
| * | |
| * Flags and configuration is handled manually in the GUI. | |
| * | |
| * Environment variables and such config are still done in `serverless.yml` as usual. | |
| * | |
| * @see https://aws.amazon.com/blogs/mt/using-aws-appconfig-feature-flags/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| description: |- | |
| ### EC2 stopper by tag | |
| Stop EC2 instances by tag | |
| schemaVersion: '0.3' | |
| mainSteps: | |
| - name: getInstancesByTag | |
| action: 'aws:executeAwsApi' | |
| outputs: | |
| - Name: InstanceIds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Checks if an image tag exists in the repo | |
| def check_tag_exists(tag, repo): | |
| ecr_client = boto3.client('ecr', region_name='us-east-1') | |
| response = ecr_client.describe_images(repositoryName=repo, filter={'tagStatus': 'TAGGED'}) | |
| for i in response['imageDetails']: | |
| if tag in i['imageTags']: | |
| return True | |
| return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # -*- coding: utf-8 -*- | |
| # vim: set ft=sh et ts=4 sw=4 sts=4: | |
| # ================================================================================================= | |
| # | |
| # Copyright 2022 Serhat Teker <[email protected]> | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { BatchExecuteStatementCommand, BatchExecuteStatementCommandInput, BatchGetCommand, BatchGetCommandInput, DeleteCommand, DeleteCommandInput, ExecuteStatementCommand, ExecuteStatementCommandInput, ExecuteTransactionCommand, ExecuteTransactionCommandInput, GetCommand, GetCommandInput, PutCommand, PutCommandInput, QueryCommand, QueryCommandInput, ScanCommand, ScanCommandInput, UpdateCommand, UpdateCommandInput } from "@aws-sdk/lib-dynamodb"; | |
| import { Logger } from "@nestjs/common"; | |
| import { DbClientsInstance } from "./db.clients"; | |
| class DbDataOps { | |
| private static instance: DbDataOps; | |
| private constructor() { | |
| console.log('DbDataOps init'); | |
| if(DbDataOps.instance) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Helper to filter out the empty properties(null, undefined, [], or '') from the given object | |
| * | |
| * @param {{}} obj | |
| * @returns {{}} | |
| */ | |
| const removeEmptyProps = (obj) => { | |
| return Object.keys(obj) | |
| // remove params that are empty | |
| .filter(key => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: 2010-09-09 | |
| # See https://github.com/aws-actions/configure-aws-credentials#sample-iam-role-cloudformation-template | |
| Parameters: | |
| GitHubOrg: | |
| Type: String | |
| RepositoryName: | |
| Type: String |