##In Brief
You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'.
Consider something like:
| alias wget='wget -q --no-check-certificate' | |
| # so that we can install virtualbox via apt-get | |
| for x in xenial xenial-security xenial-updates; do | |
| egrep -qe "deb-src.* $x " /etc/apt/sources.list || echo "deb-src http://archive.ubuntu.com/ubuntu ${x} main universe" | tee -a /etc/apt/sources.list | |
| done | |
| echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" | tee -a /etc/apt/sources.list.d/virtualbox.list | |
| wget https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add - | |
| apt-get update |
| FROM node | |
| RUN mkdir -p /usr/src/app | |
| COPY index.js /usr/src/app | |
| EXPOSE 8080 | |
| CMD [ "node", "/usr/src/app/index" ] |
| - name: Ensure hostname set | |
| hostname: name={{ inventory_hostname }} | |
| when: not inventory_hostname|match('(\d{1,3}\.){3}\d{1,3}') | |
| - name: Ensure hostname is in /etc/hosts | |
| lineinfile: | |
| dest=/etc/hosts | |
| regexp="^{{ ansible_default_ipv4.address }}.+$" | |
| line="{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" |
| Software for the Project: | |
| Raspbian Wheezy Debian Linux | |
| Win32Disk Imager | |
| The CanaKit comes with a pre-loaded SD card that includes the same version of Debian Wheezy that I used for this project. However, in an effort to get a little more speed out of the system, I used the 95MB/s Sandisk extreme listed above. It seemed to help, but I did not bench mark it beyond observation. | |
| Anyway, lets get down to building a Raspberry Pi Web Kiosk. | |
| Step 0: Get all of the hardware. | |
| Step 1: Get all of the software. |
| // XORCipher - Super simple encryption using XOR and Base64 | |
| // | |
| // Depends on [Underscore](http://underscorejs.org/). | |
| // | |
| // As a warning, this is **not** a secure encryption algorythm. It uses a very | |
| // simplistic keystore and will be easy to crack. | |
| // | |
| // The Base64 algorythm is a modification of the one used in phpjs.org | |
| // * http://phpjs.org/functions/base64_encode/ | |
| // * http://phpjs.org/functions/base64_decode/ |
| /* Polyfill indexOf. */ | |
| var indexOf; | |
| if (typeof Array.prototype.indexOf === 'function') { | |
| indexOf = function (haystack, needle) { | |
| return haystack.indexOf(needle); | |
| }; | |
| } else { | |
| indexOf = function (haystack, needle) { | |
| var i = 0, length = haystack.length, idx = -1, found = false; |
| ### KERNEL TUNING ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |
| #!/usr/bin/env bash | |
| # memusg -- Measure memory usage of processes | |
| # Usage: memusg COMMAND [ARGS]... | |
| # | |
| # Author: Jaeho Shin <netj@sparcs.org> | |
| # Created: 2010-08-16 | |
| ############################################################################ | |
| # Copyright 2010 Jaeho Shin. # | |
| # # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); # |