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
#cloud-config | |
coreos: | |
etcd: | |
discovery: https://discovery.etcd.io/2ff216654df841f09b76715109594100 | |
addr: $private_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
fleet: | |
public-ip: $private_ipv4 | |
units: |
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
[Unit] | |
Description=WordPress | |
After=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
ExecStartPre=-/usr/bin/docker kill wordpress | |
ExecStartPre=-/usr/bin/docker rm wordpress | |
ExecStartPre=/usr/bin/docker pull tutum/wordpress | |
ExecStart=/usr/bin/docker run -P -d --name wordpress tutum/wordpress |
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
machine: | |
services: | |
- docker | |
dependencies: | |
override: | |
- docker info | |
- docker build -t anoochit/elasticsearch . | |
test: |
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
server { | |
listen [::]:80 ipv6only=off; | |
server_name fffee.org *.fffee.org; | |
root /usr/share/nginx/wordpress; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php?$args ; | |
} |
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
if true then --change to if true | |
print("set up wifi mode") | |
wifi.setmode(wifi.STATION) | |
--please config ssid and password according to settings of your wireless router. | |
wifi.sta.config("ssid","password") | |
wifi.sta.connect() | |
cnt = 0 | |
tmr.alarm(1, 3000, 1, function() | |
if (wifi.sta.getip() == nil) and (cnt < 20) then | |
print("IP unavaiable, Waiting...") |
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
-- Blink using timer alarm -- | |
timerId = 0 | |
dly = 2000 | |
ledPin = 3 | |
gpio.mode(ledPin,gpio.OUTPUT) | |
ledState = 0 | |
tmr.alarm( timerId, dly, 1, function() | |
ledState = 1 - ledState; | |
gpio.write(ledPin, ledState) | |
end) |
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
-- a simple http server | |
srv=net.createServer(net.TCP) | |
srv:listen(80,function(conn) | |
conn:on("receive",function(conn,payload) | |
--print(payload) | |
i,j=string.find(payload, "/d2/1", 1) | |
--print(i) | |
pin=2 | |
gpio.mode(pin,gpio.OUTPUT) | |
if (i==nil) then |
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
-- a simple http server | |
srv=net.createServer(net.TCP) | |
srv:listen(80,function(conn) | |
conn:on("receive",function(conn,payload) | |
print(payload) | |
conn:send("<h1> Hello, NodeMcu.</h1>") | |
end) | |
end) |
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
if true then --change to if true | |
print("set up wifi mode") | |
wifi.setmode(wifi.STATION) | |
--please config ssid and password according to settings of your wireless router. | |
wifi.sta.config("ssid","password") | |
wifi.sta.connect() | |
cnt = 0 | |
tmr.alarm(1, 3000, 1, function() | |
if (wifi.sta.getip() == nil) and (cnt < 20) then | |
print("IP unavaiable, Waiting...") |
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
-- *************************************************************************** | |
-- DHT22 module for ESP8266 with nodeMCU | |
-- | |
-- Written by Javier Yanez | |
-- but based on a script of Pigs Fly from ESP8266.com forum | |
-- | |
-- MIT license, http://opensource.org/licenses/MIT | |
-- *************************************************************************** | |
local moduleName = ... |