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
| ! | |
| no enable password | |
| no aaa root | |
| ! | |
| username admin privilege 15 role network-admin secret sha512 $6$yaIYtMPIq7w2sDmS$TPd7BFXCtHsTOOCkN/15qerEdGgkopnsRLbCYugcvNNQKMxyGllCbqxTw0UrP7WmSo3mYQDfIbXUqJTj41vZv/ | |
| username admin ssh-key ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILikHrz9717ue16sUBfJG2gnh+4m8tjuIMDO15I0bwQx network-labs-devices | |
| username cvpadmin privilege 15 role network-admin secret sha512 $6$cvpadmin$KJbuVCyk6xrFZ.85XBW9dCbZCvy.5uav/ynHmWp/46CsshVsFD9Ht3TejCmdb.da/cfaox4q74uwsrG/sbcgA1 | |
| ! | |
| daemon TerminAttr | |
| exec /usr/bin/TerminAttr -cvaddr=100.68.255.2:9910 -cvauth=token,/mnt/flash/token -cvvrf=MGMT -disableaaa -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -taillogs -cvsourceintf=Management0 |
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
| # Adapted from https://stackoverflow.com/questions/35869985/datetime-datetime-is-not-json-serializable | |
| import datetime | |
| import json | |
| import boto3 | |
| def datetime_handler(x): | |
| if isinstance(x, datetime.datetime): | |
| return x.isoformat() |
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 -xe | |
| # Use with Amazon Linux 2 | |
| # Amazon Linux 2023 doesn't seem to have make-dummy-cert script | |
| yum update -y | |
| yum install -y httpd mod_ssl | |
| systemctl start httpd | |
| systemctl enable httpd | |
| usermod -a -G apache ec2-user | |
| chown -R ec2-user:apache /var/www |
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: >- | |
| AWS CloudFormation template to create a linux bastion host with a GUI that can | |
| be accessed via x2go. | |
| Parameters: | |
| KeyName: | |
| Description: Name of an existing EC2 KeyPair to enable SSH access to the instances | |
| Type: String | |
| VPC: |
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 sys | |
| from http.server import SimpleHTTPRequestHandler, HTTPServer | |
| DEFAULT_PORT=8080 | |
| class RequestHandler(SimpleHTTPRequestHandler): | |
| def do_GET(self): | |
| print(self.headers) | |
| SimpleHTTPRequestHandler.do_GET(self) |
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 example is from https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html. | |
| UserData: | |
| Fn::Base64: | |
| !Sub | | |
| #!/bin/bash -xe | |
| yum update -y aws-cfn-bootstrap | |
| /opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --configsets wordpress_install --region ${AWS::Region} | |
| /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource WebServerGroup --region ${AWS::Region} |
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
| #cloud-config | |
| # Adapted from Mathew Dugan's article at https://matduggan.com/idiot-proof-infrastructure/ | |
| package_update: true | |
| package_upgrade: true | |
| package_reboot_if_required: true | |
| groups: | |
| - docker |
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 1.0; | |
| ns junos = "http://xml.juniper.net/junos/*/junos"; | |
| ns xnm = "http://xml.juniper.net/xnm/1.1/xnm"; | |
| ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; | |
| import "../import/junos.xsl"; | |
| match / { |
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 -xe | |
| yum update -y | |
| yum install -y httpd | |
| systemctl start httpd | |
| systemctl enable httpd | |
| usermod -a -G apache ec2-user | |
| chown -R ec2-user:apache /var/www | |
| chmod 2775 /var/www | |
| find /var/www -type d -exec chmod 2775 {} \; | |
| find /var/www -type f -exec chmod 0664 {} \; |
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 | |
| domain=example.com | |
| commonname=example.com | |
| country=US | |
| state=Virginia | |
| locality=Leesburg | |
| organization=ExampleCo | |
| organizationalunit=IT |
NewerOlder