Skip to content

Instantly share code, notes, and snippets.

View marcosgabarda's full-sized avatar
coffee?

Marcos Gabarda marcosgabarda

coffee?
View GitHub Profile

Install environment

Xcode command line

You can install command line without install XCode

$ xcode-select --install
@saruba
saruba / elastic.sh
Created July 26, 2016 09:32
Run elasticsearch in docker
sudo docker pull elasticsearch:1.7
sudo docker run -d -p 9200:9200 -p 9300:9300 -v "/data-0":/usr/share/elasticsearch/data -v "$PWD/scripts":/usr/share/elasticsearch/config/scripts elasticsearch:1.7 elasticsearch -Des.cluster.name="avengers"
sudo docker run -d -P -v "/data-1":/usr/share/elasticsearch/data -v "$PWD/scripts":/usr/share/elasticsearch/config/scripts elasticsearch:1.7 elasticsearch -Des.cluster.name="avengers"
# Local server
# Create new Docker Virtual machine
@saruba
saruba / import_indexes.js
Last active March 29, 2016 11:38
Import all indexes from elasticsearch "http://localhost:9200/_all/_settings,_mapping"
var fs = require('fs');
var querystring = require('querystring');
var http = require('http');
var indexs = JSON.parse(fs.readFileSync('indexes.json', 'utf8'));
var host = '192.168.186.143';
port = '9200',
postData = "",
indexName = "";
@saruba
saruba / elasticdump_docker.sh
Last active March 29, 2016 12:05
elasticdump docker
# https://www.npmjs.com/package/elasticdump
git clone https://github.com/taskrabbit/elasticsearch-dump.git
cd elasticsearch-dump/
curl -XGET http://localhost:9200/_all/_settings,_mapping > indexes.json
sudo docker build -t elasticdump .
time sudo docker run --rm -ti -v ~/dumps/:/data elasticdump --all=true --type=data --input=http://<ip>:9200/ --output=/data/data-backup.json
# Backup and index to a gzip using stdout:
@gnachman
gnachman / iterm.scpt
Last active April 27, 2018 05:44
Fix docker quickstart terminal for iTerm2 version 2.9 and later
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try