1.- Create new Log Group in CloudWatch
2.- Download agent in EC2 instance
sudo wget http://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py
import std.algorithm; | |
import std.range; | |
ubyte charCode(dchar c) pure { | |
switch (c) { | |
case '<': return 0; | |
case 'A': .. case 'Z': return cast(ubyte)(c - 'A' + 10); | |
case '0': .. case '9': return cast(ubyte)(c - '0'); | |
default: assert(0); | |
} |
# | |
# postgres cluster in kubernetes with max 8 replicas | |
# | |
# the master is always on ${host}-0 | |
# | |
# | |
# postgres master/slave configuration | |
# |
#!/bin/bash -e | |
yum update -y | |
yum install -y aws-cfn-bootstrap git aws-cli | |
# Install the files and packages from the metadata | |
/opt/aws/bin/cfn-init -v --stack "{{ aws_stack_name }}" \ | |
--resource ECSInstanceLaunchConfiguration \ | |
--configsets ConfigCluster \ | |
--region "{{ ref('AWS::Region') }}" |
#!/bin/bash | |
############################################################################## | |
# | |
# | |
# FILE : linux-explorer.sh | |
# Last Change Date : 04-07-2016 | |
# Author(s) : Joe Santoro | |
# Date Started : 15th April, 2004 | |
# Email : linuxexplo [ at ] unix-consultants.com | |
# Web : http://www.unix-consultants.com/examples/scripts/linux/linux-explorer |
import io | |
import os | |
# export GOOGLE_APPLICATION_CREDENTIALS=/home/oops/github/gcloud/GCP-ML-8492a87b7f32.json | |
# Imports the Google Cloud client library | |
from google.cloud import vision | |
# Instantiates a client | |
vision_client = vision.Client() |
#!/usr/bin/env bash | |
# | |
# Install HAProxy | |
# Script works on Ubuntu 12.04 and 14.04 only | |
set -e | |
set -u | |
set -o pipefail |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: haproxy | |
# Required-Start: $local_fs $network $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: fast and reliable load balancing reverse proxy | |
# Description: This file should be used to start and stop haproxy. | |
### END INIT INFO |
var fs = require('fs'); | |
var net = require('net'); | |
var http = require('http'); | |
var https = require('https'); | |
var httpAddress = '/path/to/http.sock'; | |
var httpsAddress = '/path/to/https.sock'; | |
fs.unlinkSync(httpAddress); | |
fs.unlinkSync(httpsAddress); |