This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
# listen [::]:80 default ipv6only=on; | |
server_name log.terry.im; | |
# redirect all HTTP requests to HTTPS with a 301 Moved Permanently response | |
location / { | |
return 301 https://$host$request_uri; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User and group used by worker processes | |
# ubuntu | |
# user www-data; | |
# fedora | |
user nginx; | |
# Ideally # of worker processes = # of CPUs or cores | |
# Set to auto to autodetect | |
# max_clients = worker_processes * worker_connections | |
worker_processes auto; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User ssh configuration file ~/.ssh/config | |
# Gist https://gist.github.com/terrywang/3997931 | |
# man ssh_config for more information | |
# Inspired by the blog post below to fight the NSA | |
# https://stribika.github.io/2015/01/04/secure-secure-shell.html | |
# Github needs diffie-hellman-group-exchange-sha1 some of the time but not always | |
# Host github.com | |
# KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# backup HISTFILE | |
cp ~/.bash_history{,.bak} | |
# deduplicate - deprecated | |
nl ~/.bash_history.bak | sort -k2,2 -k1,1nr | uniq -f1 | sort -k1,1n | cut -f2 > ~/.bash_history | |
# dedupelicate | |
cp ~/.bash_history{,.bak-$(date -I)} | |
tac $HISTFILE | awk '!x[$0]++' | tac | sponge $HISTFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
# [ -z "$PS1" ] && return | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
OlderNewer