Skip to content

Instantly share code, notes, and snippets.

View Filirom1's full-sized avatar

Romain Filirom1

View GitHub Profile
@Filirom1
Filirom1 / elasticsearch.yml
Created February 19, 2015 09:41
very simple ElasticSearch Analyzer
index:
analysis:
analyzer:
default:
type: custom
tokenizer: whitespace
filter: [standard, asciifolding, lowercase]
@Filirom1
Filirom1 / xmllint.rb
Created February 23, 2015 13:05
validate XML in ruby
require 'nokogiri'
require 'active_support/core_ext/hash' #from_xml
valid_xml_str = Nokogiri::XML(str) { |config| config.strict }.to_s
hash = Hash.from_xml(valid_xml_str)
@Filirom1
Filirom1 / scalr
Created March 10, 2015 15:37
scalr log rotation
# /etc/logrotate.d/scalr
/var/log/scalr/*.log {
daily
missingok
notifempty
rotate 7
compress
}
@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 / 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 / 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"
$ 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 / cluster.js
Created August 22, 2011 20:17
Dnode cluster
var dnode = require('dnode');
var Cluster = function(options) { /* Options : local port, host, remote nodes, ... */
var _self = this;
this.options = options;
/* the remote server connected with this server */
this.connectedPeers = [];
@Filirom1
Filirom1 / npm-sync.coffee
Created September 23, 2011 23:39
Choose the package to sync in npm
request = require 'request'
semver = require 'semver'
colors = require 'colors'
prompt = require 'prompt'
nopt = require 'nopt'
{EventEmitter} = require 'events'
# TODO: handle latest
# TODO: interactive mode