Skip to content

Instantly share code, notes, and snippets.

View ycombinator's full-sized avatar

Shaunak Kashyap ycombinator

  • Elastic
  • San Jose, CA
View GitHub Profile
@ycombinator
ycombinator / gpg-agent-with-git-on-mac.md
Last active April 5, 2016 19:24
Setting up gpg-agent with git on Mac
  1. Install gpg-agent
$ brew install gpg-agent
  1. You'll want to start gpg-agent each time a shell is opened. Add the following lines to your ~/.profile or equivalent:
GPG_TTY=$(tty)
export GPG_TTY
eval $(gpg-agent --daemon --allow-preset-passphrase)
[2015-09-15 19:37:33,194][INFO ][org.elasticsearch.node ] [Agatha Harkness] version[2.0.0-beta2], pid[7097], build[91726c3/2015-09-14T14:58:02Z]
[2015-09-15 19:37:33,194][INFO ][org.elasticsearch.node ] [Agatha Harkness] initializing ...
[2015-09-15 19:37:33,679][INFO ][org.elasticsearch.plugins] [Agatha Harkness] loaded [cloud-gce], sites []
[2015-09-15 19:37:33,724][INFO ][org.elasticsearch.env ] [Agatha Harkness] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [8.1gb], net total_space [9.7gb], spins? [unknown], types [rootfs]
[2015-09-15 19:37:35,465][DEBUG][org.elasticsearch.discovery.zen.elect] [Agatha Harkness] using minimum_master_nodes [-1]
[2015-09-15 19:37:35,466][DEBUG][org.elasticsearch.discovery.gce] [Agatha Harkness] using tags []
[2015-09-15 19:37:35,469][DEBUG][org.elasticsearch.discovery.zen.ping.unicast] [Agatha Harkness] using initial hosts [127.0.0.1], with concurrent_connects [10]
[2015-09-15 19:37:35,477][DEBUG][org.elasticsearch.discovery.gce] [Agatha Harkness] usin
@ycombinator
ycombinator / es-on-aws.md
Last active August 29, 2015 14:21
Elasticsearch on AWS

Here are 3 resources about running Elasticsearch on AWS. I recommend going through them in order:

  1. Webinar (by Elastic employees) about running Elasticsearch on AWS: https://vimeo.com/elasticsearch/review/110218622/a1c28e84cc. Its a bit long (~1 hour) but I'd start here.

  2. These two blog posts cover setting up the AWS environment, then installing and configuring Elasticsearch on it:

  1. And this is a deeper technical dive into various configuration settings - primarily to do with HA and security - that might be useful when setting up Elasticsearch on AWS: http://www.slideshare.net/bobeirasa/es-on-aws-rafael-lopes-2nd-meetup-elasticsearch-brasil
--------------------------
Document (before): {}
Patch: [{"path": "/domains", "value": [{"domain": "addDomainList.com", "protocol": "http"}], "op": "add"}]
Document (after): {"domains": [{"domain": "addDomainList.com", "protocol": "http"}]}
--------------------------
Document (before): {"domains": []}
Patch: [{"path": "/domains", "value": [{"domain": "addDomainList.com", "protocol": "http"}], "op": "add"}]
Document (after): {"domains": [{"domain": "addDomainList.com", "protocol": "http"}]}
--------------------------
Document (before): {"domains": [{"domain": "existingDomain.com"}]}
@ycombinator
ycombinator / gist:a8d9d758ceed00425f45
Last active August 29, 2015 14:10
Using composer to install php-opencloud
$ php composer.phar require rackspace/php-opencloud
Using version ~1.11 for rackspace/php-opencloud
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing psr/log (1.0.0)
Loading from cache
- Installing symfony/event-dispatcher (v2.6.0)
Loading from cache
diff --git a/givemeaserver.py b/givemeaserver.py
old mode 100644
new mode 100755
diff --git a/iwantaserver/__init__.py b/iwantaserver/__init__.py
index ced0731..e7e867e 100644
--- a/iwantaserver/__init__.py
+++ b/iwantaserver/__init__.py
@@ -55,59 +55,49 @@ class Server(db.Model):
self.password = password
self.event_id = event_id
from subprocess import Popen
import os
import random
import sys
from flask import (Flask, request, session, g, redirect, url_for, abort,
render_template, flash)
from flask.ext.sqlalchemy import SQLAlchemy
var pkgcloud = require('pkgcloud')
// Connect to Rackspace Cloud
var rackspaceClient = pkgcloud.storage.createClient({
provider: 'rackspace',
username: process.env.RAX_USERNAME,
apiKey: process.env.RAX_API_KEY,
region: process.env.RAX_REGION
})
{
"stack_name": "my_minecraft_server",
"template_url": "https://raw.githubusercontent.com/rackspace-orchestration-templates/minecraft/master/minecraft-server.yaml",
"parameters": {
"terms": true
},
"timeout_mins": 5
}
#!/bin/bash
curl -v -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $OS_AUTH_TOKEN" \
"https://dfw.orchestration.api.rackspacecloud.com/v1/$OS_TENANT_ID/stacks" \
-d '
{
"stack_name": "minecraft_server",
"template_url": "https://raw.githubusercontent.com/rackspace-orchestration-templates/minecraft/master/minecraft-server.yaml",