Skip to content

Instantly share code, notes, and snippets.

View frett27's full-sized avatar

Patrice Freydiere frett27

View GitHub Profile
istall a role in roles folder
ansible-galaxy install -p roles vmware.ansible-role-sudo
@frett27
frett27 / gist:8331035f6807dfd8a257716532dabdec
Created September 18, 2017 19:38
SSH add key, one line
cat ~/.ssh/id_rsa.pub | ssh user@192.168.1.1 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
@frett27
frett27 / gist:81c29a5fde8205de64bfd870267db8f1
Created August 2, 2017 16:55
Debugging file system of a crashed docker
Reference : https://github.com/jpetazzo/nsenter/issues/27
Mount the crashed container file system to local system should help if you just want to handle file related problem.
Assume that you are using devicemapper as storage driver , the crashed container name is my-crashed-container, docker 1.10 or later.
get docker pool name and devicename of container
[root@docker ~]# dmsetup ls
docker-202:1-1051814-pool (253:0)
sudo apt-get clean
sudo mv /var/lib/apt/lists /tmp
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update
@frett27
frett27 / esp32_promisc.c
Created June 18, 2017 19:01 — forked from brainstorm/esp32_promisc.c
esp32 promiscuous mode and packet injection experiments
// Espressif ESP32 promiscuous mode and packet injection experiments
// by brainstorm at nopcode org
#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "lwip/err.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
RP : aweek
stddev within 10 min
select stddev(value) from home.aweek.wifi where time > now() - 10m group by mac,time(1m) fill(none)
continuous query :
cq_temperature_avg_1d CREATE CONTINUOUS QUERY cq_temperature_avg_1d ON home BEGIN SELECT mean(value) INTO home.autogen.avg_temperature_avg_1d FROM home.autogen.temperature GROUP BY time(1d) END

install armbian from website

install docker on the device

sudo curl -sSL get.docker.com | sh

-->for missing aufs support on default kernel, use overlay2

grant user for docker use

# ubuntu 16
sudo apt-get install -y software-properties-common
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && add-apt-repository -y ppa:webupd8team/java && apt-get update && apt-get install -y oracle-java8-installer && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/oracle-jdk8-installer
# ubuntu 14
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer
configure the default.cgpr for avr : gprconfig -o default.cgpr --db . --target=avr