I hereby claim:
- I am krichardsson on github.
- I am krichardsson (https://keybase.io/krichardsson) on keybase.
- I have a public key whose fingerprint is 4535 9909 0180 64B7 1D84 B93D A9C9 475D B071 7717
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
class Dashing.Number extends Dashing.Widget | |
@accessor 'current', Dashing.AnimatedValue | |
@accessor 'difference', -> | |
if @get('last') | |
last = parseFloat(@get('last')) | |
current = parseFloat(@get('current')) | |
if last != 0 | |
diff = Math.abs(Math.round((current - last) / last * 100)) | |
"#{diff}%" |
boot2docker ssh sudo /etc/init.d/docker restart |
One way to enable a docker container to use docker, is to pass the socket for the docker daemon to the container. To make it work you need to: | |
1. use a container that has the docker cli installed. A dockerfile for that | |
FROM debian | |
RUN apt-get update && apt-get install wget -y | |
RUN wget https://get.docker.io/builds/Linux/x86_64/docker-latest -O /bin/docker | |
RUN chmod +x /bin/docker | |
2. mount the docker daemon socket when the container is started docker |
# Create a mysql container | |
docker run --name myDb -e MYSQL_DATABASE=db-name -e MYSQL_ROOT_PASSWORD=topsecret -p 3306:3306 -d mysql | |
# Populate it | |
docker run --rm -it --link myDb:mysql -v ${PWD}:/dump mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD" --database="$MYSQL_ENV_MYSQL_DATABASE" < /dump/my-dump.sql' |
The status and remaining time is pulled in from octoprint by the client. An image is taken from a webcam and added as background for the widget.
Add to your dashboard
<li data-sizex="1" data-sizey="1">
<div data-id="octoprint" data-view="Octoprint" data-title="3D printer"></div>
</li>
class Dashing.Pomodoro extends Dashing.Widget | |
ready: -> | |
setInterval(@startCountdown, 500) | |
startCountdown: => | |
current_timestamp = Math.round(new Date().getTime()/1000) | |
end = parseInt($(@node).find("#pomodoro-end-time").html()) | |
end_timestamp = Math.round(end / 1000) | |
seconds_until_end = end_timestamp - current_timestamp |
# -*- coding: utf-8 -*- | |
# | |
# || ____ _ __ | |
# +------+ / __ )(_) /_______________ _____ ___ | |
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ | |
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ | |
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ | |
# | |
# Copyright (C) 2018 Bitcraze AB | |
# |
/* | |
* || ____ _ __ | |
* +------+ / __ )(_) /_______________ _____ ___ | |
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ | |
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ | |
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ | |
* | |
* Crazyflie firmware. | |
* | |
* Copyright 2018-2021, Bitcraze AB |