Compare commits

...

15 Commits

Author SHA1 Message Date
Robin-Charles GUIHENEUF
1009c4707b aliases: Add micro alias 2020-11-21 16:52:15 +01:00
Robin-Charles GUIHENEUF
d5ab2594b0 navi: Add some cheat sheets 2020-11-21 16:52:15 +01:00
Robin-Charles GUIHENEUF
661e0f0435 install: Add micro editor install 2020-11-21 10:06:33 +01:00
24e9117c04 alias: Add git profile switch aliases 2020-11-16 10:01:19 +01:00
d621ec6b7e navi: Add nginx cheat sheet 2020-11-16 10:01:19 +01:00
28177e5df9 navi: Add syncapi debug cheatsheets 2020-11-16 10:01:19 +01:00
4ca698cf87 aliases: Introduce git_parent and associated rebase aliases 2020-11-16 10:01:19 +01:00
2e5b319202 aliases: General cleanup 2020-11-16 10:01:19 +01:00
3b3d680b0a zsh: Add completion for Makefile implicit targets 2020-11-16 10:01:19 +01:00
5a47304c2e zsh: Add preexec & precmd hook to vulporuza theme 2020-11-16 10:01:19 +01:00
b2e8e841f6 aliases: Add Netatmo path to PATH variable 2020-11-16 10:01:19 +01:00
fcf10e1715 aliases: Add git amend alias to amend commits automatically 2020-11-16 10:01:19 +01:00
69dfd44dd8 terminator: Include configuration file 2020-11-16 10:01:19 +01:00
ec40d2b06e codium: Migration from Nextcloud 2020-11-16 10:01:19 +01:00
e116f88a1c navi: Migration from Nextcloud 2020-11-07 11:34:47 +01:00
21 changed files with 605 additions and 31 deletions

View File

