Skip to content

Instantly share code, notes, and snippets.

View namcxn's full-sized avatar
🎯
Focusing

Nam namcxn

🎯
Focusing
View GitHub Profile
@namcxn
namcxn / 99-network-tuning.conf
Created December 21, 2020 17:22 — forked from hrchu/99-network-tuning.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# See evil packets in your logs.
net.ipv4.conf.all.log_martians = 1
@namcxn
namcxn / ssh-telegram.sh
Created June 14, 2018 07:31 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
@namcxn
namcxn / nginx.conf
Last active September 16, 2015 15:15 — forked from SvenAlHamad/nginx.conf
#user
user www-data www-data;
# This number should be, at maximum, the number of CPU cores on your system.
# (since nginx doesn't benefit from more than one worker per CPU.)
worker_processes 1;
#pid
pid /var/run/nginx.pid;