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
import hashlib, hmac, base64, struct, time, math | |
def GoogleTOTP(s): | |
msg = int(math.floor(time.time()/30)) | |
hm = hmac.new(base64.b32decode(s), struct.pack('>q', msg), hashlib.sha1).digest() | |
offs = ord(hm[-1]) & 0xF | |
code = str(((struct.unpack('>L',hm[offs:offs+4])[0]) & 0x7FFFFFFF) % 1000000).zfill(6) | |
return code | |
print GoogleTOTP("") |
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
#!python | |
import RPi.GPIO as GPIO | |
import time | |
import sys | |
GPIO.setmode(GPIO.BOARD) | |
bint = 3 |
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
#!/usr/bin/env python | |
import sys, time | |
id = 1234567890 | |
lfsr = 0xDEADBEEF | |
def lfsrN(lfsr, count): | |
#0b10101010101 | |
#0x80000417, 0b10000000 00000000 0000 0100 0001 0111 |
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
#!/usr/bin/env python | |
import random, sys | |
def distribute(parts, value): | |
total = sum(parts) | |
min_value = len(parts) | |
if ((value < min_value) or (value > total)): | |
return None | |
cur = [1]*len(parts) |
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
#!/usr/bin/env python | |
# | |
# DLink DIR-615 HW:T1 FW:20.07 status. | |
from sys import argv, exit | |
import urllib as u1 | |
import urllib2 as u2 | |
import bs4 | |
# Router IP |
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
#!/usr/bin/env python | |
from subprocess import Popen, PIPE | |
import urllib2 | |
from time import sleep | |
p = Popen(['/sbin/apcaccess'], stdout=PIPE, stderr=PIPE) | |
(o, e) = p.communicate() | |
status = {} |
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
#!/usr/bin/env python | |
import sys, json | |
from gi.repository import Notify | |
sys.path.append("paho-mqtt-1.2/src/") | |
import paho.mqtt.client as mqtt | |
def _on_connect(client, userdata, rc): |
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
#include <SPI.h> | |
#include <Arduino.h> | |
#include "nRF24L01.h" | |
#include "RF24.h" | |
/* Radio */ | |
RF24 radio(5, 4); | |
uint64_t address[] = { 0xF2F2F2F20100 }; |
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
[ | |
{ | |
"port": "1883", | |
"type": "mqtt-broker", | |
"id": "b30f9506.0d2cf", | |
"clientid": "", | |
"broker": "localhost" | |
}, | |
{ | |
"out": [], |
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
[ | |
{ | |
"port": "1883", | |
"type": "mqtt-broker", | |
"id": "b30f9506.0d2cf", | |
"clientid": "", | |
"broker": "localhost" | |
}, | |
{ | |
"wires": [ |