@ -1,19 +1,29 @@
export CONFIG_DIR="$HOME/.dotfiles"
# Refresh
# ╦═╗┌─┐┌─┐┬─┐┌─┐┌─┐┬ ┬
# ╠╦╝├┤ ├┤ ├┬┘├┤ └─┐├─┤
# ╩╚═└─┘└ ┴└─└─┘└─┘┴ ┴
if [ -z "${ZSH}" ]; then
alias refresh=". $HOME/.bashrc"
else
alias refresh=". $HOME/.zshrc"
fi
# Nautilus
alias open="nautilus ."
# ╦┌┐┌┌─┐┌┬┐┌─┐┬ ┬
# ║│││└─┐ │ ├─┤│ │
# ╩┘└┘└─┘ ┴ ┴ ┴┴─┘┴─┘
# Install scripts
alias install_cli="$CONFIG_DIR/auto-config-cli.sh"
alias install_gui="$CONFIG_DIR/auto-config.sh"
# ╔╦╗╦╔═╗╔═╗
# ║║║║╚═╗║
# ╩ ╩╩╚═╝╚═╝
# Nautilus
alias open="nautilus ."
# Go to config directory
alias config="cd $CONFIG_DIR"
@ -25,6 +35,7 @@ function config_update {
# Editor
alias c='codium'
alias e='micro'
# Find
alias find='find . -name'
@ -52,33 +63,65 @@ function s_clean {
s_on
}
# Make
alias mk='make -j5'
alias mec='make'
alias mecque='make'
# VPN
alias vpn="sudo openvpn --config $HOME/Nextcloud/#\ -\ Configs/rguiheneuf.ovpn"
# Git
alias gst='git status'
# ╔═╗┬┌┬┐ ╔═╗┬ ┬┌─┐┌─┐┌─┐┌─┐
# ║ ╦│ │ ╠═╣│ │├─┤└─┐├┤ └─┐
# ╚═╝┴ ┴ ╩ ╩┴─┘┴┴ ┴└─┘└─┘└─┘
alias gs='git status'
alias gc='git checkout'
alias gcm='git checkout master'
alias gpl='git pull'
alias gph='git push'
alias pull='git pull'
alias push='git push'
alias gsu='git submodule update --init'
alias gcp='git cherry-pick'
alias add='git add'
alias commit='git commit -m "To fixup"'
alias cont='git rebase --continue'
# Git cleaners
alias branch_clean='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
alias tag_clean='git tag -l | xargs git tag -d && git fetch -t'
function git_parent {
git log --pretty=format:"%D" | \
grep -v "^$" | \
sed "s/, /\n/g" | \
grep -v "HEAD" | \
grep -v `git rev-parse --abbrev-ref HEAD` | \
grep -v "tag" | \
head -n1 | \
sed "s/origin\/\([^,]*\)/\1/"
}
function git_parent_tag {
git log --pretty=format:"%D" | \
grep -v "^$" | \
sed "s/, /\n/g" | \
grep -v "HEAD" | \
grep -v `git rev-parse --abbrev-ref HEAD` | \
head -n1 | \
sed "s/origin\/\([^,]*\)/\1/" | \
sed "s/tag: \([^,]*\)/\1/"
}
alias log='git log --graph --decorate --oneline'
# Branch
function branch_create {
git checkout -b $1
git push -u origin $1
}
# Tag
alias tag_clean='git tag -l | xargs git tag -d && git fetch -t'
# Tag helpers
function tag_create {
git tag $1
git push origin $1
@ -91,18 +134,22 @@ function tag_replace {
git push origin $1
}
function grb {
git rebase -i HEAD~$1
}
function g_save {
git add *
git commit -m "[skip ci] Save: do not merge"
git push -f
}
# ╔═╗┬┌┬┐ ╦═╗┌─┐┌┐ ┌─┐┌─┐┌─┐
# ║ ╦│ │ ╠╦╝├┤ ├┴┐├─┤└─┐├┤
# ╚═╝┴ ┴ ╩╚═└─┘└─┘┴ ┴└─┘└─┘
function grb {
git rebase --interactive HEAD~$1
}
function grbm {
# Save actual branch
# Save current branch
BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
# Checkout master & pull
@ -111,24 +158,83 @@ function grbm {
# Back to previous branch
git checkout ${BRANCH}
git rebase -i master
git rebase --interactive master
}
function grbr {
function grbi {
# Save current branch
BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
# Save parent branch
PARENT=$(git_parent)
# Checkout parent & pull
git checkout ${PARENT}
git pull
echo "Rebasing on ${PARENT}"
# Back to previous branch
git checkout ${BRANCH}
git rebase --interactive ${PARENT}
}
function grbroot {
git rebase --interactive --autosquash --root
}
function gam {
git autofixup master
git rebase --interactive --autosquash master
}
function ga {
git autofixup HEAD~$1
git rebase --interactive --autosquash HEAD~$1
}
# Repositories
function gam {
git autofixup master
git rebase --interactive --autosquash master
}
function gai {
# Save parent branch
PARENT=$(git_parent)
echo "Rebasing with autofixup on ${PARENT}"
git autofixup ${PARENT}
git rebase --interactive --autosquash ${PARENT}
}
# ╔═╗┬┌┬┐ ╔═╗┬─┐┌─┐┌─┐┬┬ ┌─┐
# ║ ╦│ │ ╠═╝├┬┘│ │├┤ ││ ├┤
# ╚═╝┴ ┴ ╩ ┴└─└─┘└ ┴┴─┘└─┘
function git_config {
echo "User: $(git config user.name)"
echo "Mail: $(git config user.email)"
}
function git_pro {
git config --global user.name "Robin-Charles GUIHENEUF"
git config --global user.email rguiheneuf@netatmo.com
git_config
}
function git_perso {
git config --global user.name "Robin-Charles Guihéneuf"
git config --global user.email robin-charles@hotmail.fr
git_config
}
# ╔═╗┬┌┬┐ ╔═╗┌┬┐┌─┐┌┐┌┌┬┐
# ║ ╦│ │ ╠═╣│││├┤ │││ ││
# ╚═╝┴ ┴ ╩ ╩┴ ┴└─┘┘└┘─┴┘
alias amend_pro="GIT_EDITOR=true git rebase --preserve-merges --exec 'git commit --amend --author=\"Robin-Charles GUIHENEUF <rguiheneuf@netatmo.com>\"' $1"
alias amend_perso="GIT_EDITOR=true git rebase --preserve-merges --exec 'git commit --amend --author=\"Robin-Charles Guihéneuf <robin-charles@hotmail.fr>\"' $1"
# ╦═╗┌─┐┌─┐┌─┐┌─┐┬┌┬┐┌─┐┬─┐┬┌─┐┌─┐
# ╠╦╝├┤ ├─┘│ │└─┐│ │ │ │├┬┘│├┤ └─┐
# ╩╚═└─┘┴ └─┘└─┘┴ ┴ └─┘┴└─┴└─┘└─┘
alias bc='cd $HOME/Netatmo/embedded/firmware-bitcloud'
alias fw='cd $HOME/Netatmo/embedded/firmware'
alias nmr='cd $HOME/Netatmo/embedded/nmr'
@ -137,7 +243,7 @@ alias mag='cd $HOME/Netatmo/embedded/magellan'
alias nsp='cd $HOME/Netatmo/embedded/nsp'
alias mulot='cd $HOME/mulot/firmware'
# Repositories in editor
# In editor
alias c_bc='c $HOME/Netatmo/firmware-bitcloud.code-workspace'
alias c_fw='c $HOME/Netatmo/firmware.code-workspace'
alias c_nmr='c $HOME/Netatmo/nmr.code-workspace'
@ -154,6 +260,10 @@ function ssh_keygen {
cd -
}
# ╔╗╔┌─┐┌┬┐┌─┐┌┬┐┌┬┐┌─┐
# ║║║├┤ │ ├─┤ │ ││││ │
# ╝╚╝└─┘ ┴ ┴ ┴ ┴ ┴ ┴└─┘
# Flash sniffer nRF52
function nrf52 {
arm-none-eabi-objcopy -O ihex output/nrf52840/bin/$1 $1.hex
@ -167,11 +277,6 @@ function nrf52 {
fi
}
# Make
alias mk='make -j5'
alias mec='make'
alias mecque='make'
# app.S
function generate_objdump {
arm-none-eabi-objdump -S $1.elf > app.S
@ -188,6 +293,10 @@ alias py_wireshark='$HOME/Netatmo/core/python-emb-tools/python/bin/zigbee/python
alias stflash='sudo stm32_sbm -f app.bin -s 0x1000 -d'
alias stflash_dfu='stm32_dfu -f app-jtag.bin -b'
# ╔═╗┬┌┬┐ ╔═╗┬─┐┌─┐┌┬┐┌─┐┌┬┐
# ║ ╦│ │ ╠═╝├┬┘│ ││││├─┘ │
# ╚═╝┴ ┴ ╩ ┴└─└─┘┴ ┴┴ ┴
# Git prompt
if [ -z "${ZSH}" ]; then
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
@ -200,6 +309,16 @@ else
fi
fi
# ╔═╗─┐ ┬┌─┐┌─┐┬─┐┌┬┐
# ║╣ ┌┴┬┘├─┘│ │├┬┘ │
# ╚═╝┴ └─┴ └─┘┴└─ ┴
export PATH=$PATH:~/Netatmo/core/embedded-tools/Linux/flasher
export PATH=$PATH:~/Netatmo/core/generic-embedded/stm32_sbm
export PATH=$PATH:~/Netatmo/core/generic-embedded/stm32_dfu
export PATH=$PATH:~/Netatmo/embedded/firmware-bitcloud/toolchain/arm-none-eabi/bin
export PATH=$PATH:~/Netatmo/embedded/nmr/scripts/flash
# Autofixup
export PATH=$PATH:$HOME/.git-autofixup

3
.zshrc
View File

@ -75,6 +75,9 @@ plugins=(
# zsh-history-substring-search
)
zstyle ':completion:*:make:*:targets' call-command true
zstyle ':completion:*:make:*' tag-order 'targets'
source $HOME/.bash_aliases
source $ZSH/oh-my-zsh.sh

View File

@ -73,3 +73,10 @@ sudo npm install -g npm
# Install rebase-editor
sudo npm install -g rebase-editor
git config --global sequence.editor rebase-editor
# Install micro
curl https://getmic.ro | bash
mkdir -p $HOME/.config/micro
ln -sfn $HOME/.dotfiles/micro/bindings.json $HOME/.config/micro/bindings.json
ln -sfn $HOME/.dotfiles/micro/settings.json $HOME/.config/micro/settings.json
sudo mv micro /usr/bin

View File

@ -14,8 +14,11 @@ then
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/vscodium-archive-keyring.gpg] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/ vscodium main' | sudo tee /etc/apt/sources.list.d/vscodium.list
fi
sudo apt install codium
sudo apt install terminator codium
mkdir -p $HOME/.config/VSCodium/User/
ln -sf $HOME/.dotfiles/codium/keybindings.json $HOME/.config/VSCodium/User/keybindings.json
ln -sf $HOME/.dotfiles/codium/settings.json $HOME/.config/VSCodium/User/settings.json
mkdir -p $HOME/.config/terminator/
ln -sf $HOME/.dotfiles/terminator/config $HOME/.config/terminator/config

31
codium/keybindings.json Normal file
View File

@ -0,0 +1,31 @@
// Placer vos combinaisons de touches dans ce fichier pour remplacer les valeurs par défaut
[
{
"key": "ctrl+[Backslash]",
"command": "workbench.action.navigateBack"
},
{
"key": "ctrl+alt+u",
"command": "editor.action.transformToUppercase"
},
{
"key": "ctrl+[BracketRight]",
"command": "workbench.action.navigateForward"
},
{
"key": "ctrl+8",
"command": "-workbench.action.navigateForward"
},
{
"key": "ctrl+alt+l",
"command": "-workbench.view.explorer"
},
{
"key": "ctrl+[Quote]",
"command": "workbench.action.openWorkspace"
},
{
"key": "ctrl+w",
"command": "-editor.action.addSelectionToNextFindMatch"
}
]

55
codium/settings.json Normal file
View File

@ -0,0 +1,55 @@
{
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.detectIndentation": true,
"editor.mouseWheelScrollSensitivity": 2,
"editor.formatOnPaste": false,
"editor.formatOnSave": false,
"editor.formatOnType": true,
"editor.renderWhitespace": "all",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"C_Cpp.formatting": "Disabled",
"C_Cpp.updateChannel": "Default",
"powermode.enabled": true,
"powermode.enableShake": false,
"powermode.enableExplosions": true,
"powermode.maxExplosions": 1,
"powermode.explosionSize": 10,
"powermode.explosionOffset": 0.5,
"powermode.explosionFrequency": 1,
"powermode.explosionOrder": "random",
"powermode.gifMode": "continue",
"powermode.explosionDuration": 415,
"powermode.backgroundMode": "image",
"powermode.customExplosions": ["data:image/gif;base64,R0lGODlhWgBaAPIHAP///wAAAOvg4P7e3v/ExFpZWfW4uAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/gNHNDQAIfkECQoABwAsAAAAAFoAWgAAA/94utz+MMpJq7046827/2AojmRpnmiqrmzrvnAsz/RL3MSB57W6/7deCvgToog74xGpHAKbviR0xZtar9hUIFDaZgMAgBe0DXOv4LD4vCmrxdb0G66Rv9lN+WCgxh+2gIELdnt9U2l7iWZ/bnNmjYmFdHlhkXuAjpmPlnyTSoiRdpqaAZaLUKCdo6tzip5GoKyyrZ1+sLO4mba3ormyu7C9vqNjccO+wELCx8RozLnJNMvPpIfU0NbXs9Ey09p3qHOB3sfcL3YBBerq5HeBupSVpo4G9Y7p6wW95i5683P1DGjiJO7Tm3++CIK7pQZhLoWGGH6T52qhsonb4uEqkKjUwDB+LdrNWVcuHMZH6LJhlMPSmDuR4gAoAgMyBss+H2UWSlMTBk2dfGCauUcHECowM5ERXRPRYExc+4ZavPh0my4xBTX2EcC1K1eoUl9RneO1a7lTJjOZZUYTi1ClPc+dzOp2blNndsWmnRvXZ169e1dmUfAWal+5dovh5Xs45F/FKhl/ydu2buLGji8PDiBgrgDMIb9O/Dx4kFdmZUGfK8u6tWvV57a4nv05dWkGnD+P2827cxjStwmrAW4hDfHgubn2TA7bp9EMz4NLn069unUMCQAAIfkECQoABwAsFAAKAC4ATAAAA/94utxN8EDiqr126oi7X5v2jVg4kahjcmkrma4Lx7JIx+dNU3rv/8CgsBcoBoadAGAJKP6MR4uSuXTGjNSoQznoZhvQMKNIZWrBy663esCWzW71+oyWd93vPNnOlgLsU3mCZnxNF1xrg4pUcoYYXIuRjF50W5KXTJQegZiXlZadnp8MTaGYowucppGobaunj6+esbKsh7WzFaq4gqO7vG++WVDAZqBVBcnJv73Ewcd2A3kG1M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rlcdGtar7y4ulnAvlK3isRTxniGx8WimK/QXXyFBWkFp6p/rYak07CdW+CVX6HSk5luAXDon+Pqbu2Kr1QNX37usIGM96Xeb3rF29YEIK0fnqQN1MdEgMOHEAVQo8CwYcSH4RxUjBLxYhNFcA0XglwiQOTIfp1Amhy5UuXHky3JvWQ506XGkygJTou5s2ZPn9AG6kx4BGTJIxKhORRaBaKjiEybXpxKFWJUqQ8DVN1qD2nIImCLWA2htcmJsmY7aF16dizZriKIUEgAADs="],
"editor.rulers": [
100
],
"telemetry.enableTelemetry": false,
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"window.titleBarStyle": "custom",
"window.zoomLevel": 0,
"gitlens.keymap": "alternate",
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": false,
"suppressNoRepositoryWarning": false,
"suppressResultsExplorerNotice": false,
"suppressShowKeyBindingsNotice": true
},
"gitlens.views.fileHistory.enabled": true,
"gitlens.views.lineHistory.enabled": true,
"terminal.integrated.rendererType": "dom",
"workbench.colorTheme": "Monokai",
"editor.largeFileOptimizations": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"C_Cpp.intelliSenseEngine": "Tag Parser",
"diffEditor.ignoreTrimWhitespace": false,
"python.languageServer": "Microsoft"
}

4
micro/bindings.json Normal file
View File

@ -0,0 +1,4 @@
{
"Alt-/": "lua:comment.comment",
"CtrlUnderscore": "lua:comment.comment"
}

1
micro/settings.json Normal file
View File

@ -0,0 +1 @@
{}

20
navi/compression.cheat Normal file
View File

@ -0,0 +1,20 @@
% compression
# Create a tar containing files
tar cf <name>.tar <files>
# Extract the files from a tar
tar xf <tar_file>
# Create a tar with Gzip compression
tar czf <name>.tar.gz <files>
# Compress file and appends .gz to its name
gzip <path>
# Decompress compressed file
gzip -d <gz_file>
$ path: ls
$ tar_file: ls *.{tar,tar.*} 2>/dev/null
$ gz_file: ls *.gz

10
navi/docker-compose.cheat Normal file
View File

@ -0,0 +1,10 @@
% docker-compose
# Builds, (re)creates, starts, and attaches to containers for all services
sudo docker-compose up
# Builds, (re)creates, starts, and dettaches to containers for all services
sudo docker-compose up -d
# Stops containers and removes containers, networks created by up
sudo docker-compose down

60
navi/docker.cheat Normal file
View File

@ -0,0 +1,60 @@
% docker
# Remove an image
docker image rm <image_id>
# Remove an image from the local image store
docker rmi <image_id>
# Remove all images from the local image store
docker rmi $(docker images -q) --force
# Remove all containers
docker rm $(docker ps -aq)
# Stop all containers
docker stop $(docker ps -aq)
# List all images that are locally stored with the Docker engine
docker images
# Build an image from the Dockerfile in the current directory and tag the image
docker build -t <image>:<version> .
# Pull an image from a registry
docker pull <image>:<version>
# Stop a running container through SIGTERM
docker stop <container_id>
# Stop a running container through SIGKILL
docker kill <container_id>
# List the networks
docker network ls
# List the running containers
docker ps
# Delete all running and stopped containers
docker rm -f "$(docker ps -aq)"
# Create a new bash process inside the container and connect it to the terminal
docker exec -it <container_id> bash
# Print the last lines of a container's logs
docker logs --tail 100 <container_id> | less
# Print the last lines of a container's logs and following its logs
docker logs --tail 100 <container_id> -f
# Create new network
docker network create <network_name>
$ image_id: docker images --- --headers 1 --column 3 --delimiter '\s\s+'
$ container_id: docker ps --- --headers 1 --column 1 --delimiter '\s\s+'
% docker, boot
# Prevent all containers from autostarting on boot
docker update --restart=no $(docker ps -a -q)

60
navi/git.cheat Normal file
View File

@ -0,0 +1,60 @@
% git
# Initializes a git repository
git init
# Clone a git repository
git clone <repository> <clone_directory>
# Rebase upstream master into local/origin master
git fetch <remote_name>
git checkout master
git rebase <remote_name>/master
git fetch origin
git push -f origin master
# Merge upstream master into local/origin master
git fetch <remote_name>
git checkout master
git merge <remote_name>/master
git fetch origin
git push -f origin master
# Adds a remote for a git repository
git remote add <remote_name> <remote_url>
# Renames a remote for a git repository
git remote rename <old_remote_name> <new_remote_name>
# Remove a remote for a git repository
git remote remove <remote_name>
# Saves the changes to a file in a commit
git commit -m <message>
# Pushes committed changes to remote repository
git push --set-upstream <remote_name> <branch_name>
# Displays formatted log of commits for a repo
git log --all --decorate --oneline --graph
# Clear everything
git clean -dxf
# Add a new module
git submodule add <repository> <path>
# Update module
git submodule update --init
# Update module without init
git submodule update
# Pull all submodules
git submodule foreach git pull origin master
# Skip git hooks
git commit --no-verify
# Create new branch from current HEAD
git checkout -b <new_branch_name>

40
navi/make.cheat Normal file
View File

@ -0,0 +1,40 @@
% make-stm
# Log
make <product><job> FIRMWARE_VERSION=<version> FORCE_TRACE=y MULTI_JOBS=y SECRET=<secret>
# No log
make <product><job> FIRMWARE_VERSION=<version> MULTI_JOBS=y SECRET=<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 <product><job> APP_VERSION=<version> APP_USE_CHANNEL=11 FACTORY_TEST=y ENABLE_TRACE_SUPPORT=y RTT=y MULTI_JOBS=y
# No log
make <product><job> APP_VERSION=<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/<product>/*.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 <nlg_dumped_bin> 0x460000 0x40000 && <nlg_parser> <nlg_dumped_bin>
# Variables
$ nlg_parser: echo "$HOME/Netatmo/embedded/magellan/apps/user/nlg-stm32/model_parser/nlg_model_parser"

18
navi/misc.cheat Normal file
View File

@ -0,0 +1,18 @@
% misc
# List users
cat /etc/passwd | awk -F: '{ print $1}'
# Change user password
sudo passwd <user>
# Create user with home
sudo useradd -m <username>
# Create user without home
sudo useradd <username>
# Delete an user
sudo deluser <user>
$ user: cat /etc/passwd | awk -F: '{ print $1}'

10
navi/mysql.cheat Normal file
View File

@ -0,0 +1,10 @@
% mysql
# Create database
mysql -u <user> -p -e "create database <database> character set UTF8mb4 collate utf8mb4_bin"
# Export databse
mysqldump -u <user> -p <database> > <path>
# Import database
mysql -u <user> -p <database> <path>

18
navi/netatmo.cheat Normal file
View File

@ -0,0 +1,18 @@
% flasher
# Set server
flasher -setserver nv2 <server>
$ 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 <target>
# JLinkGDBServer
JLinkGDBServer -if SWD -device <target>
# Variables
$ target: echo "ATSAMR21E19A nRF52" | tr " " "\n"
# Sniffer Zigbee
<pyet>/zigbee/python_zigbee_interface.py -c <channel>
$ pyet: echo "$HOME/Netatmo/core/python-emb-tools/python/bin"

10
navi/nginx.cheat Normal file
View File

@ -0,0 +1,10 @@
% nginx
# Enable site
ln -s /etc/nginx/sites-available/<ls_site> /etc/nginx/sites-enabled/<ls_site>
# Disable site
rm /etc/nginx/sites-enabled/<rm_site>
$ ls_site: ls /etc/nginx/sites-available/ | awk '{print $1}'
$ rm_site: ls /etc/nginx/sites-enabled/ | awk '{print $1}'

28
navi/syncapi.cheat Normal file
View File

@ -0,0 +1,28 @@
% syncapi
# SyncAPI Muller
<syncapi_path>/syncapiadmin.py --project muller -s <server> --endpoint <endpoint> -c <syncapi_path>/muller_<server>.swp --mac <gateway_mac>
# SyncAPI Legrand
<syncapi_path>/syncapiadmin.py --project legrand -s <server> --endpoint <endpoint> -c <syncapi_path>/legrand_<server>.swp --mac <gateway_mac>
# Debug parser Legrand
<debug_path>/debug_parser.py --project legrand -s <server> -c <syncapi_path>/legrand_<server>.swp -r -pp -g <gateway_mac>
# Enable debug mode Legrand
<debug_path>/debug_config_setter.py --project legrand -s <server> -c <syncapi_path>/legrand_<server>.swp -g <gateway_mac> -t NLG -ke debug_enabled
# Disable debug mode Legrand
<debug_path>/debug_config_setter.py --project legrand -s <server> -c <syncapi_path>/legrand_<server>.swp -g <gateway_mac> -t NLG -kd debug_enabled
# Analyse diagnosis
<syncapi_path>/syncapiadmin.py --project legrand -s <server> --endpoint getdebuginfo -c <syncapi_path>/legrand_<server>.swp --mac <gateway_mac> | jq -r .body.diagnosis_content | <release_path>/decode_diagnosis.py
# 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"
$ release_path: echo "$HOME/Netatmo/core/python-emb-tools/python/bin/release"
# Variables
$ server: echo "prod inte" | tr " " "\n"
$ endpoint: echo "getstatus getconfigs setstate setconfigs getdebuginfo getoeminfo" | tr " " "\n"

37
navi/systemctl.cheat Normal file
View File

@ -0,0 +1,37 @@
% systemctl
# Start service
sudo systemctl start <service_inactive>
# Stop service
sudo systemctl stop <service_active>
# Enable service
sudo systemctl enable <service_disabled>
# Disable service
sudo systemctl disable <service_enabled>
# Restart service
sudo systemctl restart <service>
# Reload service
sudo systemctl reload <service_active>
# Service status
sudo systemctl status <service>
# List running services
sudo systemctl list-units --type=service --state=running
# List enabled services
sudo systemctl list-unit-files --type=service --state=enabled
# List disabled services
sudo 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$//'

30
terminator/config Normal file
View File

@ -0,0 +1,30 @@
[global_config]
window_state = maximise
scroll_tabbar = True
title_inactive_bg_color = "#000000"
inactive_color_offset = 1.0
enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
suppress_multiple_term_dialog = True
title_use_system_font = False
title_font = Sans 11
[keybindings]
[profiles]
[[default]]
background_darkness = 0.6
background_type = transparent
cursor_color = "#908c8c"
font = Monospace 11
foreground_color = "#ffffff"
scrollback_infinite = True
palette = "#000000:#aa0000:#00aa00:#f57900:#55ffff:#ff006e:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#55ffff:#ff006e:#00aaaa:#ffffff"
use_system_font = False
split_to_group = True
[layouts]
[[default]]
[[[window0]]]
type = Window
parent = ""
[[[child1]]]
type = Terminal
parent = window0
[plugins]

View File

@ -43,3 +43,13 @@ else
ZSH_THEME_GIT_PROMPT_REBASE="%{$fg_bold[magenta]%}|REBASE%{${reset_color}%} "
ZSH_THEME_GIT_PROMPT_BISECT="%{$fg_bold[magenta]%}|BISECT%{${reset_color}%} "
fi
function theme_preexec {
print -nr $'\e]2;'"$USER@$(hostname) » $PWD » $1 $2"$'\a'
}
add-zsh-hook preexec theme_preexec
function theme_precmd {
print -nr $'\e]2;'"$USER@$(hostname) » $PWD"$'\a'
}
add-zsh-hook precmd theme_precmd