Skip to content

Instantly share code, notes, and snippets.

@bangnbx
bangnbx / forward.sh
Last active December 3, 2020 07:31
Forward traffic to an external IP (via a port) to localhost
ifconfig lo0 alias 10.x.x.x
echo \
"rdr pass on lo0 inet proto tcp from any to 10.x.x.x port 1234 -> 127.0.0.1 port 1234
rdr pass on lo0 inet proto tcp from any to 10.x.x.x port 3456 -> 127.0.0.1 port 3456" | pfctl -ef -
@bangnbx
bangnbx / log4j.properties
Created March 4, 2019 10:17 — forked from xkr47/log4j.properties
log4j configuration with different colors for different log levels - also works with Eclipse Ansi Console: http://mihai-nita.net/2013/06/03/eclipse-plugin-ansi-in-console/
log4j.debug=false
# Default level is INFO
log4j.rootLogger=INFO,StdoutErrorFatal,StdoutWarn,StdoutInfo,StdoutDebug,StdoutTrace
# and for com.some.package.* log everything
log4j.logger.com.some.package=TRACE
log4j.appender.StdoutErrorFatal=org.apache.log4j.ConsoleAppender
log4j.appender.StdoutErrorFatal.layout=org.apache.log4j.PatternLayout
@bangnbx
bangnbx / install-comodo-ssl-cert-for-nginx.rst
Created June 14, 2017 10:17 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"
@bangnbx
bangnbx / nginx.conf
Created January 13, 2017 10:12 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048