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
#!/bin/bash | |
# Setup CentOS 7 host as AMI | |
# Update base OS update, and install EPEL repo and Python Pip | |
sudo yum -y update | |
sudo yum –y install epel-release | |
sudo yum -y install python-pip | |
# Install Python add-ons: | |
sudo pip install pystache |
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
1. Find ID of container to move | |
`docker ps -a` or `docker images` | |
2. Save container as new image: | |
`docker save [newimage] | gzip > /tmp/docker-[newimage].tar.gz` | |
3. Copy file, `/tmp/docker-[newimage].tar.gz`, to destination and gunzip | |
4. Load new image: | |
`docker load --input docker-[newimage].tar` |
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
#!/bin/bash | |
# CoreOS channel ["stable" | "beta" | "alpha"] | |
channel=${1:-"alpha"} | |
# AWS AMI disk backing ["pv" | "hvm"] | |
disk=hvm | |
# Use default us-east-1 region | |
region=${2:-"us-east-1"} |
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
#!/bin/bash | |
# Set locale: this is required by the standard Mesos startup scripts | |
echo "info: Setting locale to en_US.UTF-8..." | |
locale-gen en_US.UTF-8 > /dev/null 2>&1 | |
# Start syslog if not started.... | |
echo "info: Starting syslog..." | |
service rsyslog start > /dev/null 2>&1 |
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
# ##################################################################### | |
# DESC: Logstash configuration file. Typically forwarding logs to | |
# Elasticsearch instance. | |
# ##################################################################### | |
# Where to get input | |
input { | |
# Get input from Redis queue | |
redis { | |
data_type => "list" |
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
# ##################################################################### | |
# DESC: Logstash configuration file. Typically forwarding logs to | |
# Elasticsearch instance. | |
# ##################################################################### | |
# Where to get input | |
input { | |
# Get input from Apache logs | |
file { | |
type => "apache-access" |
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
# syslog/relp | |
grok { | |
match => { "@message" => "(?:%{INT:syslog6587_msglen} )?<%{POSINT:syslog_pri}>(?:%{NONNEGINT:syslog5424_ver} )?(?:%{SYSLOGTIMESTAMP:syslog_timestamp}|%{TIMESTAMP_ISO8601:syslog_timestamp}) %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?(:)? %{GREEDYDATA:syslog_message}" } | |
add_field => [ "received_at", "%{@timestamp}" ] | |
add_field => [ "received_from", "%{host}" ] | |
add_tag => [ "syslog_standard" ] | |
tag_on_failure => ["_grokparsefailure-syslog_standard"] | |
} |
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
#!/usr/bin/env python3 | |
# Copyright 2015 Open Source Robotics Foundation, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
#! /bin/bash | |
echo "Removing exited docker containers..." | |
docker rm -v $(docker ps -a -f status=exited -q) | |
echo "Removing untagged images..." | |
docker rmi $(docker images --no-trunc | grep "<none>" | awk '{print $3}') | |
echo "Removing unused docker images" | |
images=($(docker images | awk '{print $1":"$2}')) |
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
upstream kibana { | |
server 127.0.0.1:5601 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
return 301 https://example.com; | |
} | |
server { |