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
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
#!/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
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
<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
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
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
map $remote_addr $proxy_forwarded_elem { | |
# IPv4 addresses can be sent as-is | |
~^[0-9.]+$ "for=$remote_addr"; | |
# IPv6 addresses need to be bracketed and quoted | |
~^[0-9A-Fa-f:.]+$ "for=\"[$remote_addr]\""; | |
# Unix domain socket names cannot be represented in RFC 7239 syntax | |
default "for=unknown"; | |
} |
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
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/html; | |
index index.html; | |
server_name my.domain.com; | |
location / { |
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 1>/sys/class/block/sdd/device/rescan | |
Run the growpart <DeviceName> <PartionNumber> command to resize the partition. | |
The following example shows that the first partition /dev/sda1 of the system disk is resized: | |
[root@ecshost ~]# growpart /dev/sda 1 | |
CHANGED: partition=1 start=2048 old: size=83883999 end=83886047 new: size=209713119 end=209715167 | |
[root@ecshost ~]# resize2fs /dev/sda1 |