Skip to content

Instantly share code, notes, and snippets.

View DardanIljazi's full-sized avatar

Dardan Iljazi DardanIljazi

View GitHub Profile
@DardanIljazi
DardanIljazi / extra_interface.sh
Created November 11, 2018 16:38
Extra interface (to run after basicinstall.sh)
#!/bin/bash
#THIS SCRIPT SHOULD BE RUN AFTER the basicinstall.sh (and not before).
#Extra for SharedHosting. This script download the page CreateUser.php
LOGIN_USERNAME="admin"
LOGIN_PASSWORD="admin" #Change this for your safety !
#CURL INSTALL
apt-get install -y curl
#APACHE2-UTILS INSTALL. This is only used to have the htpasswd command
@DardanIljazi
DardanIljazi / CreateUser.php
Last active November 11, 2018 16:18
CreateUser.php
<html>
<head>
<title>SharedHosting: Create user</title>
<style>
body {
background-color: #2980b9;
font-family: 'Open Sans', sans-serif;
}
h1, h2 {
@DardanIljazi
DardanIljazi / SharedHosting.md
Created November 11, 2018 01:16
SharedHosting.md

Webserver installation and configuration with Nginx - PHP-FPM MariaDB - PHPMyadmin

Date: 10.11.2018

This document explains how to install a debian web server from scratch. It was intended to be done for an exam in Centre Profesionnel du Nord Vaudois (CPNV, Switzerland).

The final webserver has those features:

  1. Each user has one or more website
  2. Each user has a ssh access (so he can use scp)
@DardanIljazi
DardanIljazi / basicinstall.sh
Last active November 12, 2018 20:27
Webserver installation and configuration with Nginx - PHP-FPM MariaDB - PHPMyadmin
#!/bin/bash
#REPLACE THE ROOT PASSWORD BELOW
ROOT_PASSWORD="root" #Note: A solution should be found for this, it's not really safe but we have to keep in mind that all this script should be executed without user/input interaction
apt-get update && apt-get -y upgrade
#NGINX INSTALL
apt-get -y install nginx
systemctl start nginx.service
@DardanIljazi
DardanIljazi / Slave.ino
Created June 20, 2017 20:58
Slave avec librairie
#include <SoftwareSerial.h>
#include "CommunicationProtocol.h"
/*********** DEBUT BLUETOOTH ***********/
#define RxD 11 // Cette pin doit être connectée à la pin TX du Bluetooth
#define TxD 12 // Cette pin doit être connectée à la pin RX du Bluetooth
SoftwareSerial blueToothSerial(RxD, TxD); // Communication RX/TX vers le Shield Seeedstudio 2.x
CommunicationProtocol communicationProtocol;
@DardanIljazi
DardanIljazi / Master.ino
Created June 20, 2017 20:44
Master avec librairie
#include <SoftwareSerial.h>
#include "CommunicationProtocol.h"
/*********** DEBUT BLUETOOTH ***********/
#define RxD 11 // Cette pin doit être connectée à la pin TX du Bluetooth
#define TxD 12 // Cette pin doit être connectée à la pin RX du Bluetooth
SoftwareSerial blueToothSerial(RxD, TxD); // Communication RX/TX vers le Shield Seeedstudio 2.x
CommunicationProtocol communicationProtocol;
@DardanIljazi
DardanIljazi / Master.ino
Last active June 20, 2017 20:26
Master
/* CODE SANS LIBRAIRIE */
#include <SoftwareSerial.h>
/*********** DEBUT BLUETOOTH ***********/
#define RxD 11 // Cette pin doit être connectée à la pin TX du Bluetooth
#define TxD 12 // Cette pin doit être connectée à la pin RX du Bluetooth
SoftwareSerial blueToothSerial(RxD, TxD); // Communication RX/TX vers le Shield Seeedstudio 2.x