Skip to content

Instantly share code, notes, and snippets.

View tintamarre's full-sized avatar
🐢
...

Martin Erpicum tintamarre

🐢
...
View GitHub Profile
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@tintamarre
tintamarre / utf8_insanity.md
Last active August 29, 2015 14:03 — forked from JamesChevalier/mac_utf8_insanity.md
Converting btw NFC<--->NFD w/ convmv

convmv manpage

Install convmv if you don't have it.

apt-get install convmv

Convert all files in a directory from NFD to NFC:

convmv -r -f utf8 -t utf8 --nfc --notest .

@tintamarre
tintamarre / es-indexer.py
Last active August 29, 2015 14:03 — forked from stevehanson/es-attach-full.py
Interactive Python script to recursively index files in directory tree to ElasticSearch using the elasticsearch-mapper-attachments (https://github.com/elasticsearch/elasticsearch-mapper-attachments) plugin to index files (pdf, docx, html, etc).
import os
import sys
# constants, configure to match your environment
HOST = 'http://localhost:9200'
INDEX = 'es-indexer'
TYPE = 'attachment'
TMP_FILE_NAME = 'tmp.json'
# for supported formats, see apache tika - http://tika.apache.org/1.4/formats.html
INDEX_FILE_TYPES = ['html','pdf', 'doc', 'docx', 'xls', 'xlsx', 'xml', 'odt', 'ods', 'jpg', 'mp4' ]