Assuming you have Python installed on your system:
pip install twisted
pip install pyOpenSSL
pip install service_identity
while true | |
do | |
t=$(cat /sys/class/thermal/thermal_zone0/temp) | |
t=$(($t/1000)) | |
echo Teplota CPU $t | |
mosquitto_pub -h mqtt.sh.cvut.cz -t linuxdays/raspberry/temperature -m "$t °C" | |
sleep 5 | |
done |
To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.
For example;
docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
<?php | |
/* | |
* PHP Example for Google Storage Up- and Download | |
* with Google APIs Client Library for PHP: | |
* https://github.com/google/google-api-php-client | |
*/ | |
include( "Google/Client.php" ); | |
include( "Google/Service/Storage.php" ); |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Handlebars Partials Example</title> | |
</head> | |
<body> | |
<h1>Handlebars Partials Example!</h1> | |
<div id="list"> | |
</div> |
private static function iv() | |
{ | |
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC); | |
return mcrypt_create_iv($iv_size, MCRYPT_RAND); | |
} | |
static function encrypt($str, $key32) | |
{ | |
# Prepend 4-chars data hash to the data itself for validation after decryption | |
$str = substr(md5($str), 0, 4).$str; |
import json | |
import requests | |
# Authentication for user filing issue (must have read/write access to | |
# repository to add issue to) | |
USERNAME = 'CHANGEME' | |
PASSWORD = 'CHANGEME' | |
# The repository to add this issue to | |
REPO_OWNER = 'CHANGEME' |
<?php | |
/** | |
* | |
* The MQTTClient class allows you to connect to an MQTT message broker and publish messages | |
* @author [email protected] | |
* | |
* Example use | |
* $client = new MQTTClient("robphptest","realtime.ngi.ibm.com",1883); | |
* $client->connect(); |