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
@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 / nmapper.rb
Last active August 29, 2015 14:11 — forked from kenichi/nmapper.rb
require 'sinatra/base'
require 'celluloid'
class Nmapper
include Celluloid
def nmap opts = ''
`nmap #{opts}`
end
end
@BrentonEarl
BrentonEarl / Rakefile
Last active August 29, 2015 14:11 — forked from tarynsauer/Rakefile
Automatically creates unit test files using "rake generate:test NAME=test_name and puts them in the test/ directory
namespace :generate do
desc "Add new Unit Test file"
task :test do
unless ENV.has_key?('NAME')
raise "Must specify a unit test file name, e.g., rake generate:test NAME=test_name"
end
unit_test_path = "test/" + ENV['NAME'].downcase + "_test.rb"
@BrentonEarl
BrentonEarl / Rakefile
Last active August 29, 2015 14:10 — forked from ream88/Rakefile
Minitest Rakefile with :test set to default
require 'rake/testtask'
Rake::TestTask.new do |t|
t.pattern = 'test/*_test.rb'
end
task(default: :test)