Skip to content

Instantly share code, notes, and snippets.

View daniilyar's full-sized avatar
💭
Build systems for people, not only for money

Daniil Yaroslavtsev daniilyar

💭
Build systems for people, not only for money
View GitHub Profile
@daniilyar
daniilyar / public key
Created May 10, 2017 21:38
public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeh9PfEk8w+uEfw5Om4vkGVAaYG8G1NSDCwi13i8XYY8xlMFPHMtu+Wo9hmndvJmZAGEa2nMdhRZL0HxL+YQUWlScWnfz5CSh30di3vdojWBHPGbb4aTQm3UuxJHUuwoPeN79UUshW2RPcX7Mv+9RIU1sCc0YDYAsmbtpOrZ3YZMtQXxp87lv865voAbkoA+/SEDf6hVRFvOM8+qVajIrkCRGkXe2yEsJFNn2enTcxb3MveLGPZZeqiXGohDmn7JKl4NpMpmAGDeugeSWdJuzRtN/c8wKvxLZ6sPqp1sCctIvfsq85vKx3G5zcfjNvQ1xRyXDgtpfIngtkTmt5XZvV
{
"order": 0,
"template": "metrics-spark-*",
"settings": {
"index": {
"number_of_shards": "3",
"number_of_replicas": "1",
"refresh_interval": "15s"
}
},
@daniilyar
daniilyar / gelf_input_tcp
Last active July 15, 2016 07:14
Logstash GELF input with TCP support added
# encoding: utf-8
require "date"
require "logstash/inputs/base"
require "logstash/namespace"
require "socket"
# This input will read GELF messages as events over the network,
# making it a good choice if you already use Graylog2 today.
#
# The main use case for this input is to leverage existing GELF
@daniilyar
daniilyar / Dockerfile for Checkstyle master branch compilation
Last active May 14, 2016 15:31
Dockerfile for Checkstyle master branch compilation
FROM ubuntu:14.04
MAINTAINER Daniil Yaroslavtsev <Daniil.Yaroslavtsev@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
ENV MAVEN_VERSION 3.3.9
# Java Version
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 45
ENV JAVA_VERSION_BUILD 14
@daniilyar
daniilyar / check_reserved_instances.sh
Created May 4, 2016 09:24
AWS: check if all reserved instances are in use by appropriate on-demand ones
#!/bin/bash
set -e
REGION="us-west-2"
RUNNING_INSTANCES=`aws ec2 describe-instances --region $REGION --filters Name=instance-state-name,Values=running --query Reservations[*].Instances[*].InstanceType --output text | sort | uniq -c | awk ' { t = $1; $1 = $2; $2 = t; print; } '`
# Example:
#m3.medium 11
#r3.large 3
@daniilyar
daniilyar / gist:e433cab6c9d25ba600c4
Created March 18, 2016 21:32
logstash_calculate_message_charts_count
# Calculate message chars count
ruby {
code => "if !event['message'].nil?
message_chars_count = event['message'].length
event.to_hash.merge!('message_chars_count' => message_chars_count)
end"
}
@daniilyar
daniilyar / pgpool2_etc_init.d_debian
Created March 20, 2015 23:41
Debian /etc/init.d launch script for pgpool. Tested on Ubuntu 14.04 LTS (at Amazon EC2)
#! /bin/sh
### BEGIN INIT INFO
# Provides: pgpool2
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start pgpool-II
@daniilyar
daniilyar / eclipse.ini
Created February 28, 2015 20:53
eclipse.ini template for Scala developemnt
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
@daniilyar
daniilyar / gist:630bc6fe7723ed06f243
Created February 26, 2015 08:56
output of rs.status() from PRIMARY host
10.148.28.51:PRIMARY> rs.status()
{
"set" : "10.148.28.51",
"date" : ISODate("2015-02-25T18:35:38Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "ip-10-148-28-51:27118",
"health" : 1,
@daniilyar
daniilyar / gist:1c01da493747dc8dabd2
Created December 8, 2014 13:23
How to make camel redirect requests in a maximum
from(url).process(processor).choice()
.when(header("location").isNull()).endChoice()
.when(header("location").contains("?")).recipientList(simple("${header.location}&bridgeEndpoint=true")).endChoice()
.otherwise().recipientList(simple("${header.location}?bridgeEndpoint=true"));
and just modify location header in processor to any url you need to redirect based on input request content