Layer | Name | Format | Function | Example Protocol | Address Type |
---|---|---|---|---|---|
1 | Physical | Bit | Raw bits on physical medium | TIA-323-F, DOCSIS | N/A |
2 | Data Link | Frame | Node-To-Node Communication | MPLS | MAC Address |
3 | Network | Packet | Routing and addressing | IP, IGMP | IP Address |
4 | Transport | Protocol Data Unit (PDU) -- Segment | End-To-End Integrity | TCP, UDP | Port |
5 | Session | Data | Connection Dialog | SOCKS, RPC | Socket |
6 | Presentation | Data | Data Representation | XDR, SMB | Hostname |
7 | Application | Data | Interactions with user | FTP | Hostname |
This file contains hidden or 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
// Problem Statement: | |
// Find out how to calculate Thanksgiving in a given year | |
// Credits: https://coffeescript-cookbook.github.io/chapters/dates_and_times/date-of-thanksgiving | |
// SOLUTION: | |
const isDateInPast = (_date) => { | |
const now = new Date() | |
const nowInt = Date.parse(now) | |
const dateInt = Date.parse(_date) | |
return nowInt - dateInt > 0 |
This file contains hidden or 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
const calculateTimeLeft = (month, day) => { | |
const now = new Date() | |
const nowInt = Date.parse(now) | |
const year = new Date().getFullYear() | |
const toDate = new Date(`${month}/${day}/${year}`) | |
const toDateInt = Date.parse(toDate) | |
const diff = toDateInt - nowInt | |
console.log(diff); |
This file contains hidden or 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
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
goqu "github.com/doug-martin/goqu/v9" | |
_ "github.com/go-sql-driver/mysql" |
This file contains hidden or 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
1) getText should return the text of multiple elements: | |
Error: java.net.SocketException: Connection reset | |
at new RuntimeError (lib/utils/ErrorHandler.js:104:12) | |
at Request._callback (lib/utils/RequestHandler.js:253:35) | |
at Request.self.callback (node_modules/request/request.js:186:22) | |
at Request.<anonymous> (node_modules/request/request.js:1163:10) | |
at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12) | |
at endReadableNT (_stream_readable.js:1056:12) | |
at _combinedTickCallback (internal/process/next_tick.js:138:11) | |
at process._tickDomainCallback (internal/process/next_tick.js:218:9) |
This file contains hidden or 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
# Demo Perf Stuff | |
### Have slide show open | |
1. Welcome folks. | |
2. Explain the current situation (our present Jmeter set up and the difficulties) | |
3. Explain what blazemeter and taurus are | |
4. Show them your report in blaze in it’s failing slow state and ask you to check a change in | |
5. Show them a barebones test | |
6. Show them a barebones Jenkinsfile |
This file contains hidden or 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
# Update EC2 Linux package manager | |
sudo yum update -y | |
# Use package manager to install docker | |
sudo yum install -y docker | |
# Use Linux service to start docker service | |
sudo service docker start | |
# Ensure ec2-user has rights to perform docker commands | |
sudo usermod -a -G docker ec2-user | |
# Pull image | |
sudo docker pull mattc41190/tomdog |
This file contains hidden or 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
# Tell docker to build an image called/tagged as mattc41190/tomdog and to use the durrent dir and context for the Dockerfile | |
docker build -t mattc41190/tomdog . | |
# Tell docker to run a container (in detatched made `d`) based on the tomdog | |
# image and to expose port 80 on the container to the host machine | |
docker run -e "PORT=80" -p 80:80 -d mattc41190/tomdog |
This file contains hidden or 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
# Choose a base image | |
FROM node:8.1.3 | |
# Make a landing zone for our app | |
RUN mkdir app | |
# Copy the contents of the pwd/cwd into the image's /app directory | |
COPY . /app | |
# Go into the /app dir and run npm install | |
RUN cd /app; npm install | |
# Choose some ports to expose to the host machine | |
EXPOSE 3344 80 |
This file contains hidden or 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
'use strict'; | |
const Hapi = require('hapi'); // Server tech | |
const Inert = require('inert'); // Hapi plugin for serving static content | |
const PORT = process.env.PORT || 3344; // Port to run my app on | |
const server = new Hapi.Server(); // Create instance of Server | |
server.connection({ port: PORT}); // Add connection to server | |
server.register(Inert, (err) => { |
NewerOlder