Skip to content

Instantly share code, notes, and snippets.

View Harper04's full-sized avatar

Tom Jaster Harper04

View GitHub Profile
@Harper04
Harper04 / arduino_i2c_pt1000.sketch
Last active May 1, 2019 20:23
how to read B+B pt1000 type r2 sensor with arduino
#include <Wire.h>
void setup() {
Serial.begin(9600);
Wire.begin();
Serial.println("Reading");
}
int reading = 0;
void loop() {
@Harper04
Harper04 / adfs_ntlm_jira_login.js
Created February 25, 2018 11:09
Get an JIRA Session Cookie by logging in with ADFS using SAML with NTLM Auth
import * as request from "request-promise-native"
import { ntlm } from "httpntlm"
import { HttpsAgent } from "agentkeepalive"
async function go(username, password) {
const cookies = request.jar()
const adfsSignOnUri = ADFS_INIT_SIGNON_URL
const adfsRedirectUri = ADFS_REDIRECTING_URL
const adfsLoginResponse = await request.post(
@Harper04
Harper04 / kerberos.js
Created February 24, 2018 17:56
how to use your machines kerberos to get a authenticate http header
import { Kerberos } from 'kerberos'
const kerberos = new Kerberos()
const kerberosToken = await new Promise((resolve, reject)=>{
kerberos.authGSSClientInit("krbtgt@*******", 0, function(err, ctx) {
if (err) {
return reject(err)
}
kerberos.authGSSClientStep(ctx, "", function (err) {