$ cd /path/to/Dockerfile
$ sudo docker build .
View running processes
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"golang.org/x/net/proxy" | |
) |
buf, bodyErr := ioutil.ReadAll(r.Body) | |
if bodyErr != nil { | |
log.Print("bodyErr ", bodyErr.Error()) | |
http.Error(w, bodyErr.Error(), http.StatusInternalServerError) | |
return | |
} | |
rdr1 := ioutil.NopCloser(bytes.NewBuffer(buf)) | |
rdr2 := ioutil.NopCloser(bytes.NewBuffer(buf)) | |
log.Printf("BODY: %q", rdr1) |
Run ssh-keygen | |
echo -e "#cloud-config\nssh_authorized_keys:\n - $(cat .ssh/id_rsa.pub)" > $HOME/cloud-config.yml | |
After boot rancherOS | |
sudo scp frank@xxx:/home/frank/cloud-config.yml . | |
sudo ros install -d /dev/sda -c cloud-config.yml |
function promiseMap(inputValues, mapper) { | |
const reducer = (acc$, inputValue) => | |
acc$.then(acc => mapper(inputValue).then(result => acc.push(result) && acc)); | |
return inputValues.reduce(reducer, Promise.resolve([])); | |
} | |
/* Example */ | |
const axios = require('axios'); |
This guide has moved to a GitHub repository to enable collaboration and community input via pull-requests.
https://github.com/alexellis/k8s-on-raspbian
Alex
STEP 2: setup docker to run react app (dev and production) configuration: https://gist.github.com/przbadu/929fc2b0d5d4cd78a5efe76d37f891b6
Because we are using Docker
, we are not going to install node
, npm
, create-react-app
in our development machine, not even for generating create-react-app
scaffold.
For this purpose I am using 2-step docker configuration:
create-react-app
Capturing video from the rpi camera with ffmpeg can vary from less than 5% to 100% of the CPU (rpi zero) depending on ffmpeg using the hardware acceleration or not.
On many github issues one finds the suggestion of using h264_omx
codec to use the gpu - but it does not ship with the default ffmpeg
on Raspbian.
Instead I found that one can use the v4l2 driver provided by raspbian to get hardware accelerated h264 output. Also setting the video size will save one from using a (cpu) scale filter.
capture h264 video from rpi camera
It's quite easy and the same process applies to all Firebase features with minor changes.
In order to deploy you'll need a deployment token (I named it FIREBASE_TOKEN
) and it can be
acquired by using the following command
firebase login:ci
CN_NAME=localhost | |
# Certificate Authority | |
echo Generate CA key: | |
openssl genrsa -passout pass:1111 -des3 -out ca.key 4096 | |
echo Generate CA certificate: | |
openssl req -passin pass:1111 -new -x509 -days 365 -key ca.key -out ca.crt -subj "/CN=${CN_NAME}" | |
# Server side key | |
echo Generate server key: |