Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/dfetterman/cf7bc4aa53c47fb546c6/raw/e11cd22f41e6cab71fe621b1f5a1377ff3af01ab/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
#! /bin/bash
### BEGIN INIT INFO
# Provides: elasticsearch
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts elasticsearch
# Description: Starts elasticsearch using start-stop-daemon
### END INIT INFO
#converts pushes whatever comes in through redis along to elasticsearch
input {
redis {
'data_type' => "list"
'host' => "127.0.0.1"
'key' => "logstash"
'type' => "syslog"
}
{
"title": "Logstash Server Statistics",
"services": {
"query": {
"idQueue": [
1,
2,
3,
4,
5,
{
"title": "Logstash HTTP Statistics",
"services": {
"query": {
"idQueue": [
1,
2,
3,
4,
5,
#!/bin/bash
# myapp daemon
# chkconfig: 345 20 80
# description: myapp daemon
# processname: myapp
DAEMON_PATH="/usr/local/src/logstash/bin"
DAEMON=logstash
DAEMONOPTS="-f /etc/logstash/logstash.conf"
@dfetterman
dfetterman / lambda_function-ECS-cloudwatch-slack.py
Last active April 6, 2024 14:40
Lambda function that takes ECS Cloudwatch events and sends a notification to Slack
# Written by Dane Fetterman on 12/1/2016
# https://aws.amazon.com/blogs/compute/monitor-cluster-state-with-amazon-ecs-event-stream/
# Where they use a cloud watch event from ECS to notify a SNS topic. We're
# sending a notification directly to slack instead
import requests
import json
from boto3 import session, client
@dfetterman
dfetterman / gist:ac02e3ccc80aa771d8c428e91ffe51f0
Created June 10, 2019 17:38
Ansible Example vmware_guest provision w/ network
- name: "Ensure that virtual machine exists in VMC SDDC"
vmware_guest:
datacenter: "SDDC-Datacenter"
hostname: "{{ vsphere_server }}"
username: "{{ vsphere_user }}"
password: "{{ vsphere_password }}"
validate_certs: no
folder: "/SDDC-Datacenter/vm/Workloads"
name: "ansible-test-rhel-Demo1"
annotation: "This is a test VM created by Ansible"