Skip to content

Instantly share code, notes, and snippets.

View interupteur_arduino.ino
#define PIN_INT 2
#define PIN_LED 13
void setup() {
// put your setup code here, to run once:
pinMode( PIN_LED, OUTPUT );
pinMode( PIN_INT, INPUT );
digitalWrite( PIN_LED, LOW );
}
View arduino-fade-3.ino
#define PIN_BLINK_LED_BLUE 11
#define PIN_BLINK_LED_RED 9
#define PIN_BLINK_LED_GREEN 10
void setup() {
// put your setup code here, to run once:
pinMode( PIN_BLINK_LED_BLUE, OUTPUT );
pinMode( PIN_BLINK_LED_RED, OUTPUT );
pinMode( PIN_BLINK_LED_GREEN, OUTPUT );
digitalWrite( PIN_BLINK_LED_BLUE, LOW );
View docker-compose-network.yml
version: "3"
services:
nginx:
image: nginx
networks:
- frontend
php:
image: php:fpm
networks:
View docker-compose.yml
version: '3'
services:
webapp:
image: YOUR_PHP
ports:
- 12345:12345
deploy:
replicas: 10
restart_policy:
@Servuc
Servuc / docker-compose-v2.yml
Last active Oct 4, 2019
Teach Docker-compose - TP1
View docker-compose-v2.yml
version: '2'
services:
mysql:
image: mysql
command: mysqld --default-authentication-plugin=mysql_native_password
environment:
MYSQL_USER: dbuser
MYSQL_PASSWORD: dbpassword
MYSQL_ROOT_PASSWORD: dbrootpassword
@Servuc
Servuc / docker-compose.yml
Created Aug 7, 2018
Example of docker-compose.yml
View docker-compose.yml
version: '3'
services:
web:
build: .
ports:
- "5000:5000"
redis:
image: "redis:alpine"
# From : https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file
@Servuc
Servuc / .gitlab-ci.yml
Created Aug 6, 2018
Example of continue integration to Docker Hub
View .gitlab-ci.yml
stages:
- build
variables:
CONTAINER_TAG: IMAGE_NAME:$CI_BUILD_REF_NAME
buildContainer:
image: docker:latest
stage: build
script:
@Servuc
Servuc / Dockerfile.php.example
Last active Oct 12, 2017
Example of Dockerfile for teaching
View Dockerfile.php.example
FROM debian:latest
RUN apt-get update && apt-get upgrade -y && apt-get install -y php-cli && \
mkdir /monDossier && mkdir /monDossier/share
COPY monScript.php /monDossier
ADD http://proof.ovh.net/files/1Mb.dat /monDossier
RUN mv /monDossier/monScript.php /monDossier/index.php
@Servuc
Servuc / README.md
Last active Sep 29, 2017
Teaching :) - Example of Express server with SerialPort reading
View README.md

Express server and serial port reading

This JS file demonstrate how open a serial port to read it, and display read value over HTTP server.

Copy/Paste the script will display value at : http://localhost:3000 enjoy.

Install

yarn add serialport
yarn add express
View teaching2-analogSensor.ino
#define SENSOR_PIN A0
void setup() {
pinMode( SENSOR_PIN, INPUT );
Serial.begin(9600);
}
void loop() {
Serial.println( analogRead( SENSOR_PIN ) );
delay(2500);