Angular2 Chat Demo

This demo was created at the request of a company for a chat demonstration web app, suitable for desktops and mobile. This demo was inspired from https://github.com/start-angular/angular2-node-socket-io-chat-app.

If you paste the URL of a YouTube video, that video plays right in the chat window.

It also allows you to attach files and pictures. On mobile devices it allows you to send emoji. In the future plans are in place for an emoji selector on computers.

There is no login feature, it’s a public chat room, where participants only need to enter a nickname.

You can find the code for this demo on GitHub

A live demo is also available here.

Setting up moodle on Ubuntu 16.04

This post is to demonstrate how to setup Moodle 3.3 on Ubuntu 16.04:

Install aptitude package manager.

sudo apt-get install aptitude

Install Apache2

sudo aptitude install apache2

Install mysql

sudo apt-get install mysql-server

Secure Mysql installation

mysql_secure_installation

Install PHP

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql php-pear php-gd php-mbstring php-xml php-xmlrpc php-curl php-mbstring php-mcrypt php-soap php-intl

Install Pear Modules

sudo pear upgrade-all

sudo pear install MDB2-2.5.0b5

sudo pear install “channel://pear.php.net/MDB2_Driver_mysqli-1.5.0b4″

#Note that pear/mdb2#mysql is no longer available in PHP 7.0 since the mysql extension was removed in this version

sudo pear install “channel://pear.php.net/LiveUser-0.16.14″

sudo pear install HTML_Template_it

Install PIP (Python’s pear equivalent)

sudo apt-get install python-pip

sudo apt-get install unzip

sudo apt-get install elinks (text browser, to download moodle)

Install SSL:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt/etc/apache2/sites-available/default-ssl.conf

sudo nano /etc/apache2/sites-available/default-ssl.conf

Add/Edit the following lines:

ServerAdmin your_email@example.com
ServerName server_domain_or_IP
SSLCertificateFile      /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

Enable SSL and SSL VirtualHost:

sudo a2ensite default-ssl
sudo a2enmod ssl

Configuration test:
sudo apache2ctl configtest

Restart apache2 to enable SSL settings:

sudo systemctl restart apache2

Mysql commands:

create database moodle;

create user ‘webadmin’@’%’ identified by ‘{some password}’;

grant all on moodle.* to ‘webadmin’@’%’;

Download Moodle:

cd  /tmp/

elinks https://download.moodle.org/download.php/stable33/moodle-latest-33.tgz

navigate to and click on the download now link

tar xfz moodle-latest-33.tgz

Note:: Change moodle-latest-33.tgz to the correct file name, given on the web page -> https://download.moodle.org/releases/latest/

download.moodle.org
Install Moodle on your own server (requires a web server with PHP and a database) by downloading one of the following packages or obtaining Moodle via Git.

Move all moodle files to the wwwroot:sudo mv moodle/* /var/www/html/

 

Configure config.php

sudo cp config-dist.php config.php

sudo nano config.php

Set host and database configuration to match those set above.

 

Browse to your New Moodle Installation:

http://{your IP}/