Angular 4: Bootstrap & Components (part 2)

First install Bootstrap, $ npm install –save bootstrap Then add bootstrap to .angular-cli.json which can be found in the root of the project. Find the ‘styles’ and add the path for bootstrap like this, “styles”: [ “../node_modules/bootstrap/dist/css/bootstrap.min.css”, “styles.css” ], Then in the project root run, $ npm install, Create a component called ‘sum’ with, $…Read More

Hardening SSH

SSH created key-pair More information on this topic at securing-your-server. On your local machine, create a 4096-bit RSA key-pair, $ ssh-keygen -b 4096 If you get a message to say that this already exists or to over write a file, then do not proceed, unless you want to create a new key-pair. If one exists,…Read More

Raspberry Pi 3 Express Application (part 8)

Check Node and npm are installed, $ node –version v7.4.0 $ npm –version 4.0.5 Install Express generator globally, $ npm install express-generator -g Check it, $ express –version 4.14.0 Create a new directory inside /opt/nodeserver $ mkdir tempGraph This will create several folders as well as the package.json file with all dependencies. Next install these…Read More

Raspberry Pi 3 DS18B20 Temperature Sensor (part 6)

Open /boot/config.txt $ sudo nano /boot/config.txt and add dtoverlay=w1-gpio to the end of the file. Reboot the system, $ sudo reboot Then run, $ sudo modprobe w1-gpio $ sudo modprobe w1-therm The change directory /sys/bus/w1/devices/ and list its contents, Change directory into 28-000006c87ee2 and then ‘cat w1_slave’. The ‘t=16125’ this a temperature reading of 16.125…Read More

Raspberry Pi 3 Node Server & systemd (part 5)

Run a simple Node server. Create the file and path, /opt/nodeserver/server.js const http = require(‘http’); const hostname = ‘’; // listen on all ports const port = 8080; http.createServer((req, res) => { res.writeHead(200, { ‘Content-Type’: ‘text/plain’ }); res.end(‘Hello people, I am a server \n’ + new Date().toISOString()); }).listen(port, hostname, () => { console.log(‘Server running at…Read More

Raspberry Pi 3 Static IP Address & No-ip setup (part 3)

To set up a static IP address on the Pi 3 which will remain constant inside you LAN open /etc/dhcpcd.conf $ sudo nano dhcpcd.conf Add to the bottom of this file, interface eth0 static ip_address= static routers= static domain_name_servers= interface wlan0 static ip_address= static routers= static domain_name_servers= Here is the static ip address I…Read More

Setting up gh-pages

Login to and create a new reporitory. Copy the link for this repository. It will look like this,<user-name>/<repo-name>.git On your local machine create a new directory, $ mkdir testGHpages cd into it $ cd testGHpages git init this directory $ git init Add a simple index.html file to this directory. <!doctype html> <html…Read More

D3.js Basic json Graph

Basic example of graphing using D3.js version 3 Useful links used for this post: <!DOCTYPE html> <html lang=’en’> <head> <meta charset=’utf-8′> <script src=”” type=”text/javascript”></script> <script type=”text/javascript” src=””></script> <script src=”” type=”text/javascript”></script> <script src=”” type=”text/javascript”></script> <script src=”” type=”text/javascript”></script> <link rel=”stylesheet” href=””> <link rel=”stylesheet” href=”css/tempGraph.css”> <link href=”” rel=”stylesheet” type=”text/css”> <script src=””></script> <script src=””></script> <script src=””></script> <script…Read More

Part 7: Django Login, Logout & Registration

Login form: Adapted from the login tutorial at techand startup. Create a new app called ‘accounts’ $ python startapp accounts Add ‘accounts’ to INSTALLED_APPS = [ ‘accounts’, ‘django.contrib.admin’, ‘django.contrib.auth’, …………. Go to crudProject/ and add to the top of the file, from django.shortcuts import render_to_response Below that add, def loggedin(request): return render_to_response(‘registration/loggedin.html’) If you…Read More

Python Dictionary into HTML Template

The following Python code will find instances of {body} in a file template.html and replace it with a string. Then a new file index.html is created with this change. with open(‘template.html’,’r’) as template_file: template = tokens = {‘title’: ‘My Title in a Dictionary’, ‘header’:’Stuff for heading’, ‘body’: ‘The body stuff’, ‘footer’: ‘This is…Read More