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 / 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
#!/usr/bin/env bash
sudo rm -f ~/.rnd
if grep -qs "CentOS release 5" "/etc/redhat-release"; then
echo "CentOS 5 is too old and not supported"
exit
fi
if [[ -e /etc/debian_version ]]; then
OS=debian
RCLOCAL='/etc/rc.local'
@bouroo
bouroo / softether.sh
Last active May 12, 2025 03:54
Install softether vpn server on ubuntu 16.04+
#!/usr/bin/env bash
# SoftEther VPN Server Installer Script
# Register vultr.com with free credit https://www.vultr.com/?ref=9206731-8H
# Create VPS
# Tested on Ubuntu 18.04, Debian 10.0
# Instructions:
# 1. Save this file as softether-installer.sh
# 2. chmod +x softether-installer.sh
# 3. Run: ./softether-installer.sh or bash softether-installer.sh
# 4. Initialize VPN server config: /usr/local/vpnserver/vpncmd
#!/usr/bin/env bash
RTM=$(curl https://packages.gitlab.com/gitlab/raspberry-pi2 | grep '\-ce.0_armhf.deb' | grep -o 'gitlab-[^"]*deb' | head -1)
curl -s https://packages.gitlab.com/install/repositories/gitlab/raspberry-pi2/script.deb.sh | sudo bash -
sed -i 's|debian|rasbian|g' /etc/apt/sources.list.d/gitlab_raspberry-pi2.list
wget -l https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/jessie/${RTM}/download
dpkg -i ${RTM}
exit 0
@bouroo
bouroo / docker-go
Last active January 4, 2018 17:13
/usr/local/bin/go
#!/usr/bin/env bash
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
echo "Current working directory: '"$(pwd)"'"
docker run -it --rm \
-v "$(pwd)":/usr/src/myapp \
-w /usr/src/myapp \
golang:alpine \
go "$@"
exit 0
@bouroo
bouroo / certbot.sh
Created January 4, 2018 16:36
certbot letsencrypt script
#!/usr/bin/env bash
CERT_BOT=$(which certbot)
${CERT_BOT} certonly \
--rsa-key-size 4096 \
--expand \
--webroot \
--agree-tos \
--email your@email \
@bouroo
bouroo / adBlockRules.txt
Last active August 13, 2018 03:30
Adblock rules for Thai anime website & manga website
anime-sugoi.com###disable_mobile
anime-sugoi.com##div.container:nth-child(3) > div.row > center
anime-sugoi.com##div.container:nth-child(3) > div.row > div.col-lg-9:nth-child(12) > div.panel.panel-danger > div.panel-body:last-child > div.row:first-child
anime-sugoi.com##div.container:nth-child(3) > div.row > div.col-lg-9:nth-child(12) > div.panel.panel-danger > div.panel-body:last-child > center
koi-anime.com###main > div.code-block.code-block-1:first-child
koi-anime.com###main > div.code-block.code-block-1:nth-child(2)
anime-sugoi.com##div.container:nth-child(3) > div.row > div.col-lg-9:nth-child(17) > div.panel.panel-danger > div.panel-body:last-child > center:nth-child(3)
koi-anime.com###efbl_popup > div.efbl-like-box.\31 :nth-child(3) > div.fb-page.fb_iframe_widget > span > iframe
koi-anime.com##div.mfp-ready
koi-anime.com###efbl_popup
@bouroo
bouroo / kea-dhcp.sh
Last active December 3, 2023 18:26
Install kea DHCP server from source on ubuntu
#!/usr/bin/env bash
# Define variable
KEA_VER="v1_8_0"
CPU_CORES=$(grep -c processor /proc/cpuinfo)
if [ ${CPU_CORES} -gt 1 ]; then
CPU_CORES=$((CPU_CORES - 1))
fi
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
@bouroo
bouroo / fixCentosDocker.sh
Last active August 20, 2020 16:04
Docker no route to host CentOS
#!/usr/bin/env bash
systemctl stop firewalld
systemctl disable firewalld
iptables --policy INPUT ACCEPT
iptables --policy OUTPUT ACCEPT
iptables --policy FORWARD ACCEPT
iptables -Z
iptables -F
iptables -X
systemctl restart docker
@bouroo
bouroo / install_go.sh
Last active May 1, 2025 17:06
Get latest version of go lang
#!/usr/bin/env bash
# Script: install_go.sh
# Description:
# Automates installation of the latest stable Go programming language release
# for various architectures and OSes. Detects system architecture and OS
# to download the appropriate Go binary, installs to /usr/local/go, and
# configures environment variables for the current user's shell.
# Usage:
# chmod +x install_go.sh && ./install_go.sh
# Notes: