This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
def to_dotted(var, root=""): | |
if isinstance(var, dict): | |
for k in var.keys(): | |
for r in to_dotted(var[k], root + "." + str(k)): | |
yield r | |
elif isinstance(var, list): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
require 'paint' | |
curl = `curl -s 'https://elecciones28a.porcentual.es/widgets/2019-elecciones/data/00/json/widgets/widget-map.json' -H 'Accept: */*' -H 'Referer: https://newtral.es/resultado-elecciones-28a/' -H 'Origin: https://newtral.es' -H 'User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36' --compressed` | |
res = JSON.parse(curl)['resultados'] | |
escrutado = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
numero = ARGV.shift.to_i | |
# si el numero es menor de 100 o mayor de 999 no puedo! | |
puts "+-----------------+" | |
puts "|" + "#{numero}".center(17) + "|" | |
puts "+-----+-----+-----+" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global_tags] | |
[agent] | |
interval = "10s" | |
flush_interval = "10s" | |
precision = "" | |
debug = false | |
quiet = false | |
logfile = "" | |
hostname = "" | |
omit_hostname = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CRONLOG=/var/log/cron.log | |
RID=$(cat /dev/urandom | tr -dc "[:alpha:]" | head -c 8) | |
CMD=$@ | |
START=$(date +%s) | |
echo "---- CRON --- START at $(date) --------" | ts | sed "s/^/[${RID}] /" >> ${CRONLOG} | |
echo "-- CMD: $@ ----" | ts | sed "s/^/[${RID}] /" >> ${CRONLOG} | |
/bin/bash -c "$@" > >( sed 's/^//') 2> >( sed 's/^/ [ERR]: /' ) | ts | sed "s/^/[${RID}] /" >> ${CRONLOG} | |
RETURN=$? | |
END=$(date +%s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian | |
RUN apt-get -y update && apt-get -y install python3 python3-pip build-essential git wget curl | |
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - | |
RUN apt-get install -y nodejs | |
RUN git clone https://github.com/kendricktan/laice.git | |
WORKDIR laice | |
RUN npm install -g bower | |
RUN bower install --allow-root | |
RUN pip3 install -r requirements.txt | |
#RUN python3 -m spacy.en.download --force all # (LONG TIME, prone to fail and adds 700Mb img size, but leads to accurate results) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'excon' | |
# Cargamos los datos de redirecciones | |
csv_data = CSV(File.open('redirects.csv').read).read | |
#borramos la columna de encabezado | |
csv_data.delete_at(0) | |
# Configuramos excon para que no verifique el SSL y tenga un timeout bajo | |
Excon.defaults[:ssl_verify_peer] = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
s3 { | |
# KEY / Secret de amazon, editar segun convenga | |
access_key_id => "AKIATITELAVOYADECIR" | |
secret_access_key => "876af98asd6f98ew6fasd98f" | |
# Bucket de s3 dodne se guarda el billing | |
bucket => "billing-bucket" | |
# prefijo (comienzo del nombre de fichero) | |
prefix => "555555555555555-aws-billing-csv-" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
s3 { | |
access_key_id => "AKIATITELOVOYADECIR" | |
secret_access_key => "Lw8QT+som3r4Nd0mB1Ts" | |
bucket => "billing-bucket-name" | |
prefix => "555555555555-aws-billing-csv-" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output { | |
if [date_error] in [tags] { | |
stdout { codec => plain } | |
} else { | |
stdout { codec => dots } | |
elasticsearch { | |
hosts => ["elasticsearch:9200"] | |
} | |
} | |
} |
NewerOlder