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
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") |
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
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() | |
}) |
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
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")) |
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
#!/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" |
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
#!/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") |