Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
#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:
@anoochit
anoochit / wordpress.service
Last active August 29, 2015 14:11
wordpress.service
[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
@anoochit
anoochit / circleci.yaml
Created December 19, 2014 06:35
example circleci.yaml
machine:
services:
- docker
dependencies:
override:
- docker info
- docker build -t anoochit/elasticsearch .
test:
@anoochit
anoochit / wp
Created December 30, 2014 12:33
nginx wordpress multisite
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 ;
}
@anoochit
anoochit / init.lua
Last active February 13, 2020 07:48
init.lua for connect to wifi
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...")
@anoochit
anoochit / blink.lua
Created January 30, 2015 03:10
blink for nodemcu
@anoochit
anoochit / httpserver-gpio.lua
Created January 30, 2015 04:59
httpserver.lua
-- 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
@anoochit
anoochit / httpserver.lua
Created January 30, 2015 05:00
httpserver.lua
-- 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)
@anoochit
anoochit / init.lua
Last active August 29, 2015 14:15
nodemcu dht22 init file
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...")
@anoochit
anoochit / dht22.lua
Created February 9, 2015 14:24
nodemcu dht22 module
-- ***************************************************************************
-- 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 = ...