This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
contract Structs { | |
struct Car { | |
string model; | |
uint year; | |
address owner; | |
} |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
contract Mapping_loop { | |
mapping(address => uint) public balances; | |
mapping(address => bool) public inserted; | |
address[] public keys; | |
function set(address _key, uint _val) external { |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
contract Ownable { | |
address public owner; | |
uint public counter; | |
uint public counterPublic; | |
constructor () { |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
contract DataTypes { | |
bool public boo = true; | |
// unit is only for positive integers | |
uint8 public u8 = 1; | |
uint16 public u16 = 14; | |
uint256 public u256 = 476; |
This file contains 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 boto3 | |
import time | |
##AWS | |
REGION="us-east-1" | |
PROFILE="default" | |
##AMI | |
AMIS=[ | |
{"os": "centos7", "ami": "ami-0affd4508a5d2481b", "distro":"centos"}, |
This file contains 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 | |
curl https://ipinfo.io/$1 |
This file contains 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
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n'$(date);done |
This file contains 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 | |
aws ssm get-parameters --names /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 --region us-east-1 |
This file contains 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} | |
# Install the jq command-line JSON processor. | |
sudo yum -y install jq | |
# Get the ID of the envrionment host Amazon EC2 instance. | |
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data//instance-id) |
This file contains 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
{ | |
"agent": { | |
"metrics_collection_interval": 60, | |
"run_as_user": "root" | |
}, | |
"logs": { | |
"logs_collected": { | |
"files": { | |
"collect_list": [ | |
{ |
NewerOlder