Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| curl -XPUT 'http://127.0.0.1:9200/foo/?pretty=1' -d ' | |
| { | |
| "mappings" : { | |
| "person" : { | |
| "properties" : { | |
| "name" : { | |
| "omit_norms" : true, | |
| "type" : "string" | |
| } | |
| } |
sudo apt-get install alien)sudo alien -i oracle-instantclinet*-basic-*.rpmsudo alien -i oracle-instantclinet*-devel-*.rpm| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| # Every Vagrant virtual environment requires a box to build off of. | |
| config.vm.box = "precise64" | |
| # The url from where the 'config.vm.box' box will be fetched if it |
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
| """ | |
| Simple preforking echo server in Python. | |
| Python port of http://tomayko.com/writings/unicorn-is-unix. | |
| """ | |
| import os | |
| import sys | |
| import socket |
| """ | |
| Simple forking echo server built with Python's SocketServer library. A more | |
| Pythonic version of http://gist.github.com/203520, which itself was inspired | |
| by http://tomayko.com/writings/unicorn-is-unix. | |
| """ | |
| import os | |
| import SocketServer | |
| class EchoHandler(SocketServer.StreamRequestHandler): |
| #!/bin/bash | |
| IPT="/sbin/iptables" | |
| # Server IP | |
| SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')" | |
| # Your DNS servers you use: cat /etc/resolv.conf | |
| DNS_SERVER="8.8.4.4 8.8.8.8" | |
| # Allow connections to this package servers |
| curl -XDELETE 'http://localhost:9200/test/' | |
| curl -XPUT 'http://localhost:9200/test/' | |
| curl -XPUT 'http://localhost:9200/test/test/_mapping' -d '{"test":{"properties":{"firstname":{"type":"string","store":"yes"},"lastname":{"type":"string", "store":"no"}},"_source":{"enabled":false}}}' | |
| curl -XPOST 'http://localhost:9200/test/test' -d '{"firstname":"Nicolas","lastname":"ruflin"}' | |
| curl -XPOST 'http://localhost:9200/test/test' -d '{"firstname":"Nicola","lastname":"ruflin"}' |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,