Created
July 16, 2017 10:04
-
-
Save yzguy/534bbcbf892d60e5c118c5550f9cf530 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<header> | |
<title>BDX Inc.</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"> | |
<style type="text/css"> | |
</style> | |
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> | |
<!-- Leave those next 4 lines if you care about users using IE8 --> | |
<!--[if lt IE 9]> | |
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |
<![endif]--> | |
</header> | |
<body> | |
<div class="container-fluid"> | |
<div class="row"> | |
<nav class="navbar navbar-default"> | |
<div class="container-fluid"> | |
<div class="navbar-header"> | |
<a class="navbar-brand" href="#">BDX Inc.</a> | |
</div> | |
<ul class="nav navbar-nav"> | |
<li><a href="about.html">About</a></li> | |
<li><a href="contact-us.html">Contact Us</a></li> | |
</ul> | |
<ul class="nav navbar-nav navbar-right"> | |
<li><a href="login.html">Login</a></li> | |
</ul> | |
</div> | |
</nav> | |
</div> | |
</div> | |
<div class="container"> | |
<div class"row"> | |
<div class="col-md-2"></div> | |
<div class="col-md-8"> | |
<div class="alert alert-success" role="alert">You've made it to the best page on the web!</div> | |
</div> | |
<div class="col-md-2"></div> | |
</div> | |
<div class"row"> | |
<div class="col-md-6"> | |
<h1>Welcome!</h1> | |
<p>Here is some text in this column</p> | |
<h3>Some of my favorite foods are:</h3> | |
<ul class="list-group"> | |
<li class="list-group-item">Pizza</li> | |
<li class="list-group-item">Tacos</li> | |
</ul> | |
<button class="btn btn-warning" type="button"> | |
Messages <span class="badge">4</span> | |
</button> | |
<button class="btn btn-primary" type="button"> | |
Followers <span class="badge">100</span> | |
</button> | |
<button class="btn btn-success" type="button"> | |
Following <span class="badge">30</span> | |
</button> | |
</div> | |
<div class="col-md-6"> | |
<h3>Here is a table</h3> | |
<table class="table table-striped table-hover"> | |
<thead> | |
<tr> | |
<th>ID</th> | |
<th>Name</th> | |
<th>Age</th> | |
<th>Usernames</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> | |
<td>1</td> | |
<td>George</td> | |
<td>25</td> | |
<td> | |
<span class="label label-primary"> | |
<span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span> | |
george11 | |
</span> | |
</td> | |
</tr> | |
<tr> | |
<td>2</td> | |
<td>Michael</td> | |
<td>30</td> | |
<td> | |
<span class="label label-warning"> | |
<span class="glyphicon glyphicon-star" aria-hidden="true"></span> | |
iammichael | |
</span> | |
</td> | |
</tr> | |
<tr> | |
<td>3</td> | |
<td>Amanda</td> | |
<td>22</td> | |
<td> | |
<span class="label label-danger"> | |
<span class="glyphicon glyphicon-heart" aria-hidden="true"></span> | |
amanaplanamanda | |
</span> | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
<h3>Here is a panel</h3> | |
<div class="panel panel-info"> | |
<div class="panel-heading">News</div> | |
<div class="panel-body"> | |
<p>Weather in Portland is super rainy...big surprise</p> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-6"> | |
<div class="panel panel-primary"> | |
<div class="panel-heading">Golang Code Sample</div> | |
<div class="panel-body"> | |
<pre> | |
package main | |
import ( | |
"fmt" | |
"os" | |
"strings" | |
) | |
var ( | |
input = os.Args[1] | |
) | |
func main() { | |
fmt.Println(sPoNgEbOb(input)) | |
} | |
func sPoNgEbOb(input string) (output string) { | |
for i, v := range input { | |
s := string(v) | |
if i%2 == 0 { | |
output += strings.ToLower(s) | |
} else { | |
output += strings.ToUpper(s) | |
} | |
} | |
return | |
} | |
</pre> | |
</div> | |
</div> | |
</div> | |
<div class="col-md-6"> | |
<div class="panel panel-danger"> | |
<div class="panel-heading">Ruby Code Sample</div> | |
<div class="panel-body"> | |
<pre> | |
# Validate Action | |
VALID_ACTIONS = %w(start stop restart forward show).freeze | |
if VALID_ACTIONS.include?(opts[:action]) | |
action = opts[:action] | |
# Validate other args if forwarding | |
if action.eql?('forward') | |
# Validate Forward Action | |
if opts[:add] | |
forward_action = 'add' | |
elsif opts[:delete] | |
forward_action = 'delete' | |
end | |
# Validate Protocol | |
VALID_PROTOCOLS = %w(tcp udp).freeze | |
if VALID_PROTOCOLS.include?(opts[:protocol]) | |
protocol = opts[:protocol] | |
end | |
# Validate IP Address | |
if opts[:ip] =~ Resolv::IPv4::Regex | |
ip = opts[:ip] | |
end | |
# Validate Port | |
if opts[:port].between?(1, 65_535) | |
port = opts[:port].to_s | |
end | |
end | |
end | |
</pre> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-6"> | |
<div class="panel panel-warning"> | |
<div class="panel-heading">Python Code Sample</div> | |
<div class="panel-body"> | |
<pre> | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
from flask_script import Manager, Server | |
from flask_migrate import Migrate, MigrateCommand | |
from flask_bootstrap import Bootstrap | |
app = Flask(__name__) | |
app.config.from_object('config') | |
db = SQLAlchemy(app) | |
migrate = Migrate(app, db) | |
manager = Manager(app) | |
manager.add_command('runserver', Server(host='0.0.0.0', port=5000)) | |
manager.add_command('db', MigrateCommand) | |
bootstrap = Bootstrap(app) | |
from . import models | |
from . import views | |
from .views import address | |
from .views import subnet | |
app.register_blueprint(subnet, url_prefix='/subnet') | |
app.register_blueprint(address, url_prefix='/address') | |
</pre> | |
</div> | |
</div> | |
<div class="dropdown"> | |
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> | |
Dropdown | |
<span class="caret"></span> | |
</button> | |
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> | |
<li><a href="#">Action</a></li> | |
<li><a href="#">Another action</a></li> | |
<li><a href="#">Something else here</a></li> | |
<li role="separator" class="divider"></li> | |
<li><a href="#">Separated link</a></li> | |
</ul> | |
</div> | |
</div> | |
<div class="col-md-6"> | |
<div class="panel panel-info"> | |
<div class="panel-heading">Bash Code Sample</div> | |
<div class="panel-body"> | |
<pre> | |
IPT=$(which iptables) | |
tcp_ports_in=() | |
tcp_ports_out=() | |
udp_ports_in=() | |
udp_ports_out=() | |
echo "" | |
echo "Set Policies to Allow" | |
echo "-----------------------" | |
$IPT -P INPUT ACCEPT | |
$IPT -P FORWARD ACCEPT | |
$IPT -P OUTPUT ACCEPT | |
echo -e "Policies Set [ \e[32mDONE\e[39m ]" | |
echo "" | |
echo "Flushing Existing Rules" | |
echo "-----------------------" | |
$IPT -F; echo -e "Rules Flushed [ \e[32mDONE\e[39m ]" | |
sleep 1; echo "" | |
if [ "$1" == "reset" ] | |
then | |
exit 0 | |
fi | |
echo "Setting Basic Rules" | |
echo "-------------------" | |
# Allow in/out all Related or Established traffic | |
$IPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
$IPT -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
# Always allow SSH | |
$IPT -A INPUT -p tcp --dport 22 -j ACCEPT | |
$IPT -A OUTPUT -p tcp --sport 22 -j ACCEPT | |
# Localhost Rules | |
$IPT -A INPUT -i lo -j ACCEPT | |
$IPT -A OUTPUT -o lo -j ACCEPT | |
</pre> | |
</div> | |
</div> | |
<div> | |
</div> | |
</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment