Skip to content

Instantly share code, notes, and snippets.

View misterbastean's full-sized avatar

Josh Bastean misterbastean

  • Levvel, an Endava Company
  • Hartsville, SC
View GitHub Profile
@misterbastean
misterbastean / gist:96961a439f7ff03257c930599e8a6276
Created August 3, 2021 13:45
CS-290: Basic server example for HTTP explanation [pt. 3]
const http = require('http')
const users = [
{id: "_1", name: "Josh"},
{id: "_2", name: "Kim"},
{id: "_3", name: "Nadia"},
]
const server = http.createServer((req, res) => {
res.setHeader("Content-Type", "application/json")
@misterbastean
misterbastean / gist:668f68cdfcdc3a75272d12ec52f94d9e
Created August 3, 2021 13:35
CS-290: Basic server example for HTTP explanation [pt. 2]
const http = require('http')
const server = http.createServer((req, res) => {
res.setHeader("Content-Type", "text/plain")
// res.setHeader("Content-Type", "text/html") // This will tell the browser to render as HTML
// res.setHeader("Content-Type", "application/json") // This is what we'll use in our API
res.write("This is my response data")
res.end()
})
@misterbastean
misterbastean / server.js
Last active August 3, 2021 13:30
CS-290: Basic server example for HTTP explanation
const http = require('http')
const server = http.createServer((req, res) => {
console.log(req)
// console.log("method:", req.method)
// const { method, url, headers } = req
res.end()
})
server.listen(3000, () => console.log("server listening on port 3000"))
#!/bin/bash
# Updated from https://gist.github.com/talkingmoose/f44d0d87d08b48daa0e887a6239c1766
###########################################
# EDIT ME
###########################################
# server connection information
URL="https://www.yourJSS.com"
userName="your_api_user"
password="Pa$$w0rd1"
@misterbastean
misterbastean / pwnCheck.sh
Created March 13, 2019 14:49 — forked from tulgeywood/pwnCheck.sh
pwnCheck
#!/bin/bash
read -rsp 'Password: ' PASSWD
echo
HASH=$(echo -n "$PASSWD" | shasum)
SEARCH=$(echo "${HASH:0:5}" | awk '{print toupper($0)}')
COMPARE=$(echo "$HASH" | tail -c 39)
COMPARE=$(echo "${COMPARE:0:35}" | awk '{print toupper($0)}')
RESPONSE=$(curl -s "https://api.pwnedpasswords.com/range/$SEARCH" | grep "$COMPARE")