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
import obd | |
import re | |
def raw_to_data_array(inp): | |
lines = inp.split("\n") | |
dat = {} | |
for l in lines: | |
ldat = re.findall('..',l[3:]) | |
dat[ldat[0]] = [int(x,16) for x in ldat[1:]] | |
return dat |
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
stmt = "((p and (not q)) or (q and (not p))) or r" | |
# |p |q |r |p = q |(p = q) IMPLIES r | | |
# |True |True |True |True |True | | |
# |True |True |False |True |False | | |
# |True |False |True |False |True | | |
# |True |False |False |False |True | | |
# |False |True |True |False |True | | |
# |False |True |False |False |True | | |
# |False |False |True |True |True | |
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
var w = require("ws"); | |
var c = new w("wss://gsv.gocode.it:5453",{rejectUnauthorized:false,headers:{"origin":"https://gocode.it"}}); | |
c.on("open",()=>{ | |
c.send("0|aaaaaaaa|undefined") | |
c.send("3|0") | |
setInterval(s.bind(this,c),100); | |
}); | |
function s(c){ | |
setTimeout(c.send.bind(c,"6|aaaaaaaaaa|0"),100); | |
} |
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
from lxml import etree | |
import sys | |
import os | |
if len(sys.argv) != 2: | |
sys.exit("Make sure to put the path of the file as an argument. Or to drag the file into the script.") | |
# the input is what we get as an argument, the ouput is that same file, in that same location, | |
# with .xml instead of its current extension |
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
import socket, sys, threading | |
import paramiko | |
import pwd | |
import base64 | |
from paramiko.py3compat import b, u, decodebytes | |
from binascii import hexlify | |
#generate keys with 'ssh-keygen -t rsa -f server.key' | |
HOST_KEY_RSA = paramiko.RSAKey(filename='rsa.key') | |
#HOST_KEY_ECDSA = paramiko.ECDSAKey(filename='ecdsa.key') |
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
stmt = "((A IMPLIES B) IMPLIES C) AND (A OR (D AND B))" | |
def tokenize(stmt): | |
tokenstrs = {} | |
i = 0 | |
done = False | |
curtoken = "" | |
curId = 0 | |
prevtokens = [] |
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
import Foundation | |
let bytes = 16 | |
let rows = 8 | |
let sep = 4 | |
let bytesPointer = UnsafeMutableRawPointer.allocate(bytes: 1, alignedTo: 1) | |
bytesPointer.storeBytes(of: 0xff, as: UInt8.self) | |
var c = 0 | |
var a = 0 |