Skip to content

Instantly share code, notes, and snippets.

# .htaccess Security Protection Guide
[![Security Status](https://img.shields.io/badge/Security-Critical-red.svg)](https://github.com/yourusername/htaccess-security-guide)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Thai Language](https://img.shields.io/badge/Language-Thai-green.svg)](README_TH.md)
## 📋 Table of Contents
- [Overview](#overview)
- [Common Attack Vectors](#common-attack-vectors)
@SuriyaRuk
SuriyaRuk / jump.sh
Created October 11, 2024 07:13 — forked from tuxfight3r/jump.sh
kubectl jump server via kubectl port-forward
#!/usr/bin/env bash
# Allows you to connect to remote endpoints via port forward
set -e
TEMP_POD_NAME=db-jump-server
LOCAL_PORT=3307
REMOTE_HOST=prod.abc123.region-1.rds.amazonaws.com
REMOTE_PORT=3306
function cleanup {
@SuriyaRuk
SuriyaRuk / 01.bash_shortcuts_v2.md
Created September 25, 2024 14:42 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
#curl 127.0.0.1:8001/services -d name=1 -d url=http://httpbin.org/status/201
#curl 127.0.0.1:8001/services/1/routes -d name=a -d paths[]=/a
#curl 127.0.0.1:8001/services -d name=2 -d url=http://httpbin.org/status/202
#curl 127.0.0.1:8001/services/2/routes -d name=b -d paths[]=/b
#curl 127.0.0.1:8001/services/1/plugins \
-d name=oauth2 -d config.mandatory_scope=false \
-d config.global_credentials=true \
-d config.enable_client_credentials=true
@SuriyaRuk
SuriyaRuk / lsof_netstat_on_macos.md
Created January 14, 2024 12:31 — forked from rollwagen/lsof_netstat_on_macos.md
lsof / netstat on macos

lsof / netstat on macos

lsof - list open files

  • display (list) all open TCP+UDP ports and grep for listening ones
    • sudo lsof -i -P | grep LISTEN
      COMMAND     PID           USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
      launchd       1           root   11u  IPv6 0x26dd73cb700390df      0t0    TCP *:22 (LISTEN)
      ....
version: '3.9'
services:
restart-docker:
image: jpetazzo/dind
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: sh -c "docker start $(docker ps -aq) && tail -f /dev/null || exit 0;"
logging:
#!/bin/bash
host=127.0.0.1
port=8001
#for object in services routes plugins consumers certificates upstreams snis tags;do
for object in services routes certificates upstreams snis ;do
# cout=$(curl -sL $host:$port/$object | jq .data | jq .[] | jq .id | wc -l)
for i in $(curl -sL $host:8001/$object | jq .data | jq .[] | jq .name); do
j=$(echo $i | sed 's,",,g');
@SuriyaRuk
SuriyaRuk / couting.sh
Last active July 21, 2023 19:32
counting object on kong
#!/bin/bash
host=127.0.0.1
port=8001
for object in services routes plugins consumers certificates upstreams snis tags;do
cout=$(curl -sL $host:$port/$object | jq .data | jq .[] | jq .id | wc -l)
offset=$(curl -sL $host:$port/$object | grep -o '"offset":"[^"]*' | grep -o '[^"]*$');
while [ "$offset" != "" ];do
cout=$(($cout + $(curl -sL $host:$port/$object?offset=$offset | jq .data | jq .[] | jq .id | wc -l)))
#datainhost=$(du -hsb /data/do-3/root | awk '{print $1}')
#echo $datainhost
#x=1
#while [ $datainhost -lt 115598085 ]
while [ $(pidof scp) ]
do
#datainhost=$(du -hsb /data/do-3/root | awk '{print $1}')
echo "root "$(pidof scp)" not finish"
sleep 60s
@SuriyaRuk
SuriyaRuk / README.md
Created December 24, 2022 19:07 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh: