Code By
Lucas Mouilleron

An Open Source selection

TSMarcoPolo

Last update : 16/05/2017 - 08:06
Private repository :(

heartBeat

Last update : 27/04/2017 - 09:36

Screenshot

An implementation of heartbeat monitoring.

Definitions

  • The server is in charge of monitoring services
  • When a service is considered dead, the server then alerts its owner
  • A service is a pulsing agent
  • A pulse is a sign of aliveness
  • When a service pulse the server, it tells him when he will pulse again in the worst case
  • If the service has not pulsed again in time, the server considers the service dead and alerts its owner
  • When a service is no longer required, it must inform the server to avoid a false dead alerts
  • An Alert can be a mail, a pushover message, etc.

Implementation

  • HTTP client / server architecture
  • All queries protected by password set in HTTP headers under "password"
  • Protocol :
    • Pulse :
      • POST /
      • {"service":"SERVICE_NAME","alertType":"ALERT_TYPE","alertTarget":"TARGET_NAME","nextIn":EXPECTED_NEXT_HEARTBEAT_IN_SECS}
    • Cancel :
      • DELETE /
      • {"service":"SERVICE_NAME"}
    • List :
      • GET /

Server

  • ./server
  • python3
  • Dependencies : pip install -r requirements.txt
  • Config :
    • config/config.json : main config (cp config/sample.json config/config.json)
    • config/certificate.pem : SSL certificate, used only if SSL activated
  • Datas : data
  • Deploy :
    • Install dependencies
    • Setup config
    • Generate ssl certificates (optional)
    • Hook in with upstart (optional, ./server/config/sample.upstart.conf, http://upstart.ubuntu.com/getting-started.html)
  • Run : python server.py
  • Docker :
    • ./docker
    • Config : place server config files in ./docker/config
    • Interactive : cd docker && tools/dockerBuild && tools/dockerRun
    • Detached : cd docker && tools/dockerBuild && tools/dockerRunDetached

Java Client

  • ./clientJava
  • Java 7+
  • No dependencies
  • Run test :

Python Client

  • ./clientPython
  • python3
  • Dependencies : requests (pip install requests)
  • Run test : python test.py

Javascript client

  • ./clientJavascript
  • client.js is a node module
  • Dependencies : packages.json -> devDependencies (npm install)
  • Run test : node test.js
  • Run test in browser : browserify test.js -o bundle.js and open test.html in browser

Certificates

  • Self signed :
    • openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
    • openssl rsa -passin pass:x -in server.pass.key -out server.key
    • rm server.pass.key
    • openssl req -new -key server.key -out server.csr
    • openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
    • cat server.crt server.key > server.pem
  • Letsencrypt : TODO

TODO

  • Put data writing in a queue
  • Put alert sending in a queue

TSSITest

Last update : 23/02/2017 - 18:24
Private repository :(

TSBoards

Last update : 12/02/2017 - 18:28
Private repository :(

TSMarcoPoloRunManager

Last update : 11/02/2017 - 11:54
Private repository :(

webServer

Last update : 01/02/2017 - 01:30
Private repository :(

devResources

Last update : 05/01/2017 - 11:25
Private repository :(

riverworldBeings

Last update : 12/12/2016 - 17:24

Characterisation of the population of beings of Riverworld.

Riverworld is a fictional planet and the setting for a series of sci-fi books written by Philip José Farmer.
Riverworld is an artificial environment where all humans (and pre-humans) ever born who died after reaching 5 years old are reconstructed.
Most of the resurrected awaken in a body equivalent to that of their 25 year old selves, in perfect health and free of any previous genetic or acquired defects.

A friend of mine made fun of the book concept and claimed half of the beings ressucitated would be prehistorical.

This project is proving him wrong.

Definitions

  • Begining of mankind : Homo Erectus, -1500K, assuming all beings on Riverworld can walk
  • End of mankind : 2016. In the book, all people die in 1983 after interacting with an alien civilisation.
  • Child Mortality CM : death of infants and children under the age of 5
  • Infant Mortality IM : death of infants and children under the age of 1
  • Life Expectancy LE : average time a being is expected to live
  • Life Adult Expectancy LAE : average time a being is expected to live if he reachs 5 years old

Datas

  • Dataset compiled amongst considered sources :
    • until now, conservative estimations for pre modern times : ./data/population-min.csv
    • until now, optimistic estimations for pre modern times : ./data/population-max.csv
    • until now, average estimations for pre modern times : ./data/population-avg.csv
    • including 2070 projections ./data/population-future.csv
  • The dataset consists of Point In Times (PIT)
  • For each PIT, these metrics are available : year, beings count in millions, LE, LAE, CM and continental proportions
  • Depending on sources, CM, IM, LE and/or LAE are provided or not. Some datas have been extrapolated. Underlying model : LE = CM * 5/2 + LAE * (1 - CM)
  • Case of beings count in prehistorical times :
    • Beings counts estimation flucuates a lot. They can go as low as 1K individuals up to 100K
    • We have 3 milestones in our dataset : -1500K (lower paleolithic), -50K (higher paleolithic) and -10K (begining of history)
    • For -10K, the poulation count is within the magnitude of the millions according to most of the sources. We kept the McEvedy estimation of 4 millions.
    • For -50K, we kept the higher estimation of Jean-Pierre Bocquet-Appel from his study of upper paleolithical meta populations in Europe. He found 15K individuals in the Aurignacien (-30K). Wordlwide, we estimated, as a minimum, we timed this result by 5. As a maximum by 10.
    • For -1500K, we've assumed the population could not be higher than in -50K. We assumed the population at that time would be the population of -50K / 2.
  • Case of LE et CM for prehistorical times :
    • As for beings counts, the LE estimations vary greatly
    • The Kaplan study suggest hunter gatherer modern societies tell us how prehistoric men lived and died. The study suggests the ALE is around 50 years and the CM around 0.5
    • For reference, the CM of 1900 is 0.4 and the Scheidel estimation of Classic Rome CM is 0.5
    • We cowardly derived the CM of pre Roman times to 0.6

Calculus

  • Linearity in between PITs :
    • The underlying assumption is that the PIT metrics evolve linearly in between two PITs
    • This assumption can be considered true from -1500K to 1700, from 1700 to 1900, from 1900 to 1950 and from 1950 to today
    • The PIT resolution in the dataset is consistent with this observation
    • We then assume numerical midpoint integration is a reasonable estimation
  • For the period PIT 1 => PIT 2
  • AB yx = Amount of Beings for year x
  • Elapsed Time ET = y2 - y1
  • Average Amount of Beings for Period AABP = (AB y2 + AB y1) / 2
  • LAE for Period LAEP = (LAE y1 + LAE y2) / 2
  • Proportion of Adult Beings To Be for Period PABTBP = 1 - ((CM y1 + CM y2) / 2)
  • Thus Amount of Beings who were Born for Period ABP = ET * AABP / LAEP
  • Thus Amount of Adult Beings who were Born for Period AABP = ET * AABP * PABTBP / LEP
  • Another calculus method is to use a simpe model of population growth :
    • AB y1 = Ce^(r * y1) and AB y2 = Ce^(r * y2)
    • By integration, ABP = ET * (AB y2 - AB y1) / (ln(AB y2) - ln(AB y1)) / LEP
    • This method proved to be very similar to the naïve numerical integration we selected (cf Report - Figure 6)

Results

  • The last report : ./output/(min|max|future)/report.pdf
  • The last plots : ./output

Sources

Install

  • pip install --upgrade pip
  • pip install -r requirements.txt --user
  • Fonts used in this project : ./resources/fonts
  • PDF dependencies :
    • mac : brew cask install wkhtmltopdf
    • linux : apt-get install wkhtmltopdf

Run

  • Configuration is loaded from config.ini
  • python riverworld.py min|max|avg|future
  • all at once : python riverworld.py min;python riverworld.py max;python riverworld.py avg;python riverworld.py future

Credits

empireStateEnglish

Last update : 23/11/2016 - 10:18
Private repository :(

nicolasrainaud

Last update : 08/09/2016 - 13:04

Nicolas Rainaud website, built with my stupidCMS.

Screenshot