Skip to content

Instantly share code, notes, and snippets.

View kyob's full-sized avatar

kyob

View GitHub Profile
@kyob
kyob / nginx-reverse-proxy.txt
Created January 8, 2024 11:26
NGINX reverse proxy example
server {
listen 80;
server_name example.com;
location / {
return 301 https://$server_name$request_uri;
}
location /.well-known/acme-challenge/ {
@kyob
kyob / dkim.sh
Created January 8, 2024 11:20
DKIM bash script
#!/bin/bash
# This script generates a DKIM key pair using Rspamd's dkim_keygen tool
# and follows best practices for key generation.
# Set the domain for which the DKIM key is being generated
domain="example-domain.com"
# Generate a random selector of 10 characters using /dev/urandom
selector=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 10)
@kyob
kyob / gist:6891157a1f7a8332f9f034a570211037
Created September 7, 2023 06:57
remove comments and empty lines
grep -v '^[[:space:]]*#' file.conf | grep -v '^[[:space:]]*$'
@kyob
kyob / ddos.txt
Created September 1, 2023 12:40 — forked from bom-d-van/ddos.txt
Detecting and Mitigating DDOS Attacks
Detecting and Mitigating DDOS Attacks
#List all Finish (FIN) packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0'
#List all SYN and SYN-ACK packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0'
@kyob
kyob / ddosDetection.sh
Created September 1, 2023 12:24 — forked from Masu-Baumgartner/ddosDetection.sh
DDoS Detection Script ready to use for a integration in third party software using the "DATA" output. Should work on every linux system
#! /bin/bash
echo "DDos Detect by masusniper#0666";
interface=$(ip -o -4 route show to default | awk '{print $5}')
dumpdir=/root/dumps
echo -e "Using interface ${interface}"
mkdir $dumpdir
#/bin/bash
history | awk '{print $2}' | sort | uniq -c | sort -nr | head -n 10
@kyob
kyob / cto_line.pine
Created September 27, 2021 06:34
CTO Line indicator for TradingView
//@version=4
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="")
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
v1 = smma(hl2, 15)
m1 = smma(hl2, 19)
m2 = smma(hl2, 25)
v2 = smma(hl2, 29)
PATH=$PATH:/my/path
or
PATH=/my/path:$PATH
@kyob
kyob / README-Template.md
Created December 5, 2019 13:06 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kyob
kyob / genieacs-pending-tasks.txt
Created November 15, 2019 09:28
GenieACS pending tasks
# curl -i 'http://localhost:7557/tasks/?query=%7B%22device%22%3A%22F48CEB-Router-QXNN1J1004416%22%7D'
HTTP/1.1 200 OK
GenieACS-Version: 1.2.0-beta.0+20190829073154
Content-Type: application/json
total: 35
Date: Fri, 15 Nov 2019 09:26:23 GMT
Connection: keep-alive
Transfer-Encoding: chunked