- Save the
nodeexporter.conf
upstart script to/etc/init/nodeexporter.conf
- Grab the armv7 node exporter binary from https://github.com/prometheus/node_exporter/releases
- Add the node_exporter binary to
/usr/local/bin/node_exporter
- Reboot or start the service
service nodeexporter start
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<p>Viewing log file : /var/log/nginx/access.log</p> | |
<pre style="height:600px"> | |
<?php | |
echo file_get_contents("/var/log/nginx/access.log"); | |
?> | |
</pre> | |
</div> |
Tailscale provides a simple to setup and use private network. I've just starting using this on my home network for home assistant and valetudo. Here are the instructions for setting up Tailsclae on the roborock vacuum.
For official tailscale installation see here: https://tailscale.com/download/linux/static
This gist is an example of how to use home assistant to reload the map of the vacuum
How to setup the vacuum side of things
- You will need to copy the
recovery_map.sh
to/mnt/data/valetudo/recovery_map.sh
on the vacuum - Create the backup folder
mkdir -p /mnt/data/rockrobo/backup/
- Run a complete clean or manually steer the vacuum around the entire house. After finishing the tour, return the vacumm to the dock.
- Copy the base map to the backup folder
cp /mnt/data/rockrobo/last_map /mnt/data/rockrobo/backup/
and the charger poscp /mnt/data/rockrobo/ChargerPos.data /mnt/data/rockrobo/backup/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Programming task | |
================ | |
The following is an implementation of a simple Named Entity Recognition (NER). | |
NER is concerned with identifying place names, people names or other special | |
identifiers in text. | |
Here we make a very simple definition of a named entity: A sequence of | |
at least two consecutive capitalized words. E.g. "Los Angeles" is a named |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Programming task | |
================ | |
Implement the method iter_sample below to make the Unit test pass. iter_sample | |
is supposed to peek at the first n elements of an iterator, and determine the | |
minimum and maximum values (using their comparison operators) found in that | |
sample. To make it more interesting, the method is supposed to return an | |
iterator which will return the same exact elements that the original one would | |
have yielded, i.e. the first n elements can't be missing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the libraries | |
library(Rcpp) | |
library(hydroGOF) | |
# Load the source cpp file with a few gof values. | |
sourceCpp("gof.cpp") | |
# Create some data to test and compare the two functions. | |
obs <- rnorm(10) | |
sim <- rnorm(10) | |
# Compare the two functions | |
NSE_fast(sim,obs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## The limits of the instrument (milivolts) and the sensor (QSU) | |
mv_conv <- data.frame(mv_limits = c(10.85, 4965),qsu_limits = c(0,200)) | |
## Plot the raw data to get an idea of what is hapenning | |
plot(qsu_limits~mv_limits, mv_conv, xlab="mV (datalogger)", | |
ylab = "Sensor limits (QSU)") | |
## Fit a model of the relationship | |
mv_conv_mod <- lm(qsu_limits~mv_limits, mv_conv) | |
## Add the trend model to the plot | |
abline(mv_conv_mod) | |
## An example to estimate the mV (Should be close to 100 QSU.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### create some fictional data | |
dir.create("tmp") | |
setwd("tmp") | |
for(i in 1:10){ | |
tmp_file <- data.frame(x=1:100, y=rnorm(100), z = rnorm(100)) | |
tmp_file_name <- paste0(paste(letters[sample(1:24, 10)], collapse= ""), ".csv") | |
write.csv(tmp_file, tmp_file_name, row.names= FALSE) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set.seed(1082) | |
# Create two weeks of 15 minute data | |
library(lubridate) | |
dates <- seq.POSIXt(dmy_hm("01-01-2013 00:00"), dmy_hm("31-12-2013 11:45"), by = "15 mins") | |
# Add a column with a random variable with mean = 10 | |
temp <- data.frame(date = dates, temp = rnorm(length(dates))+10) | |
plot(temp, type='l') | |
# aggreagate the data to daily by converting the POSIX date to date format (i.e drop the timestamp) | |
daily_temp <- aggregate(temp$temp, list(date=as.Date(temp$date)), mean) | |
# fix the names up |
NewerOlder