Skip to content

Instantly share code, notes, and snippets.

@udomsak
udomsak / build-watchman.txt
Last active January 7, 2017 11:06
build facebook watchman
# #Ubuntu Installation ##
apt-get install -y git build-essential automake python-dev make
git clone https://github.com/facebook/watchman.git
cd watchman
git checkout v4.7.0 # the latest stable release
./autogen.sh
./configure
make
make install
@udomsak
udomsak / nomad-client-agent-self.json
Created February 15, 2017 05:23
nomad clinet /v1/agent/self ( HTTP port 4646 )
{
"config": {
"Addresses": {
"HTTP": "10.0.2.15",
"RPC": "10.0.2.15",
"Serf": "10.0.2.15"
},
"AdvertiseAddrs": {
"HTTP": "10.0.2.15:4646",
"RPC": "10.0.2.15:4647",
@udomsak
udomsak / nomad-client-nodes.json
Created February 15, 2017 05:26
nomad client HTTP GET port 4646/v1/nodes
[
{
"ID": "b26dba01-d6d1-a742-b6a9-94140ede2739",
"Datacenter": "dc1",
"Name": "nomad-client",
"NodeClass": "",
"Drain": false,
"Status": "ready",
"StatusDescription": "",
"CreateIndex": 55,
pvcreate /dev/sdd
# create a volume group named 'docker' (replace /dev/sdd with your block device)
vgcreate docker /dev/sdd
# create a thin pool named 'thinpool'; in this example, the data LV is 95% of the 'docker' volume group size (leaving free space allows for auto expanding of either the data or metadata if space is runs low as a temporary stopgap)
lvcreate --wipesignatures y -n thinpool docker -l 95%VG
lvcreate --wipesignatures y -n thinpoolmeta docker -l 1%VG
# convert the pool to a thin-pool
authoritative;
ddns-updates on;
ddns-update-style interim;
ddns-rev-domainname "in-addr.arpa.";
option domain-name-servers 8.8.8.8;
option ntp-servers us.pool.ntp.org;
ignore client-updates;
[unix_http_server]
file=/tmp/supervisor.sock ; the path to the socket file
[supervisord]
logfile=/tmp/supervisord.log ; main log file; default $CWD/supervisord.log
logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB
logfile_backups=10 ; # of main logfile backups; 0 means none, default 10
loglevel=info ; log level; default info; others: debug,warn,trace
pidfile=/tmp/supervisord.pid ; supervisord pidfile; default supervisord.pid
sudo apt-get install -y git curl nginx-full
sudo apt-get install -y php5-fpm php5-cli php5-curl php5-intl php5-json
sudo apt-get install -y php5-intl php5-xdebug php5-curl php5-ldap
sudo apt-get install -y mongodb-org php5-mongo
sudo apt-get install -y libav-tools libavcodec-extra
server {
client_max_body_size 2000m;
client_body_buffer_size 128k;
server_name pumuki.example.com _;
root /home/www-user/domains/pumukit.example.com/public_html/web;
@udomsak
udomsak / consul.service
Created December 2, 2017 08:54
systemd unit for consul for zerotier auto DNS , dynamic Zerotier service-discovery
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/default/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment ZEROTIER_IP=$(nmcli connection show zt0 |grep IP4.ADDRESS |awk '{print $
upstream static-server1 {
server 127.0.0.1:8888;
}
# Simple static serv content
server {
listen 127.0.0.1:8888;
root /storage/cdn/cdn1.softsq.com;
autoindex on;