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
| // Enable GuardDuty delegated admin | |
| if (enableGuardDuty) { | |
| const guardDutyPolicy = cr.AwsCustomResourcePolicy.fromStatements([ | |
| // from https://docs.aws.amazon.com/guardduty/latest/ug/organizations_permissions.html | |
| new iam.PolicyStatement({ | |
| actions: [ | |
| 'guardduty:EnableOrganizationAdminAccount', | |
| 'guardduty:ListOrganizationAdminAccounts', | |
| 'guardduty:DisableOrganizationAdminAccount', | |
| ], |
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
| #!/bin/bash | |
| # Specify the desired volume size in GiB as a command line argument. If not specified, default to 20 GiB. | |
| SIZE=${1:-20} | |
| # Get the ID of the environment host Amazon EC2 instance. | |
| TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60") | |
| INSTANCEID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/instance-id 2> /dev/null) | |
| REGION=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/placement/region 2> /dev/null) |
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
| #!/bin/bash | |
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # SPDX-License-Identifier: MIT-0 | |
| set -euo pipefail | |
| # This script is invoked in /etc/cron.d/c9-automatic-shutdown | |
| # which uses the full path to the file: /home/<username>/.c9/stop-if-inactive.sh | |
| # Parse the username from the file path, which can vary based on the Cloud9's OS. | |
| USER=$(echo $0 | cut -d'/' -f3) | |
| CONFIG=$(cat /home/$USER/.c9/autoshutdown-configuration) |
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
| # Using s3 copy with multipart uploads for efficient file merging | |
| # limitation: min part size is 5MB | |
| import boto3 | |
| from datetime import datetime | |
| client = boto3.client('s3') | |
| now = datetime.now() | |
| timestamp = now.strftime("%Y%m%d_%H%M%S") | |
| bucket = "bucket-testing-dev" |
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
| echo -e "HTTP/1.1 200 OK\r\n$(date)\r\n\r\n<h1>hello world from $(hostname) on $(date)</h1>" | sudo ncat -vl --ssl 443 |
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' | |
| Metadata: | |
| License: Apache-2.0 | |
| Description: '@Author: Sanjay Garje. AWS CloudFormation Sample Template SageMaker NotebookInstance: This template demonstrates | |
| the creation of a SageMaker NotebookInstance with encryption. You will be billed for the AWS resources used if you create a stack from | |
| this template.' | |
| Parameters: | |
| NotebookInstanceName: | |
| AllowedPattern: '[A-Za-z0-9-]{1,63}' | |
| ConstraintDescription: Maximum of 63 alphanumeric characters. Can include hyphens |
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
| // Job == agent-build_pipeline | |
| // build agent for linux/windows | |
| currentBuild.description = env.TAG | |
| def WORKER='worker-large' | |
| def OS = [ 'redhat', 'debian' ] | |
| def ARCH = [ '64' ] | |
| def pipeline_branches = [:] | |
| def JB='./jenkins/build' | |
| def jbuild = { sh "bash ${JB}/build.sh" } | |
| def provision = { sh "bash ${JB}/provision.sh" } |
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
| source ~/ssh-agent.sh | |
| sshagent_init |
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 python3 | |
| import boto3 | |
| import json | |
| import uuid | |
| import sys | |
| from time import sleep | |
| import backoff | |
| from botocore import exceptions | |
| if len(sys.argv) < 2 : |
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" | |
| Description: Amazon EKS - Node Group Role | |
| Resources: | |
| NodeInstanceRole: | |
| Type: "AWS::IAM::Role" | |
| Properties: | |
| AssumeRolePolicyDocument: | |
| Version: "2012-10-17" |
NewerOlder