Skip to content

Instantly share code, notes, and snippets.

View neutronth's full-sized avatar

Neutron Soutmun neutronth

  • Bangkok, Thailand
View GitHub Profile
@neutronth
neutronth / .vimrc
Created June 10, 2019 02:20
Neutron's vim personal config
set shell=/bin/bash
set mouse=
set ttymouse=
set nocompatible
set cursorline
set cursorcolumn
highlight CursorColumn ctermfg=White ctermbg=blue cterm=bold guifg=white guibg=yellow gui=bold
@neutronth
neutronth / .tmux.conf
Created June 10, 2019 02:18
Neutron's tmux personal config
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-option -g status-position bottom
set-option -g repeat-time 0
set-option -g mode-keys vi
@neutronth
neutronth / usb
Created July 4, 2017 05:30
systemd [/lib/systemd/system-sleep/usb] USB hub unbind/bind properly on suspend/resume
#!/bin/sh
mount_path=/media/neutron
mount_match="(DataBackup|DataLife)"
usb_drivers_path=/sys/bus/usb/drivers
usb_hub_list=/tmp/usb-hub.list
unbind_usb_hub () {
> $usb_hub_list
@neutronth
neutronth / linux_4.4_multipath_hash_ipport.patch
Created April 10, 2016 11:04
Linux 4.4 multipath routing with src_ip, dst_ip, src_port, dst_port hash flow-based
--- include/net/ip_fib.h.orig 2016-04-10 11:44:40.342768815 +0700
+++ include/net/ip_fib.h 2016-04-10 15:28:42.217868332 +0700
@@ -331,6 +331,12 @@
return jhash_2words(saddr, daddr, fib_multipath_secret) >> 1;
}
+static inline int fib_multipath_hash_ip_port(__be32 saddr, __be32 daddr,
+ __be32 ports)
+{
+ return jhash_3words(saddr, daddr, ports, fib_multipath_secret) >> 1;
@neutronth
neutronth / letsencrypt-auto-renew
Last active February 19, 2017 12:44
Let's Encrypt auto renew script
#/bin/sh
OPTS=$(getopt -o cehw: --long config:,expire-limit:,help,webservice: -n "$0" -- "$@")
if [ $? != 0 ]; then
echo "Terminating ..." >&2
exit 1
fi
CONFIG=/etc/letsencrypt/cli.ini
WEBSERVICE=nginx