Setup Grafana in Raspbian (Raspberrypi)

The below post is a simple explanation I did time ago, if you want further info and better explanation about how to setup a monitoring system into your Raspberripy please go to here. Raspbian version:9.8 $ uname -r 4.14.98-v7+ $ uname -m armv7l Version installed on my RasPi: Grafana v6.0.2 (3f4c2e7) Download Grafana package for your correct Raspi ARM $sudo dpkg -i grafana_6.1.3_armhf.deb $systemctl start grafana-server $systemctl status grafana-server then you will see from the status propmt the address=0.0.0.0:3000 msg="HTTP Server Listen" logger=http.server address=0.0.0.0:3000 To check the site is working go through localhost:3000 ...

2019-04-09

Create a job using crontab

To automate tasks or create some monitoring job we can use the older and efficient tool the โ€œCronJobโ€. For our example, Iโ€™ve created a simple script to detect the cache memory and clean it if raise to a condition then send a notification by mail. Library used: exim4 (mail server) or ssmtp (mail server). Both uses the same โ€œmailโ€ command. Script: # grab the buff/cache memory mem="$(free -m | grep 'Mem:' | awk '{print $6}')" if (( $mem > 350 )) then echo 'wooo is more than 250M' echo 3 | sudo tee /proc/sys/vm/drop_caches echo 'cache dropped' echo "Memory buff/cache cleaned last value:" $mem | mail -s "cache_memory" target_mail@local.com else echo 'be cool man, memory lower' fi script path: /user/Documents/script/memory ...

2019-04-03

Parsing date format from .xlsx to R

Version: platform x86_64-redhat-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu version.string R version 3.5.3 (2019-03-11) Library lubridate Parse method โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” as.factor โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” mydata$FECHA_NACIMIENTO<-as.factor(mydata$FECHA_NACIMIENTO) โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” variable for strptime โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” tempo<-strptime(mydata$FECHA_NACIMIENTO,"%d/%m/%Y") mydata$FECHA_NACIMIENTO<-as.Date(tempo,"%d/%m/%Y") โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” clean variable โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” rm (tempo) mydata$FECHA_NACIMIENTO <- format(as.Date(mydata$FECHA_NACIMIENTO), "%d/%m/%Y") โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” parsing data โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” library(lubridate) mydata$FECHA_NACIMIENTO <-dmy(mydata$FECHA_NACIMIENTO)

2019-04-01

Disable live-restore to run Docker Swarm

The following instruction is a solution when you got an error response with live-restore using Docker Swarm in Fedora 28 or highter $ docker swarm init Error response from daemon: --live-restore daemon configuration is incompatible with swarm mode Thatโ€™s not possible to enable Live-restore and Swarm-mode together. First make sure that the SElinux is Permissive or Disabled. $ sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 31 Then remove the โ€“live-restore line from the /etc/sysconfig/docker ...

2019-03-28

Pulling Mysql using Docker Hub into Linux workstation

$ systemctl start docker $ systemctl status docker $ docker pull mysql $ docker image ls $ docker run --name db -e MYSQL_ROOT_PASSWORD=mysql123 -d mysql Use the docker exec -it command to start a mysql client inside the Docker container you have started, like the following: $ docker exec -it db mysql -uroot -p

2019-03-28

Enable "Kubectl" auto-completion in the Shell (Linux)

When youโ€™ve done the SDK installation in your Linux workstation. list the components you have installed, then you will see the full list additional components from gcp SDK: gcloud components list gcloud components install <COMPONENT_ID> gcloud components install kubectl Then follow the instruction from the kubernetes official documentation, check the โ€œbash-completionโ€ and finally issue the command below: echo "source <(kubectl completion bash)" >> ~/.bashrc Even you can go directly through your .bashrc (sudo) to add manually, it should look like: ...

2018-11-25