EC2 AWS
Image: Ubuntu 22.04 LTS, 64-bit (x86)
Instance: t2.micro
Location: ap-south-1 (Mumbai)
vCPUs 1 | RAM 1gb
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
# -*- coding: utf-8 -*- | |
''' | |
>>> otp = HashOTP() | |
>>> otp_code = h.now("MY NAME IS MAYANK") | |
123456 | |
>>> verify = h.verify("MY NAME IS MAYANK", "123456") | |
True | |
''' |
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
package main | |
import ( | |
"log" | |
"net" | |
"strconv" | |
"sync" | |
) | |
const ( |
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
package main | |
import ( | |
"net/http" | |
"io/ioutil" | |
"log" | |
"fmt" | |
) | |
var print = fmt.Println; |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-world | |
spec: | |
selector: | |
matchLabels: | |
run: hello-world-selector | |
replicas: 2 | |
template: |
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
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse |
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
apt-get remove docker docker-engine docker.io containerd runc jq | |
apt-get update | |
apt-get -y install apt-transport-https ca-certificates curl gnupg lsb-release | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get -y install docker-ce docker-ce-cli containerd.io | |
compose_version=$(curl https://api.github.com/repos/docker/compose/releases/latest | jq .name -r) | |
curl -L "https://github.com/docker/compose/releases/download/$compose_version/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose |
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
sudo apt update | |
sudo cat << EOF | sudo tee /etc/modules-load.d/k8s-modules.conf | |
br_netfilter | |
overlay | |
EOF | |
sudo cat << EOF | sudo tee /etc/sysctl.d/k8s.conf | |
net.bridge.bridge-nf-call-ip6tables = 1 | |
net.bridge.bridge-nf-call-iptables = 1 | |
net.ipv4.ip_forward = 1 | |
EOF |
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
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python3 | |
''' | |
A simple serial generator, it can be used in renaming images on cnd or any purpose | |
>>> series = AlphaSeries() | |
>>> series = series + (1_000_000_000 * 1_000_000_000 * 1_000_000_000) # billion * billion * billion | |
>>> print(series, series.int()) | |
BSnRvvkli4KYvXUE 1000000000000000000000000000 |
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
from io import BytesIO | |
from PIL import Image | |
from re import compile, search, findall, sub | |
import requests | |
class Background1: | |
PATTERN_CSRF = compile(r'<meta name="csrf-token" content="(.*)"') | |
PATTERN_TOKEN = compile(r"useToken\(\'(.*?)\'\)") |
NewerOlder