Skip to content

Instantly share code, notes, and snippets.

View axamon's full-sized avatar
:octocat:
thinking

Alberto axamon

:octocat:
thinking
  • Rome - Italy
View GitHub Profile
@axamon
axamon / self-signed-certificate-with-custom-ca.md
Created September 19, 2019 13:42 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
/usr/bin/x86_64-w64-mingw32-g++ primo.cpp -static-libgcc -static-libstdc++ -o leggi.exe
@axamon
axamon / funzione-gzip
Created February 17, 2016 22:12
Utilizzo di gzip in python
def elabora():
"prende uno per uno i log ingestati e li elabora"
csv_filename = rlocal.brpoplpush("listalogdaelaborare","listalogelaborati",0)
csv_filename_parsed=csv_filename.strip().split("_")
#print "Sto elabrando il log: ",csv_filename
#f=gzip.open('/root/logs/archived-streamer-output/'+oggi+'/'+csv_filename, 'rU')
with gzip.open('/home/evangelion/logs/'+csv_filename_parsed[4]+'/'+csv_filename, 'rU') as f:
#salta la prima riga del log
next(f)
reader = csv.DictReader(f, delimiter="\t")
@axamon
axamon / doc.py
Last active February 8, 2016 16:10
documentazione
import sys
import documentazione
documentazione.comprimidocumentazione(sys.argv[1])
curl -XPUT 'http://localhost:9200/cdnlogs-2014-08-29'
curl -XPUT 'http://localhost:9200/cdnlogs-2014-08-29/cdnlogs/_mapping' -d ' {
"cdnlogs" : {
"properties" : {
"timestamp" : {"type" : "date", "ignore_malformed": true, "format" : "[dd/MMM/yyyy:HH:mm:ss.SSSZ]" }
}
}
}
import csv
import sys
import os
import gzip
import datetime
import pyes
from pyes import *
now = datetime.datetime.now()
@axamon
axamon / es.sh
Last active August 29, 2015 14:05
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# OLD WAY / HARD WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz
tar -xf elasticsearch-1.3.2.tar.gz
@axamon
axamon / index.html
Created February 14, 2014 15:46
prima prova di git
fsfadsfa