Using Laravel Valet for localhost development, So it installs
dnsmasq
with it. dnsmasq runs on port53
, The default DNS port. So we setup dnscrypt-proxy on port5300
with the default config files in this gist.
brew install dnscrypt-proxy
Using Laravel Valet for localhost development, So it installs
dnsmasq
with it. dnsmasq runs on port53
, The default DNS port. So we setup dnscrypt-proxy on port5300
with the default config files in this gist.
brew install dnscrypt-proxy
#!/bin/bash | |
# Taken from https://blog.mvp-space.com/how-to-dockerize-a-meteor-app-with-just-one-script-4bccb26f6ff0 | |
APP_NAME=myapp | |
APP_DOMAIN=localhost | |
APP_PORT=3000 | |
SETTINGS_PATH=.config/staging/settings.json | |
MONGO_URL=localhost | |
MONGO_PORT=27017 | |
MONGO_DB=myappdb |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import re | |
import json | |
import argparse | |
from datetime import datetime | |
from subprocess import Popen, PIPE | |
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
# Uncomment for socket activation (see below) | |
# Requires=puma.socket | |
[Service] | |
# Foreground process (do not use --daemon in ExecStart or config.rb) | |
Type=simple |
import os | |
import boto.utils | |
import boto3 | |
import requests | |
import datetime | |
import time | |
def get_contents(filename): |
upstream yoursiteName { | |
server 127.0.0.1:9090 max_fails=1; | |
server 127.0.0.1:9091 max_fails=3 backup; | |
server 127.0.0.1:9090 max_fails=3 fail_timeout=600s backup; | |
} | |
server { | |
listen 80; | |
server_name www.yoursite.com.br yoursite.com.br; | |
access_log /var/log/yoursite.access.log main; |
#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.
To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.
##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application
import boto3 | |
print(boto3.client('sts').get_caller_identity()['Account']) |
#!/bin/bash | |
# Example for the Docker Hub V2 API | |
# Returns all imagas and tags associated with a Docker Hub user account. | |
# Requires 'jq': https://stedolan.github.io/jq/ | |
# set username and password | |
UNAME="" | |
UPASS="" |
docker run -d --name es elasticsearch
docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
docker run --link es:elasticsearch -d kibana
LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)