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 / yum.repos.sh
Created July 16, 2024 14:47
vault centos 6
#!/usr/bin/env bash
cat <<-'EOF' > /etc/yum.repos.d/CentOS-Base.repo
[C6.10-base]
name=CentOS-6.10 - Base
baseurl=http://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
metadata_expire=never
@bouroo
bouroo / config.spa.unit.json
Created July 14, 2024 07:28
simple nginx/unit config to serve SPA
{
"listeners": {
"*:8080": {
"pass": "routes/main"
}
},
"routes": {
"main": [
{
"action": {
@bouroo
bouroo / docker-compose.yaml
Last active July 9, 2024 04:40
pgcat and postgresql replication with docker compose
# Environment variables for PostgreSQL containers
x-default-pg-env: &default-pg-env
# Set the timezone to Asia/Bangkok
TZ: Asia/Bangkok
# Username for the PostgreSQL administrative account
POSTGRESQL_USERNAME: postgres
# Name of the default PostgreSQL database
POSTGRESQL_DATABASE: postgres
# Password for the PostgreSQL administrative account
POSTGRESQL_PASSWORD: mysecretpassword
@bouroo
bouroo / TurtleTrading.pine
Created June 4, 2024 06:03
Turtle Trading Strategy with Supertrend Confirmation
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © bouroo
//@version=5
strategy("Turtle Trading Strategy with Supertrend Confirmation", overlay=true)
// Turtle Trading Parameters
length1 = input.int(20, title="Donchian Channel Length (Breakout)")
length2 = input.int(10, title="Donchian Channel Length (Exit)")
risk_pct = input.float(2.0, title="Risk Percentage per Trade")
@bouroo
bouroo / speedtest.sh
Created May 30, 2024 11:22
speedtest-cli script
#!/usr/env/bash
# Thailand
speedtest -s 27203
# Singapore
speedtest -s 2054
@bouroo
bouroo / resize_disk.sh
Created November 10, 2023 07:31
linux extend disk partition script
#!/usr/bin/env bash
# find root path
ROOT_DEV=$(findmnt -n -o SOURCE /)
# rescan disk size
echo 1 | sudo tee /sys/block/sda/device/rescan
# grow partition that contains root
# extend partition size
growpart /dev/sda 3
# extend physical volume
pvresize /dev/sda3
@bouroo
bouroo / thai-id-card.rs
Last active October 18, 2023 17:12
Thai ID card reader in Rust
extern crate pcsc;
use std::io;
use std::io::prelude::*;
use std::fs::File;
use std::str;
use std::string::String;
use pcsc::{Card, Context, ShareMode, Scope};
use pcsc::Error;
@bouroo
bouroo / php56.sh
Created October 13, 2023 13:00
php-5.6 on plesk
#!/usr/bin/env bash
#==============================================================================
# title: php56.sh
# description: This script automatically installs PHP 5.6 on Plesk RHEL
# author: Kawin Viriyaprasopsook <kawin.v@kkumail.com>
# usage: bash php56.sh
# notes: need `gcc libxml2-devel` packages
#==============================================================================
dnf -y install gcc libxml2-devel
@bouroo
bouroo / rke2-debian.md
Last active May 28, 2024 00:31
RKE2 on Debian

RKE2 on Debian

install Debain with openssh-server

config server as root

install package

apt -y install fail2ban nano sudo vlan ifupdown2 ipvsadm ipset wget curl mtr-tiny net-tools tmux unattended-upgrades open-iscsi glances btop htop
@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