Bloatware tracking

At some point I may need to get this running again, so taking some notes. So far I’ve installed:

Google’s protobuf library, for easy data exchange between the Python web stack and C++ binaries. Note: Install from github, since the .zip file on the official site is way out of date. For python support, first install the C++ libraries via ./configure, make, sudo make install and then run python setup.py build && python setup.py install from the python sub-directory.

OpenCV 3.0.0 + nonfree components. Opencv 3.0.0 had some problems with I installed it via the package manager, so I installed from source instead. Make sure the nonfree component is compiled at the same version as the main component (they’re in different repos).

Flask (Python web framework)

uWSGI to expose instances of my Flask app via a WSGI socket to handle multiple requests at once. Overkill for now, but might as well do it right from the start.

https://uwsgi-docs.readthedocs.io/en/latest/

[uwsgi]
module = server
master = true
processes = 5
socket = /tmp/homeview.sock
chmod-socket = 666
vacuum = true
uid = philippp
gid = www-data
die-on-term = true

nginx to serve requests to the Flask server as well as media.

/etc/nginx/sites-available/homeview:

server {
listen 5000;
server_name garage;
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/homeview.sock;
}

location /static {
alias /var/code/homeview/static;
}
location /captures {
alias /var/code/homeview/captures;
}
}

Supervisord to keep uWSGI and the image capture script running.

philippp@pbox:~/Downloads/protobuf-2.6.1/examples$ sudo cat /etc/supervisor/conf.d/homeview.conf
[inet_http_server]
port = 0.0.0.0:9001
[supervisorctl]
serverurl = http://garage:9001
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[program:uwsgi]
command=uwsgi — ini /var/code/homeview/uwsgi.ini
directory=/var/code/homeview
autostart=true
autorestart=true
stderr_logfile=/var/code/homeview/logs/uwsgi_stderr.log
stdout_logfile=/var/code/homeview/logs/uwsgi_stdout.log
stopsignal=INT
[program:capture]
command=/var/code/homeview/capture.sh
directory=/var/code/homeview
autostart=true
autorestart=true
stderr_logfile=/var/code/homeview/logs/capture_stderr.log
stdout_logfile=/var/code/homeview/logs/capture_stdout.log
stopsignal=INT
user=philippp
Like what you read? Give Philipp Pfeiffenberger a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.