This file contains hidden or 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
var connectionSettings = new ConnectionSettings(new Uri("http://localhost:9200/")); | |
connectionSettings.SetDefaultIndex("customers"); | |
var elasticClient = new ElasticClient(connectionSettings); | |
elasticClient.CreateIndex("customers-v1"); | |
elasticClient.Alias(x => x.Add(a => a.Alias("customers").Index("customers-v1"))); | |
elasticClient.Map<Customer>(d => | |
d.Properties(p => p.Number(n => n.Name(name => name.Zipcode).Index(NonStringIndexOption.not_analyzed)))); |
This file contains hidden or 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
namespace ConsoleApplication1 | |
{ | |
public class Customer | |
{ | |
public int Zipcode { get; set; } | |
} | |
} |
This file contains hidden or 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
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Importing base box 'precise32'... | |
... | |
[default] Machine booted and ready! | |
... | |
Setting up openjdk-7-jre-headless (7u55-2.4.7-1ubuntu1~0.12.04.2) ... | |
... | |
--2014-05-05 07:50:35-- https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb | |
... | |
sudo /etc/init.d/elasticsearch start |
This file contains hidden or 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 bash | |
# update apt | |
sudo apt-get update | |
# install java | |
sudo apt-get install openjdk-7-jre-headless -y | |
# install elasticsearch | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb |
This file contains hidden or 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/sh | |
# | |
# This is a script to run syntax check (via `sh -n $filename`) but it | |
# supports recursive checking and --quiet | |
QUIET=0 | |
while [ "$1" != "" ]; do | |
PARAM=`echo $1 | awk -F= '{print $1}'` | |
VALUE=`echo $1 | awk -F= '{print $2}'` | |
case $PARAM in |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "precise32" | |
config.vm.box_url = "http://files.vagrantup.com/precise32.box" | |
config.vm.provision :shell, :path => "bootstrap.sh" | |
config.vm.network :forwarded_port, guest: 9200, host: 9200 | |
end |
This file contains hidden or 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
$subject = $args[0] | |
$message = $args[1] | |
$from = $args[2] | |
$to = $args[3] | |
$smtpserver = "<smtp server>" | |
$smtpport = 465 | |
$username = "<smtp username>" | |
$password = "<smtp port>" | |
$credentials = New-Object System.Net.NetworkCredential($username, $password) | |
$smtp = New-Object Net.Mail.SmtpClient($smtpserver, $smtpport) |
This file contains hidden or 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
GlobalFilters.Filters.Add(new StatsdActionFilter()); |
This file contains hidden or 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
var metricsConfig = new MetricsConfig | |
{ | |
StatsdServerName = "localhost", | |
Prefix = "myMvcApp" | |
}; | |
Metrics.Configure(metricsConfig); |
This file contains hidden or 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
using System.Web; | |
using System.Web.Mvc; | |
using StatsdClient; | |
using Stopwatch = System.Diagnostics.Stopwatch; | |
namespace MvcApplication1.Controllers | |
{ | |
public class StatsdActionFilter : ActionFilterAttribute | |
{ | |
private const string StopwatchKey = "stopwatch"; |