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
| 1. Create a file: /etc/wsl.conf. | |
| 2. Put the following lines in the file in order to ensure the your DNS changes do not get blown away | |
| [network] | |
| generateResolvConf = false | |
| 3. In a cmd window, run wsl --shutdown | |
| 4. Restart WSL2 | |
| 5. Create a file: /etc/resolv.conf. If it exists, replace existing one with this new file. | |
| 6. Put the following line in the file |
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
| from __future__ import unicode_literals | |
| import logging | |
| import json | |
| logger = logging.getLogger(__name__) | |
| logging.getLogger().setLevel(logging.INFO) | |
| class PythonObjectEncoder(json.JSONEncoder): | |
| """Custom JSON Encoder that allows encoding of un-serializable objects |
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
| {"lastUpload":"2021-03-10T14:36:42.765Z","extensionVersion":"v3.4.3"} |
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 | |
| yum install -y aws-cli | |
| cd /home/ec2-user/ | |
| aws s3 cp 's3://aws-codedeploy-us-east-1/latest/codedeploy-agent.noarch.rpm' . --region us-east-1 | |
| yum -y install codedeploy-agent.noarch.rpm |
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
| <powershell> | |
| iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
| choco install python -y | |
| (new-object net.webclient).DownloadFile('https://s3.amazonaws.com/aws-cli/AWSCLI64.msi','c:\AWSCLI64.msi') | |
| msiexec.exe /i 'C:\AWSCLI64.msi' /qn | |
| </powershell> |
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 | |
| yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https -y | |
| curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O | |
| unzip CloudWatchMonitoringScripts-1.2.1.zip | |
| rm CloudWatchMonitoringScripts-1.2.1.zip |
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
| var AWS = require('aws-sdk'); | |
| exports.handler = function(event, context) { | |
| var ec2 = new AWS.EC2({region: 'us-east-1'}); | |
| ec2.startInstances({InstanceIds : ['i-0114833f8ffc9151c'] },function (err, data) { | |
| if (err) console.log(err, err.stack); | |
| else console.log(data); | |
| context.done(err,data); | |
| }); | |
| }; |