Original by chriscook8 from esp8266.com I just modified to use ESP8266WebServer library for easy to handle the http request.
This is sample code not yet complete.
- when Wifi connected need to close the softAP.
import PySide.QtCore as QtCore | |
import PySide.QtGui as QtGui | |
from nukescripts import panels | |
## https://docs.thefoundry.co.uk/nuke/70/pythonreference/nukescripts.panels-module.html | |
class PanelTest(QtGui.QWidget): | |
def __init__(self, parent=None): | |
QtGui.QWidget.__init__(self, parent) | |
self.setLayout(QtGui.QVBoxLayout()) |
# will forcibly remove the docker container by stopping it and then build new from current location | |
docker rm -f `docker ps -q -a` ; docker build -t armin:v1 . | |
# will run the newly built container and then enter container's bash shell of container. | |
docker exec -it `docker run -itd armin:v1` bash |
#!/usr/bin/env python | |
""" | |
A simple wrapper around rsync for backup. | |
Usage: create a text file with on each line a resource that you wish to | |
backup. Paths should be relative to the user's home directory. Entries | |
starting with '#' are ignored, as are blank lines. Call this script via | |
python backup_script.py -i [backup_files.txt] [rsync_target_folder] |
@contextlib.contextmanager | |
def profileYo(toolName, showGraph=False): | |
profiler = cProfile.Profile() | |
profiler.enable() | |
profilePath = "/tmp/%s_Profile" % toolName | |
dotPath = "/tmp/gprof.dot" | |
pdfPath = "/tmp/%s_Profile.pdf" % toolName | |
yield |
# | |
# Based upon the NCSA server configuration files originally by Rob McCool. | |
# | |
# This is the main Apache server configuration file. It contains the | |
# configuration directives that give the server its instructions. | |
# See http://httpd.apache.org/docs/2.2/ for detailed information about | |
# the directives. | |
# | |
# Do NOT simply read the instructions in here without understanding | |
# what they do. They're here only as hints or reminders. If you are unsure |
#include <iostream> | |
#include <sstream> | |
#include <stdio.h> | |
#include <string.h> | |
using namespace std; | |
char* getSql() { | |
float outdoorTempInC = 15; | |
int outoorHumidity = 23; |
/* | |
Web Server returning data as JSON-P, adapted from http://arduino.cc/en/Tutorial/WebServer | |
A simple web server that returns the value of the analog input pins as | |
a JSON-P object, using an Arduino Wiznet Ethernet shield. | |
Circuit: | |
* Ethernet shield attached to pins 10, 11, 12, 13 (standard configuration) | |
* Analog inputs attached to pins A0 through A5 (optional) | |
* Example of reading LM35 on pin A0: |
<html> | |
<head> | |
<title>Google Gauge Example displayData from sparkfun</title> | |
<style type="text/css"> | |
body { background-color: #ddd; } | |
#container { height: 100%; width: 100%; display: table; } | |
#inner { vertical-align: middle; display: table-cell; } | |
#gauge_div { width: 120px; margin: 0 auto; } | |
</style> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script> |
<html> | |
<head> | |
<title>Google Gauge - ThingSpeak Example</title> | |
<style type="text/css"> | |
body { background-color: #ddd; } | |
#container { height: 100%; width: 100%; display: table; } | |
#inner { vertical-align: middle; display: table-cell; } | |
#gauge_div { width: 120px; margin: 0 auto; } | |
</style> |