Skip to content

Instantly share code, notes, and snippets.

View LamSecurity's full-sized avatar
💭
☕️

LamSecurity LamSecurity

💭
☕️
View GitHub Profile
@LamSecurity
LamSecurity / check-upgrade.sh
Created September 21, 2022 18:10 — forked from weinong/check-upgrade.sh
check if cluster needs upgrade or not based on vhd version
#!/bin/bash
for l in $(az aks list | jq -r '.[] | "\(.id),\(.nodeResourceGroup)"'); do
id=$(echo $l | cut -d, -f1)
rg=$(echo $l | cut -d, -f2)
if [[ $rg == "null" ]]; then continue; fi
if [[ "$(az group exists -g $rg)" == "false" ]]; then continue; fi
@LamSecurity
LamSecurity / encrypt_openssl.md
Created September 21, 2022 18:11 — forked from weinong/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout server.key \
-new \
-out server.crt \
-subj /CN=example.com \
-reqexts SAN \
-extensions SAN \
@LamSecurity
LamSecurity / encrypt_openssl.md
Created September 21, 2022 18:13 — forked from weinong/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@LamSecurity
LamSecurity / nginx
Created September 21, 2022 18:14 — forked from weinong/nginx
simple kubernetes yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template:
@LamSecurity
LamSecurity / v1_authorization_code
Created September 21, 2022 18:14 — forked from weinong/v1_authorization_code
AAD OAuth2 related
#
# Reference: https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code
#
TENANT_ID=''
CLIENT_ID=''
CLIENT_SECRET='' # urlencoded string
RETURNED_URL='' # urlencoded string
RESPONSE_CODE='query' # query, fragment, or form_post
STATE='12345' # random string that needs to be validated by the returned url
@LamSecurity
LamSecurity / perf_with_curl.sh
Created September 21, 2022 18:15 — forked from weinong/perf_with_curl.sh
HTTP Performance profiling with curl
for i in {1..100}; do
curl -w "time_total:%{time_total}\ntime_namelookup:%{time_namelookup}\ntime_connect:%{time_connect}\ntime_appconnect:%{time_appconnect}\ntime_pretransfer:%{time_pretransfer}\ntime_starttransfer:%{time_starttransfer}\n" -s $URL --insecure -o /dev/null
echo
sleep 5
done
@LamSecurity
LamSecurity / git.md
Created January 16, 2023 18:55 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda