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
Minimal requirements: | |
64bit CPU with virtualization support | |
128 MB or more RAM for the CHR instance | |
128 MB disk space for the CHR virtual hard drive | |
You can use Elastic Compute Engine Starter Package Plan/ Entry Level Using Ubuntu 16.04 64bit | |
1. Open Putty, Login to your ECS using IP address root. (SSH port 22) | |
2. Paste this script to your terminal | |
wget https://download2.mikrotik.com/routeros/6.40.5/chr-6.40.5.img.zip -O chr.img.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
const fs = require('fs'); | |
async function example() { | |
const client = new ftp.Client() | |
client.ftp.verbose = true | |
try { | |
const secureOptions = { | |
// Necessary only if the server requires client certificate authentication. | |
key: fs.readFileSync('client-key.pem'), | |
cert: fs.readFileSync('client-cert.pem'), |
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
<img src="data:image/png;base64,xxxxx"/> | |
xxxxx is imgbase64 | |
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAdNCAYAAADwPXCqAAN3YUlEQVR4AezBCXiUhaHv4d/3zSRMEpZggYQb2wRPrwmgBo4mIW6BNtK6oSxiUdlOxbZRrO1RC2qr1qpUe8TWGq22CmrdUFKpiEA0iwomQWFYsig2M0LMhjIhkkxm+b57x/PMuWmaICI699H/+xojRh5vIyIiIiIiIiIxZSIiIiIiIiIiMWciIiIiIiIiIjFnIiIiIiIiIiIxZyIiIiIiIiIiMWciIiIiIiIiIjFnIiIiIiIiIiIxZyIiIiIiIiIiMWciIiIiIiIiIjFnIiIiIiIiIiIxZyIiIiIiIiIiMWciIiIiIiIiIjFnIiIiIiIiIiIxZyIiIiIiIiIiMWciIiIiIiIiIjFnIiIiIiIiIiIxZyIiIiIiIiIiMedERERE5GskJXU0rkEuIvw9flpbmhEREfn/gRMRERGRrziXK4HcvElkZ08kOTmZ3nw+H273VioryhAREYklJyIiIiJfYSmpo5k7dwEJCQn4OnxUV23G7/cTMSw5mczMsRQUTCEzM4s1a/5Ga0szhyM9YwyZx2eRkjoaf083Xo+H7e5t+P3dRCQPS+akCRPpq8Pnw+tpxNfhIyp5WDInTZjIoXi9HryeRpKHJXPShIkcitfrwetpJD1jDOnpGfTV4fPR0FCP399Nb+kZY0hPz+DTVFaUEZGdPZFhyckMpMPnw+3eSpTLlcBJ2RNITUllWPJwWlua8XobaWioJ+rMgil8mg6fD7d7K//27ePZu+d9enr8iIh8FTgRERER+YpKSR3N3LkLSEhIYMP6dVRVbaYvl+tl8vImcWbBFObOXcCfH3oAX4ePQ5k2bTrZEybSW1bmWM48czIbN7yM272VYcOHU1AwhYFUVJRRWVFGxLDhwykomMKhVFaU4fU0 |
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
sudo apt-get install build-essential libssl-dev git -y | |
git clone https://github.com/wg/wrk.git wrk | |
cd wrk | |
sudo make | |
# move the executable to somewhere in your PATH, ex: | |
sudo cp wrk /usr/local/bin |
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/sh -e | |
/root/OoklaServer —daemon | |
exit 0 |
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
def isPrime(num): | |
flag = False | |
if num == 1: | |
return False | |
elif num > 1: | |
# check for factors | |
for i in range(2, num): | |
if (num % i) == 0: | |
# if factor is found, set flag to True |
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
SELECT Region, Name, Population, RANK() over(partition by region ORDER BY population desc) as 'Ranked' FROM world.country ; |
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
create database aws; | |
use aws; | |
CREATE TABLE RESTART ( | |
StudentID int not null AUTO_INCREMENT, | |
StudentName varchar(255), | |
RestartCity varchar(255), | |
GraduationDate Datetime, | |
PRIMARY KEY (StudentID) | |
); |
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
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` | |
#Set the Region | |
AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone -H "X-aws-ec2-metadata-token: $TOKEN"` | |
export AWS_DEFAULT_REGION=${AZ::-1} | |
echo $AWS_DEFAULT_REGION | |
#Retrieve latest Linux AMI | |
AMI=$(aws ssm get-parameters --names /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 --query 'Parameters[0].[Value]' --output text) | |
echo $AMI |
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 json | |
import urllib.parse | |
import boto3 | |
import os | |
print('Loading function') | |
s3 = boto3.client('s3') | |
TOPIC_ARN = os.environ['topicARN'] | |
def lambda_handler(event, context): |