-
Install cloud-aws-plugin (https://github.com/elastic/elasticsearch-cloud-aws)
-
Give your EC2 instances IAM Instance Policy with permission to
ec2:DescribeInstances
. The plugin will automatically get correct access keys after this.- You should really do the above, but you can also just create a new IAM user and set up
cloud.aws.access_key
andcloud.aws.secret_key
inelasticsearch.yml
. But you really should create instance policy instead.
- You should really do the above, but you can also just create a new IAM user and set up
-
Set
discovery.type: ec2
inelasticsearch.yml
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
use std::io::BufferedReader; | |
use std::io; | |
fn main() { | |
let mut reader = BufferedReader::new(io::stdin()); | |
println!("What is your name?"); | |
let age_input: ~str = reader.read_line().unwrap(); | |
let age_trimmed: &str = age_input.trim(); |
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
# using VirtualBox version $VBOX_VERSION | |
FROM boot2docker/boot2docker | |
RUN apt-get install p7zip-full | |
RUN mkdir -p /vboxguest && \ | |
cd /vboxguest && \ | |
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \ | |
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \ | |
sh VBoxLinuxAdditions.run --noexec --target . && \ |
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
c_cyan=`tput setaf 6` | |
c_red=`tput setaf 1` | |
c_green=`tput setaf 2` | |
c_sgr0=`tput sgr0` | |
parse_git_branch () | |
{ | |
if git rev-parse --git-dir >/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
$ rvm use 1.8.7-p302 | |
$ wget http://subversion.tigris.org/downloads/subversion-1.6.15.tar.gz | |
$ tar -xzf subversion-1.6.15.tar.gz && cd subversion-1.6.15 | |
$ ./configure --with-ruby-sitedir=~/.rvm/rubies/ruby-1.8.7-p302/lib/ruby --without-berkeley-db | |
$ make swig-rb && make install-swig-rb | |
To test things out: | |
$ irb | |
ruby-1.8.7-p302 > require 'svn/client' | |
=> true |
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
express = require 'express' | |
assetManager = require 'connect-assetmanager' | |
app = express.createServer | |
app.use assetManager |
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
var pressedKeys = {}; | |
var tick = function(msDuration) { | |
gamejs.event.get().forEach(function(e) { | |
if (e.type == gamejs.event.KEY_DOWN) { | |
pressedKeys[e.key] = true; | |
} else if (e.type == gamejs.event.KEY_UP) { | |
delete pressedKeys[e.key]; | |
} | |
}); |
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
# config/initializers/suppress_action_view_field_errors.rb | |
# The default form builder appends <div class="field_with_errors"> (or something similar) | |
# to all fields and labels for model attributes that have validation errors. Doesn't work | |
# so well with Bootstrap. | |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
"#{html_tag}".html_safe | |
end |
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
val zip = new ZipStreamHelper(new ZipInputStream(...)) | |
zip.rewindTo("hello.xml") { in => | |
val parser = STaxParser() | |
val root = parser.fromInputStream(in) | |
} |
OlderNewer