Skip to content

Instantly share code, notes, and snippets.

View NLGRF's full-sized avatar
👻
🍻 IPA 📟

Nonpavit Detbun NLGRF

👻
🍻 IPA 📟
View GitHub Profile
@NLGRF
NLGRF / Match_Addresses.md
Created May 29, 2024 08:51 — forked from MBrassey/Match_Addresses.md
Match Crypto Wallet Addresses (REGEX)

Match Crypto Wallet Addresses using Regular Expressions

The following regular expressions are crafted to match some commonly used cryptocurrency wallet address types. This document details the Regex components and pattern tests to match Ethereum, Bitcoin, Dash and Monero addresses.

🌀 Click the images below to view the tested patterns.

Ethereum (ETH)

/^0x[a-fA-F0-9]{40}$/g

@NLGRF
NLGRF / encryption.ts
Created April 10, 2023 11:20 — forked from ChaoLiangSuper/encryption.ts
Stronger Encryption and Decryption in typescript
import crypto from 'crypto';
const ALGORITHM = 'aes-256-cbc';
const ENCODING = 'hex';
const IV_LENGTH = 16;
const KEY = process.env.ENCRYPTION_KEY!;
export const encrypt = (data: string) => {
const iv = crypto.randomBytes(IV_LENGTH);
const cipher = crypto.createCipheriv(ALGORITHM, new Buffer(KEY), iv);
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
namespace: kong
name: cache-hello-app
config:
response_code:
- 200
request_method:
- GET
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
namespace: kong
name: cors-helloa-app
config:
origins:
- http://localhost:3000
- https://acme-v02.api.letsencrypt.org
methods:
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
namespace: kong
name: ratelimit-helloa-app
config:
second: 20
hour: 10000
policy: local
plugin: rate-limiting
@NLGRF
NLGRF / certssl.yml
Last active October 27, 2022 19:24
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
namespace: cert-manager
spec:
acme:
email: [email protected] #please change this
privateKeySecretRef:
name: letsencrypt-prod
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cname-example-com
annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
ingressClassName: kong
tls:
apiVersion: v1
kind: Service
metadata:
labels:
app: hello-app
name: hello-app
annotations:
konghq.com/plugins: cache-hello-app,ratelimit-hello-app,cors-hello-app
spec:
ports:
apiVersion: v1
kind: Service
metadata:
labels:
app: hello-app
name: hello-app
spec:
ports:
- name: https
protocol: TCP
docker build -t hello-app:latest .
docker tag hello-app:latest gcr.io/<your-project-id>/hello-app:latest
docker push gcr.io/<your-project-id>/hello-app:latest