Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Remote Working

Kawin Viriyaprasopsook bouroo

🏠
Remote Working
View GitHub Profile
@bouroo
bouroo / 60-zercle-huge.cnf
Last active Aug 20, 2020
Optimise MariaDB/MySQL
View 60-zercle-huge.cnf
# Example MariaDB config file for very large systems.
#
# This is for a large system with memory of 16G where the system runs mainly
# MariaDB.
# Maintainer Kawin Viriyaprasopsook <kawin.vir@zercle.tech>
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
@bouroo
bouroo / settings.json
Created Mar 14, 2020
vscode settings
View settings.json
{
"files.autoSave": "afterDelay",
"editor.fontFamily": "'Cascadia Code', 'Jetbrains Mono', monospace",
"editor.fontSize": 16,
"editor.formatOnSave": true,
"npm.packageManager": "yarn",
"eslint.packageManager": "yarn",
"editor.wordWrap": "bounded",
"workbench.startupEditor": "newUntitledFile",
"go.autocompleteUnimportedPackages": true,
@bouroo
bouroo / ssl.sh
Last active Feb 26, 2020
self sign cert script
View ssl.sh
#!/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 ! hash openssl 2>/dev/null; then\
echo "Required openssl"
exit
@bouroo
bouroo / pacman-init.sh
Last active Nov 11, 2019
Init arch linux pacman
View pacman-init.sh
#!/usr/bin/env bash
# Enable networkd and resolved
systemctl enable systemd-networkd
systemctl enable systemd-resolved
systemctl restart systemd-networkd
systemctl restart systemd-resolved
# Init pacman mirror
curl -s -L "https://www.archlinux.org/mirrorlist/?country=TH&country=SG&country=IN&country=JP&protocol=https&ip_version=4" | sed -e 's/^#Server/Server/' -e '/^#/d' > /etc/pacman.d/mirrorlist
@bouroo
bouroo / win10SMB.ps1
Created Aug 22, 2019
Windows 10 SMBv2 & SMBv1 Client
View win10SMB.ps1
Set-SmbClientConfiguration -EnableInsecureGuestLogons $true
Set-SmbServerConfiguration -EnableSMB2Protocol $true
Enable-WindowsOptionalFeature -Online -FeatureName "SMB1Protocol"
Enable-WindowsOptionalFeature -Online -FeatureName "SMB1Protocol-Client"
@bouroo
bouroo / adapta_papirus.sh
Created Aug 15, 2019
Ubuntu adapta + papirus
View adapta_papirus.sh
#!/usr/bin/env bash
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi
${SUDO} add-apt-repository -y ppa:tista/adapta
${SUDO} add-apt-repository -y ppa:papirus/papirus
${SUDO} apt update
${SUDO} apt install -y adapta-gtk-theme papirus-icon-theme
@bouroo
bouroo / openvpn.sh
Created Jun 29, 2019
Install OpenVPN from OpenVPN project's own software repositories
View openvpn.sh
#!/usr/bin/env bash
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi
if ! $(type lsb_release > /dev/null 2>&1) ; then
${SUDO} apt install -y lsb-release
fi
@bouroo
bouroo / pve-auto-remount.sh
Last active Jun 14, 2019
Service "pvestatd" tries to remount every nfs share every 10 seconds automatically, So add this script to cron every minute.
View pve-auto-remount.sh
#!/usr/bin/env bash
list=$(ls /mnt/pve)
for i in $list
do
status=$(ls /mnt/pve/$i 2>&1)
if [[ $status =~ .*Stale.* ]]
then
umount /mnt/pve/$i
@bouroo
bouroo / thai-id-card.js
Last active Sep 17, 2020
Thai National ID Card reader in NodeJS
View thai-id-card.js
/* 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 / centos-ml-kernel.sh
Last active Aug 11, 2020
Update CentOS mainline stable kernel for deploy Google BBR
View centos-ml-kernel.sh
#!/usr/bin/env bash
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi
if ! $(type lsb_release > /dev/null 2>&1) ; then
${SUDO} yum install -y redhat-lsb-core
fi
You can’t perform that action at this time.