En résumé :
But : analyser un an de sécurisation, via des fichiers CSV fournis à DataStorm
Comment : application Spark Java secu-replay, lancée via Jenkins sur le cluster "val"
| [ | |
| { | |
| "Liters_per_100_km": 1.8, | |
| "Day": "2019-08-26", | |
| "Vehicle": "Yamaha YBR 125 (2010)", | |
| "Comment": "" | |
| }, | |
| { | |
| "Liters_per_100_km": 1.9, | |
| "Day": "2019-07-20", |
But : analyser un an de sécurisation, via des fichiers CSV fournis à DataStorm
Comment : application Spark Java secu-replay, lancée via Jenkins sur le cluster "val"
| (curl -s 'https://api.leboncoin.fr/finder/search' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:64.0) Gecko/20100101 Firefox/64.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: https://www.leboncoin.fr/aw/mes-recherches/' -H 'api_key: ba0c2dad52b3ec' -H 'content-type: text/plain;charset=UTF-8' -H 'origin: https://www.leboncoin.fr' -H 'DNT: 1' -H 'Connection: keep-alive' --data '{"filters":{"category":{"id":"3"},"owner":{},"keywords":{"type":"subject","text":"yamaha YBR"},"location":{"region":"12","regions":["12"],"locations":[{"region_id":"12","label":"Ile-de-France","locationType":"region"}]},"enums":{"ad_type":["offer"]}},"counters":{},"limit":35,"sort_by":"time","sort_order":"desc","user_id":"bfdbcf98-4dd9-4545-9eb5-6cd0159a3d8f","store_id":"15616030"}' | md5 && date) > ~/lbc.log |
| https://docs.google.com/document/d/1bUi8IydEUKmigP5fMlutCAUbIO4s-Xj9HpBef8cNvfI/edit |
| version: "3.2" | |
| services: | |
| elasticsearch: | |
| # Error: driver Additional property driver is not allowed | |
| # environment: | |
| # - cluster.name=secu-replay | |
| # - discovery.type=single-node | |
| # - "ES_JAVA_OPTS=-Xms256m -Xmx256m" |
| import http.client | |
| import json | |
| import getpass | |
| import matplotlib.pyplot as plot | |
| import pandas as pd | |
| def activities(token): | |
| connection = http.client.HTTPSConnection("www.strava.com") | |
| connection.request("GET", "/api/v3/activities?access_token=" + token + "&per_page=200") | |
| response = connection.getresponse() |
| // Connect *quietly* to a database with user/password authentication: | |
| mongo $host/$database --quiet --username $user --password $password | |
| // List databases: | |
| show databases | |
| // Change database: | |
| use $database | |
| // List collections for current database: | |
| show collections |