Skip to content

Instantly share code, notes, and snippets.

View ramonpin's full-sized avatar
💭
Programeando

Ramón Pin ramonpin

💭
Programeando
View GitHub Profile
@ramonpin
ramonpin / spark-rest-submit.sh
Created April 11, 2018 06:52 — forked from yaravind/spark-rest-submit.sh
Submit apps (SparkPi as e.g.) to spark cluster using rest api
curl -X POST -d http://master-host:6066/v1/submissions/create --header "Content-Type:application/json" --data '{
"action": "CreateSubmissionRequest",
"appResource": "hdfs://localhost:9000/user/spark-examples_2.11-2.0.0.jar",
"clientSparkVersion": "2.0.0",
"appArgs": [ "10" ],
"environmentVariables" : {
"SPARK_ENV_LOADED" : "1"
},
"mainClass": "org.apache.spark.examples.SparkPi",
"sparkProperties": {
@ramonpin
ramonpin / alias_ops_elastic.txt
Created January 18, 2017 16:56
Operaciones sobre alias en Elasticsearch
Este comando añade al alias 'alias1' el índice 'test1':
curl -XPOST http://elastic:9200/_aliases --data '{ "actions" : [ { "add" : { "index" : "test1", "alias" : "alias1" } } ] }''
Este comando elimina del alias 'alias1' el índice 'test1':
curl -XPOST http://elastic:9200/_aliases --data '{ "actions" : [ { "remove" : { "index" : "test1", "alias" : "alias1" } } ] }'
Este comando quita 'test1' y añade 'test2' simultáneamente al 'alias1' (en esencia un rename):
curl -XPOST http://elastic:9200/_aliases --data '{ "actions" : [ { "remove" : { "index" : "test1", "alias" : "alias1" } }, { "add" : { "index" : "test2", "alias" : "alias1" } } ] }'
Si lees la entrada https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html de la documentación
@ramonpin
ramonpin / tunnel-ssh.sh
Last active June 24, 2020 22:48
Expect script to automatically create a ssh tunnel from a local port to a remote destination.
#!/usr/bin/expect -f
set ssh_host "172.19.10.80"
set ssh_user "user"
set ssh_password "password"
set dest_host "172.19.10.91"
set dest_port 8080
set local_port 80
set timeout -1
spawn ssh -N $ssh_user@$ssh_host -L 127.0.0.1:$local_port:$dest_host:$dest_port
@ramonpin
ramonpin / Gemfile
Last active December 21, 2015 00:18 — forked from andrenam/Gemfile
############################################################
### Gem file to install GITLAB on Raspberry-Pi
############################################################
source "http://rubygems.org"
gem "rails", "3.2.5"
# Supported DBs
gem "sqlite3"
gem "mysql2"