Skip to content

Instantly share code, notes, and snippets.

View bouroo's full-sized avatar
🏠
Remote Working

Kawin Viriyaprasopsook bouroo

🏠
Remote Working
View GitHub Profile
@bouroo
bouroo / 60-sysctl.conf
Last active April 2, 2024 03:55
Kernel tuning for dedicated linux server. /etc/sysctl.d/60-sysctl.conf
# Sysctl Configuration for High-Performance such as HTTP/2 Web Server
# Kawin Viriyaprasopsook <kawin.v@kkumail.com>
# place file in /etc/sysctl.d/60-sysctl.conf
# and run `sysctl --system`
# --------------------------------------------------------------------
# System options
# --------------------------------------------------------------------
# stop low-level messages on console
kernel.printk = 3 4 1 3
@bouroo
bouroo / sse-worker.js
Last active April 1, 2024 16:16
example for cloudflare worker server-sent events
/**
* Welcome to Cloudflare Workers! This is your first worker.
*
* - Run "npm run dev" in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your worker in action
* - Run "npm run deploy" to publish your worker
*
* Learn more at https://developers.cloudflare.com/workers/
*/
@bouroo
bouroo / swap.sh
Last active March 17, 2024 04:46
Create swap on VPS
#!/usr/bin/env bash
#==============================================================================
# title: swap.sh
# description: This script automatically creates a swap size that's 20% of total RAM
# and comments out the old swap device in /etc/fstab.
# author: Kawin Viriyaprasopsook <kawin.v@kkumail.com>
# usage: bash swap.sh
# notes: need `sudo dd sed` packages
#==============================================================================
@bouroo
bouroo / SuperWaveTrend.pine
Last active March 15, 2024 01:42
SuperTrend + WaveTrend Strategy
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// From Network Lag Trading Teams
// © bouroo
//@version=5
strategy("SuperTrend + WaveTrend Strategy", overlay=true)
// SuperTrend Parameters
atrLength = input(10, title="ATR Length")
factor = input(3.0, title="Factor")
@bouroo
bouroo / daemon.json
Last active March 12, 2024 02:58
Docker daemon config with google cloud registry mirror
{
"registry-mirrors": ["https://mirror.gcr.io"],
"dns": ["149.112.112.112", "1.1.1.2", "8.8.4.4"],
"features": {
"buildkit": true
}
}
@bouroo
bouroo / pve_suricata.md
Last active March 5, 2024 03:00
Proxmox firewall suricata IPS integration

This try follow PVE Firewall#_suricata_ips_integration

  • install suricata
apt-get -y install suricata jq
modprobe nfnetlink_queue
echo "nfnetlink_queue" > /etc/modules-load.d/nfnetlink_queue.conf
sed -i 's/NFQUEUE=.*/NFQUEUE=0-3/' /etc/default/suricata
@bouroo
bouroo / gen_kustomization.sh
Last active February 29, 2024 21:22
k8s kustomization generate from kubectl
#!/usr/bin/env bash
#==============================================================================
# title: gen_kustomization.sh
# description: This script automatically creates kustomization deployment files from kubectl
# author: Kawin Viriyaprasopsook <kawin.v@kkumail.com>
# usage: bash gen_kustomization.sh
# notes: need `kubectl kubectl-convert kubectl-neat` packages
#==============================================================================
mkdir -p kustomization && cd kustomization
@bouroo
bouroo / fstab
Last active February 29, 2024 04:54
Example /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# Optimize btrfs for SSD
UUID=xxx /mount/to btrfs defaults,ssd,subvol=@ 0 1
@bouroo
bouroo / thai-id-card.js
Last active January 25, 2024 04:20
Thai National ID Card reader in NodeJS
/* eslint-disable no-console */
/*
* Thai National ID Card reader in NodeJS
*
* Linux
* apt install libpcsclite-dev libpcsclite1 pcscd build-essential
*
* Windows
* yarn global add windows-build-tools
*
@bouroo
bouroo / pve.md
Last active January 6, 2024 18:50
PVE cmd memo

First run

# vmbr0 => public
# vmbr1 => private => mtu 8996
# disable PVE enterprise repo
# enable PVE no-subscription
# enable debian non-free repo
apt update && apt -y full-upgrade && apt -y install intel-microcode
apt -y install openvswitch-switch tmux htop curl wget jq rsync rclone mtr-tiny net-tools iperf3
# Enable auto update