Skip to content

Instantly share code, notes, and snippets.

View Filirom1's full-sized avatar

Romain Filirom1

View GitHub Profile
@Filirom1
Filirom1 / cluster.js
Created October 26, 2016 09:06
OpenTSDB proxy for debugging
#!/usr/bin/env node
var clusterMaster = require("cluster-master")
clusterMaster({
exec: "proxy.js",
// exec: "proxy-simple.js",
size: 2,
silent: false,
signals: true,
repl: '/root/cluster-master.socket'
})
@Filirom1
Filirom1 / docker-run.rb
Last active October 15, 2016 16:37
A `docker run` that would stay attached when containers restart.
#!/usr/bin/env ruby
# This script is equivalent to a `docker run` that would stay attached when containers restart.
require 'open3'
require 'time'
cmd = ["/usr/bin/docker", "run", "-d"] + ARGF.argv
Open3.popen3(*cmd) do |stdin, stdout, stderr, thread|
puts stderr.read
exit_status = thread.value
@Filirom1
Filirom1 / README.md
Created March 14, 2016 12:41
Extend LV on VmWare

Extend LV on VmWare

umount /dev/vg01/lvname
echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan
fdisk  /dev/sda
# d
# 3
# n
# p
$ hpacucli
=> ctrl all show status
=> ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:6,2I:1:7 raid=1+0


$ parted /dev/sdb
(parted) mklabel gpt
(parted) mkpart
Partition name? []?
@Filirom1
Filirom1 / README.md
Last active July 27, 2020 14:40
Generate self signed certificates

Execute the following command to create a self signed certificate

openssl genrsa -out private.key 2048
openssl req -nodes -x509 -days 3650 -config ssl.cnf -new -key private.key -out example.com
@Filirom1
Filirom1 / APKBUILD
Created March 31, 2015 21:09
ElasticSearch Alpine Linux
# Contributor: Filirom1 <Filirom1@gmail.com>
# Maintainer: Filirom1 <Filirom1@gmail.com>
pkgname=elasticsearch
pkgver=1.5.0
pkgrel=0
pkgdesc="Open Source, Distributed, RESTful Search Engine"
url="https://github.com/elastic/elasticsearch"
pkgusers="elasticsearch"
pkggroups="elasticsearch"
arch="all"
@Filirom1
Filirom1 / hpssacli
Created March 26, 2015 14:56
hpssacli
# hpssacli
HP Smart Storage Administrator CLI 2.0.23.0
Detecting Controllers...Done.
Type "help" for a list of supported commands.
Type "exit" to close the console.
=> ctrl slot=2 pd all show
Smart Array P420 in Slot 2
@Filirom1
Filirom1 / README.md
Created March 26, 2015 14:27
reposync

Givena an elasticsearch repo, launch the command below to create a mirror

$ reposync --repoid elasticsearch-1.4 -p /path/to/mirror
@Filirom1
Filirom1 / README.md
Last active June 9, 2017 10:11
ElasticSearch dynamic default mapping for nested objects

First start ES with /etc/elasticsearch/default-mapping.json, then index several documents with inner objects

curl -XPOST -d '{"key":{"subkey1":1, "subkey2":1}}' localhost:9200/toto/toto/1
curl -XPOST -d '{"key2":{"subkey1":1, "subkey2":1}}' localhost:9200/toto/toto/2
curl -XPOST -d '{"key3":{"subkey1":1, "subkey2":1}}' localhost:9200/toto/toto/3

Finally, launch the query