Skip to content

Instantly share code, notes, and snippets.

@BrentonEarl
BrentonEarl / c7-nat-router.sh
Created August 15, 2018 15:53 — forked from walbert947/c7-nat-router.sh
Configure a simple IPv4 NAT router on CentOS 7
# NOTE: This gist includes the '.sh' extension to enable syntax highlighting
# on the gist web viewer. However, it is NOT intended to be run as a script.
# These are just notes I took.
################################################################################
#
# CentOS 7 - Simple IPv4 NAT Router
#
# This gist provides a brief walkthough on setting up a simple NAT router on
# CentOS 7 that will allow multiple machines on an internal network to share
@BrentonEarl
BrentonEarl / audit.rules
Created July 28, 2018 18:26 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
#
# Linux Audit Daemon - Best Practice Configuration
# /etc/audit/audit.rules
#
# Compiled by Florian Roth
#!/usr/bin/env ruby
require 'redcarpet'
md_file = File.read(ARGV.first)
html_filename = File.basename(ARGV.first, ".md") + ".html"
File.open(html_filename, 'w') do |file|
file.write(Redcarpet::Markdown.new(Redcarpet::Render::HTML.new).render(md_file))
end
@BrentonEarl
BrentonEarl / sinatra+thin+ssl.rb
Created December 22, 2016 20:57 — forked from TakahikoKawasaki/sinatra+thin+ssl.rb
Sinatra + Thin + SSL
#!/usr/bin/env ruby
#
# This code snippet shows how to enable SSL in Sinatra+Thin.
#
require 'sinatra'
require 'thin'
class MyThinBackend < ::Thin::Backends::TcpServer
def initialize(host, port, options)
@BrentonEarl
BrentonEarl / sinatra+ssl.rb
Created December 22, 2016 20:56 — forked from TakahikoKawasaki/sinatra+ssl.rb
Sinatra + SSL
#!/usr/bin/env ruby
#
# This code snippet shows how to enable SSL in Sinatra.
#
require 'sinatra/base'
class Application < Sinatra::Base
configure do
set :bind, '0.0.0.0'
@BrentonEarl
BrentonEarl / login.rb
Created December 20, 2016 22:26 — forked from amscotti/login.rb
Sample of Sinatra authentication
require 'rubygems'
require 'bcrypt'
require 'haml'
require 'sinatra'
enable :sessions
userTable = {}
helpers do
@BrentonEarl
BrentonEarl / gist:15ec2ca3f9d229df78270d7f6a7ccbd5
Created July 28, 2016 15:37
GeoIP configuration setting for Vidalia and Tor
[General]
UseLocalGeoIpDatabase=true
LocalGeoIpDatabase=/var/lib/GeoIP/GeoIP.dat
[..snip..]
@BrentonEarl
BrentonEarl / gist:7194890cf3a4d6d09c44c3f17dc78e7d
Created July 28, 2016 15:29
Generate tor control port password
tor --hash-password <YOUR_PASSWORD_HERE>
User tor
RunAsDaemon 1
PidFile /var/run/tor/tor.pid
DataDirectory /var/lib/tor
Log notice file /var/log/tor/tor.log
SafeSocks 1
TestSocks 1
CircuitBuildTimeout 2
@BrentonEarl
BrentonEarl / gist:a21f3c1c9f08bcbfe5d860bbda04c6e7
Last active July 28, 2016 15:34
Install tor, vidalia, GeoIP with sbopkg on Slackware
sqg -p tor
sqg -p vidalia
sqg -p GeoIP
sbopkg -i "tor vidalia GeoIP"