From 541a8ef606c53944b9879a22592447bc9643ef70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin-Charles=20Guih=C3=A9neuf?= Date: Sat, 12 Sep 2020 23:47:55 +0200 Subject: [PATCH] navi: Migration from Nextcloud --- navi/compression.cheat | 20 ++++++++++++++++++++ navi/make.cheat | 40 ++++++++++++++++++++++++++++++++++++++++ navi/netatmo.cheat | 18 ++++++++++++++++++ navi/syncapi.cheat | 18 ++++++++++++++++++ navi/systemctl.cheat | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 133 insertions(+) create mode 100644 navi/compression.cheat create mode 100644 navi/make.cheat create mode 100644 navi/netatmo.cheat create mode 100644 navi/syncapi.cheat create mode 100644 navi/systemctl.cheat diff --git a/navi/compression.cheat b/navi/compression.cheat new file mode 100644 index 0000000..ad699a6 --- /dev/null +++ b/navi/compression.cheat @@ -0,0 +1,20 @@ +% compression + +# Create a tar containing files +tar cf .tar + +# Extract the files from a tar +tar xf + +# Create a tar with Gzip compression +tar czf .tar.gz + +# Compress file and appends .gz to its name +gzip + +# Decompress compressed file +gzip -d + +$ path: ls +$ tar_file: ls *.{tar,tar.*} 2>/dev/null +$ gz_file: ls *.gz diff --git a/navi/make.cheat b/navi/make.cheat new file mode 100644 index 0000000..5fbf944 --- /dev/null +++ b/navi/make.cheat @@ -0,0 +1,40 @@ +% make-stm +# Log +make FIRMWARE_VERSION= FORCE_TRACE=y MULTI_JOBS=y SECRET= +# No log +make FIRMWARE_VERSION= MULTI_JOBS=y SECRET= +# Variables +$ product: echo "nlg nlg-stm32 nmr nmr-stm32" | tr " " "\n" +$ job: echo " .clean .reflash" | tr " " "\n" +$ secret: echo "c702ca256060d168bb4fffa2ecacb0e4 f6676952ded14a3c5bed81c756d4eebc" | tr " " "\n" + + +% make-samr +# Log +make APP_VERSION= APP_USE_CHANNEL=11 FACTORY_TEST=y ENABLE_TRACE_SUPPORT=y RTT=y MULTI_JOBS=y +# No log +make APP_VERSION= APP_USE_CHANNEL=11 FACTORY_TEST=y MULTI_JOBS=y +# Variables +$ product: make -qp | awk -F":" "/^n[a-zA-Z0-9][^$#\/\t=\.]*:([^=]|$)/ { split(\$1,A,/ /); for(i in A)print A[i] }" +$ job: echo " .clean .reflash" | tr " " "\n" + + +% get-line-stm +# STM +arm-none-eabi-addr2line -e $HOME/Netatmo/embedded/magellan/apps/user/nlg-stm32/app.elf +# Variables +$ product: echo "nlg nlg-stm32 nmr nmr-stm32" | tr " " "\n" + + +% get-line-samr +# SAMR +arm-none-eabi-addr2line -e $HOME/Netatmo/embedded/magellan/apps/user//*.elf +# Variables +$ product: make -qp | awk -F":" "/^n[a-zA-Z0-9][^$#\/\t=\.]*:([^=]|$)/ { split(\$1,A,/ /); for(i in A)print A[i] }" +% parser + + +# NLG Model parser +flasher -dumpflashatoffset 0x460000 0x40000 && +# Variables +$ nlg_parser: echo "$HOME/Netatmo/embedded/magellan/apps/user/nlg-stm32/model_parser/nlg_model_parser" diff --git a/navi/netatmo.cheat b/navi/netatmo.cheat new file mode 100644 index 0000000..cce2d52 --- /dev/null +++ b/navi/netatmo.cheat @@ -0,0 +1,18 @@ +% flasher +# Set server +flasher -setserver nv2 +$ server: echo "netcomv2.inte.netatmo.net nv2-nlg.netatmo.net nv2-nmg.netatmo.net upp.netatmo.net" | tr " " "\n" + + +% jlink +# JLinkExe +JLinkExe -if SWD -speed 1000 -device +# JLinkGDBServer +JLinkGDBServer -if SWD -device +# Variables +$ target: echo "ATSAMR21E19A nRF52" | tr " " "\n" + + +# Sniffer Zigbee +/zigbee/python_zigbee_interface.py -c +$ pyet: echo "$HOME/Netatmo/core/python-emb-tools/python/bin" diff --git a/navi/syncapi.cheat b/navi/syncapi.cheat new file mode 100644 index 0000000..d437c96 --- /dev/null +++ b/navi/syncapi.cheat @@ -0,0 +1,18 @@ +% syncapi + +# SyncAPI Muller +/syncapiadmin.py --project muller -s --endpoint -c /muller_.swp --mac + +# SyncAPI Legrand +/syncapiadmin.py --project legrand -s --endpoint -c /legrand_.swp --mac + +# Debug parser Legrand +/debug_parser.py --project legrand -s -c /legrand_.swp -r -pp -g + +# Paths +$ syncapi_path: echo "$HOME/Netatmo/core/python-emb-tools/python/bin/syncapiadmin" +$ debug_path: echo "$HOME/Netatmo/core/python-emb-tools/python/bin/debug" + +# Variables +$ server: echo "prod inte" | tr " " "\n" +$ endpoint: echo "getstatus getconfigs setstate setconfigs getdebuginfo getoeminfo" | tr " " "\n" diff --git a/navi/systemctl.cheat b/navi/systemctl.cheat new file mode 100644 index 0000000..29a3387 --- /dev/null +++ b/navi/systemctl.cheat @@ -0,0 +1,37 @@ +% systemctl + +# Start service +systemctl start + +# Stop service +systemctl stop + +# Enable service +systemctl enable + +# Disable service +systemctl disable + +# Restart service +systemctl restart + +# Reload service +systemctl reload + +# Service status +systemctl status + +# List running services +systemctl list-units --type=service --state=running + +# List enabled services +systemctl list-unit-files --type=service --state=enabled + +# List disabled services +systemctl list-unit-files --type=service --state=disabled + +$ service_inactive: systemctl list-units --type=service --state=inactive | awk '{print $1}' | grep .service | sed 's/.service$//' +$ service_active: systemctl list-units --type=service --state=active | awk '{print $1}' | grep .service | sed 's/.service$//' +$ service_enabled: systemctl list-unit-files --type=service --state=enabled | awk '{print $1}' | grep .service | sed 's/.service$//' +$ service_disabled: systemctl list-unit-files --type=service --state=disabled | awk '{print $1}' | grep .service | sed 's/.service$//' +$ service: systemctl list-units --type=service --all | awk '{print $1}' | grep .service | sed 's/.service$//'