A modified Meter widget that sets the background colour to either red or green depending on a threshold.
To use it, use something like this on your dashboard:
<li data-row="1" data-col="3" data-sizex="1" data-sizey="1">
This is a modified version of the Time Since Last widget by hannesfostie that is a bit simplified and with the red-green inverted (goes red when too much time has passed).
It does not use HTML local storage (no need, the server remembers it for us) and the threshold is just called 'threshold' and it is in hours.
import pygtk | |
pygtk.require('2.0') | |
import gtk | |
import urllib | |
import gobject | |
import threading | |
STREAM_URL = 'http://10.10.1.1:8196/' | |
class VideoThread(threading.Thread): |
class Import(valid_string_spec): | |
validators = [regexed("^(?P<module>[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*):(?P<class>[a-zA-Z_][a-zA-Z_0-9]*)$")] | |
def setup(self, checked_class): | |
self.checked_class = checked_class | |
def normalise_filled(self, meta, val): | |
# Run string & regex validator | |
val = super(Import, self).normalise_filled(meta, val) | |
# Now validate it is importable |
#!/usr/bin/env python | |
""" | |
Do a syn scan over a host. | |
To run as non-root: | |
> sudo setcap cap_net_raw=ep /home/michaelc/.virtualenvs/tmp/bin/python2 | |
Sources: | |
- http://www.secdev.org/projects/scapy/doc/usage.html | |
- https://securitylair.wordpress.com/2014/02/21/simple-port-scanner-in-python-with-scapy-2/ |
Video teardown: https://www.youtube.com/watch?v=4uUUDYiGjno
When I plug the watch into the computer, it appears as a single USB MicroSD Storage device with idVendor=05e3 idProduct=0741
.
Nothing stands out as interesting, just a standard IN and OUT endpoint.
from picamera import PiCamera | |
from io import BytesIO | |
import socket | |
import time | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
with PiCamera(resolution='VGA', framerate=5) as camera: | |
time.sleep(2) |
from zfec.easyfec import Encoder, Decoder | |
import random | |
# 5 correction blocks for every 20 blocks | |
enc = Encoder(20, 25) | |
dec = Decoder(20, 25) | |
# Dummy payload | |
data = ' '.join(str(x) for x in range(100)) |
#include "sccb.h" | |
#include <driver/ledc.h> | |
#define PIN_XCLK 18 // Clock provided to camera | |
#define PIN_RESET 5 // Reset pin. | |
#define OV7670_ADDR (0x21) | |
#define OV7670_REG_PID (0x0A) | |
#define OV7670_REG_VER (0x0B) | |
#define OV7670_REG_MIDH (0x1c) |
#include <WiFi.h> | |
#include "wifi_headers.h" | |
#include <esp_wifi.h> | |
//#include <esp_wifi_internal.h> | |
#include <lwip/err.h> | |
typedef union { | |
uint8_t fix_rate; | |
uint8_t b5; | |
uint8_t b4; |