Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66015c7762 | |||
| 1d947a4c9a | |||
| 1beccf1252 | |||
| 1333250def | |||
| fff6f346cb | |||
| 553b019911 | |||
| 89d164c957 | |||
| 521541490d | |||
| bfcf494bba | |||
| c22dcc6274 | |||
| ffc9f09c0f | |||
| 4f19441ab1 | |||
| 41e91b72af | |||
| 3c3a3b18ea | |||
| 966b49204d | |||
| bab8f8b6dd | |||
| 120e4bbc37 | |||
| b23c47cb39 | |||
| 7ebd50b761 | |||
| 2538ab1863 | |||
| d6588e34f6 | |||
| 57c74103dd | |||
| 6e61e5d96d | |||
| 0bc5d22ca6 | |||
| 814167d6b3 | |||
| 6bdccc0643 | |||
| 3e9866f5fc | |||
| 5163ff5981 | |||
| c15177dbdf | |||
| aafa944d07 | |||
| 5707ee1f96 | |||
| 50dacfbb4b | |||
| b6b4f4f753 | |||
| 30f5179e07 | |||
| ec2a91a017 | |||
| ede0942720 | |||
| 0feb7050f5 | |||
| e6e3110a58 | |||
| a41f7b0c93 | |||
| 3efecc8630 | |||
| fc8f92112a | |||
| 4dc74f40aa | |||
| 3ed757de4c | |||
| 2655c4559b | |||
| 65e03c4990 | |||
| 118acfc43a | |||
| fea88e35cc | |||
| 13a2051c96 | |||
| 9ffd302013 | |||
| e5823ca52e | |||
| 204c530bd2 | |||
| f0dff865a4 | |||
| c83c6650d8 | |||
| 4229d767c4 | |||
| 57aecb00ae | |||
| ad4f0fb2b9 | |||
| 82b66bbb1e | |||
| 14cbaa5168 | |||
| 0b79526407 | |||
| 57b4477fdd | |||
| 8e269de6e2 |
+34
-37
@@ -77,18 +77,22 @@ alias vpn="sudo openvpn --config $HOME/Nextcloud/#\ -\ Configs/rguiheneuf.ovpn"
|
|||||||
|
|
||||||
alias gs='git status'
|
alias gs='git status'
|
||||||
alias gc='git checkout'
|
alias gc='git checkout'
|
||||||
alias gcm='git checkout master'
|
|
||||||
alias gpl='git pull'
|
alias gpl='git pull'
|
||||||
alias gph='git push'
|
alias gph='git push'
|
||||||
alias gsu='git submodule update --init'
|
alias gsu='git submodule update --init'
|
||||||
alias gcp='git cherry-pick'
|
alias gcp='git cherry-pick'
|
||||||
|
|
||||||
|
function gcm {
|
||||||
|
( git rev-parse --verify origin/master > /dev/null 2>&1 ) && git checkout master
|
||||||
|
( git rev-parse --verify origin/main > /dev/null 2>&1 ) && git checkout main
|
||||||
|
}
|
||||||
|
|
||||||
alias add='git add'
|
alias add='git add'
|
||||||
alias commit='git commit -m "To fixup"'
|
alias commit='git commit -m "To fixup"'
|
||||||
alias cont='git rebase --continue'
|
alias cont='git rebase --continue'
|
||||||
|
|
||||||
# Git cleaners
|
# Git cleaners
|
||||||
alias branch_clean='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
|
alias branch_clean='git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d'
|
||||||
alias tag_clean='git tag -l | xargs git tag -d && git fetch -t'
|
alias tag_clean='git tag -l | xargs git tag -d && git fetch -t'
|
||||||
|
|
||||||
function git_parent {
|
function git_parent {
|
||||||
@@ -152,13 +156,16 @@ function grbm {
|
|||||||
# Save current branch
|
# Save current branch
|
||||||
BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
|
BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
|
||||||
|
|
||||||
# Checkout master & pull
|
# Checkout master/main & pull
|
||||||
git checkout master
|
gcm
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
|
# Save parent branch
|
||||||
|
PARENT=$(git branch | grep \* | cut -d ' ' -f2)
|
||||||
|
|
||||||
# Back to previous branch
|
# Back to previous branch
|
||||||
git checkout ${BRANCH}
|
git checkout ${BRANCH}
|
||||||
git rebase --interactive master
|
git rebase --interactive ${PARENT}
|
||||||
}
|
}
|
||||||
|
|
||||||
function grbi {
|
function grbi {
|
||||||
@@ -189,8 +196,16 @@ function ga {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gam {
|
function gam {
|
||||||
git autofixup master
|
# Checkout master/main & pull
|
||||||
git rebase --interactive --autosquash master
|
gcm
|
||||||
|
|
||||||
|
# Save parent branch
|
||||||
|
PARENT=$(git branch | grep \* | cut -d ' ' -f2)
|
||||||
|
|
||||||
|
git checkout -
|
||||||
|
|
||||||
|
git autofixup ${PARENT}
|
||||||
|
git rebase --interactive --autosquash ${PARENT}
|
||||||
}
|
}
|
||||||
|
|
||||||
function gai {
|
function gai {
|
||||||
@@ -228,33 +243,18 @@ function git_perso {
|
|||||||
# ║ ╦│ │ ╠═╣│││├┤ │││ ││
|
# ║ ╦│ │ ╠═╣│││├┤ │││ ││
|
||||||
# ╚═╝┴ ┴ ╩ ╩┴ ┴└─┘┘└┘─┴┘
|
# ╚═╝┴ ┴ ╩ ╩┴ ┴└─┘┘└┘─┴┘
|
||||||
|
|
||||||
alias amend_pro="GIT_EDITOR=true git rebase --preserve-merges --exec 'git commit --amend --author=\"Robin-Charles GUIHENEUF <rguiheneuf@netatmo.com>\"' $1"
|
alias amend_pro="GIT_EDITOR=true git rebase --rebase-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 amend_perso="GIT_EDITOR=true git rebase --rebase-merges --exec 'git commit --amend --author=\"Robin-Charles Guihéneuf <robin-charles@hotmail.fr>\"' $1"
|
||||||
|
|
||||||
# ╦═╗┌─┐┌─┐┌─┐┌─┐┬┌┬┐┌─┐┬─┐┬┌─┐┌─┐
|
# ╦═╗┌─┐┌─┐┌─┐┌─┐┬┌┬┐┌─┐┬─┐┬┌─┐┌─┐
|
||||||
# ╠╦╝├┤ ├─┘│ │└─┐│ │ │ │├┬┘│├┤ └─┐
|
# ╠╦╝├┤ ├─┘│ │└─┐│ │ │ │├┬┘│├┤ └─┐
|
||||||
# ╩╚═└─┘┴ └─┘└─┘┴ ┴ └─┘┴└─┴└─┘└─┘
|
# ╩╚═└─┘┴ └─┘└─┘┴ ┴ └─┘┴└─┴└─┘└─┘
|
||||||
|
|
||||||
alias bc='cd $HOME/Netatmo/embedded/firmware-bitcloud'
|
alias mulot='cd $HOME/mulot'
|
||||||
alias fw='cd $HOME/Netatmo/embedded/firmware'
|
alias moki='cd $HOME/mulot/moki'
|
||||||
alias nmr='cd $HOME/Netatmo/embedded/nmr'
|
|
||||||
alias py='cd $HOME/Netatmo/core/python-emb-tools'
|
|
||||||
alias mag='cd $HOME/Netatmo/embedded/magellan'
|
|
||||||
alias nsp='cd $HOME/Netatmo/embedded/nsp'
|
|
||||||
alias nas='cd $HOME/Netatmo/embedded/nas'
|
|
||||||
alias npc='cd $HOME/Netatmo/embedded/npc'
|
|
||||||
alias mulot='cd $HOME/mulot/firmware'
|
|
||||||
|
|
||||||
# In editor
|
# In editor
|
||||||
alias c_bc='c $HOME/Netatmo/firmware-bitcloud.code-workspace'
|
alias c_moki='c $HOME/mulot/moki.code-workspace'
|
||||||
alias c_fw='c $HOME/Netatmo/firmware.code-workspace'
|
|
||||||
alias c_nmr='c $HOME/Netatmo/nmr.code-workspace'
|
|
||||||
alias c_py='c $HOME/Netatmo/python-emb-tools.code-workspace'
|
|
||||||
alias c_mag='c $HOME/Netatmo/magellan.code-workspace'
|
|
||||||
alias c_nsp='c $HOME/Netatmo/nsp.code-workspace'
|
|
||||||
alias c_nas='c $HOME/Netatmo/nas.code-workspace'
|
|
||||||
alias c_npc='c $HOME/Netatmo/npc.code-workspace'
|
|
||||||
alias c_mulot='c $HOME/mulot/mulot.code-workspace'
|
|
||||||
|
|
||||||
# SSH keygen
|
# SSH keygen
|
||||||
function ssh_keygen {
|
function ssh_keygen {
|
||||||
@@ -270,7 +270,7 @@ function ssh_keygen {
|
|||||||
|
|
||||||
# Flash sniffer nRF52
|
# Flash sniffer nRF52
|
||||||
function nrf52 {
|
function nrf52 {
|
||||||
arm-none-eabi-objcopy -O ihex output/nrf52840/bin/$1 $1.hex
|
arm-none-eabi-objcopy -O ihex build/bin/$1 $1.hex
|
||||||
nrfutil pkg generate --hw-version 52 --sd-req=0x00 --application $1.hex --application-version 1 $1.zip
|
nrfutil pkg generate --hw-version 52 --sd-req=0x00 --application $1.hex --application-version 1 $1.zip
|
||||||
|
|
||||||
if [ -z "$2" ]
|
if [ -z "$2" ]
|
||||||
@@ -317,21 +317,18 @@ 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
|
# Autofixup
|
||||||
export PATH=$PATH:$HOME/.git-autofixup
|
export PATH=$PATH:$HOME/.git-autofixup
|
||||||
|
|
||||||
# Netatmo
|
|
||||||
export NETATMO_WORK_DIR=$HOME/Netatmo
|
|
||||||
|
|
||||||
# Cargo binaries (navi)
|
# Cargo binaries (navi)
|
||||||
export PATH=$PATH:$HOME/.cargo/bin
|
export PATH=$PATH:$HOME/.cargo/bin
|
||||||
|
|
||||||
|
# Python
|
||||||
|
export PATH=$PATH:$HOME/.local/bin
|
||||||
|
|
||||||
|
# User bin
|
||||||
|
export PATH=$HOME/bin:$PATH
|
||||||
|
|
||||||
# Navi
|
# Navi
|
||||||
if [ -z "${ZSH}" ]; then
|
if [ -z "${ZSH}" ]; then
|
||||||
source <(navi widget bash)
|
source <(navi widget bash)
|
||||||
|
|||||||
+2
-7
@@ -19,7 +19,7 @@ install_git_repo () {
|
|||||||
# Install packages
|
# Install packages
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt upgrade
|
sudo apt upgrade
|
||||||
sudo apt install minicom ssh git tig ack tree npm cargo python3-pip curl zsh
|
sudo apt install minicom ssh git tig ripgrep tree npm python3-pip curl zsh
|
||||||
|
|
||||||
# Install Oh my ZSH
|
# Install Oh my ZSH
|
||||||
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||||
@@ -57,16 +57,11 @@ install_git_repo https://github.com/junegunn/fzf.git $HOME/.fzf
|
|||||||
$HOME/.fzf/install
|
$HOME/.fzf/install
|
||||||
|
|
||||||
# Install navi
|
# Install navi
|
||||||
|
curl https://sh.rustup.rs -sSf | sh
|
||||||
cargo install navi
|
cargo install navi
|
||||||
mkdir -p $HOME/.local/share/navi/cheats
|
mkdir -p $HOME/.local/share/navi/cheats
|
||||||
ln -sfn $HOME/.dotfiles/navi/ $HOME/.local/share/navi/cheats/vulporuza
|
ln -sfn $HOME/.dotfiles/navi/ $HOME/.local/share/navi/cheats/vulporuza
|
||||||
|
|
||||||
# Update pip
|
|
||||||
pip3 install --upgrade pip
|
|
||||||
|
|
||||||
# Install undervolt
|
|
||||||
sudo pip3 install undervolt
|
|
||||||
|
|
||||||
# Update npm
|
# Update npm
|
||||||
sudo npm install -g npm
|
sudo npm install -g npm
|
||||||
|
|
||||||
|
|||||||
+4
-11
@@ -7,18 +7,11 @@ fi
|
|||||||
# CLI Tools
|
# CLI Tools
|
||||||
$HOME/.dotfiles/auto-config-cli.sh
|
$HOME/.dotfiles/auto-config-cli.sh
|
||||||
|
|
||||||
# Codium
|
sudo apt install terminator fonts-firacode
|
||||||
if [ ! -f "/etc/apt/sources.list.d/vscodium.list" ]
|
|
||||||
then
|
|
||||||
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/vscodium-archive-keyring.gpg
|
|
||||||
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 terminator codium fonts-firacode
|
mkdir -p $HOME/.config/Code/User/
|
||||||
|
ln -sf $HOME/.dotfiles/codium/keybindings.json $HOME/.config/Code/User/keybindings.json
|
||||||
mkdir -p $HOME/.config/VSCodium/User/
|
ln -sf $HOME/.dotfiles/codium/settings.json $HOME/.config/Code/User/settings.json
|
||||||
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/
|
mkdir -p $HOME/.config/terminator/
|
||||||
ln -sf $HOME/.dotfiles/terminator/config $HOME/.config/terminator/config
|
ln -sf $HOME/.dotfiles/terminator/config $HOME/.config/terminator/config
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
},
|
},
|
||||||
"C_Cpp.formatting": "Disabled",
|
"C_Cpp.formatting": "Disabled",
|
||||||
"C_Cpp.updateChannel": "Default",
|
"C_Cpp.updateChannel": "Default",
|
||||||
"powermode.enabled": true,
|
"powermode.enabled": false,
|
||||||
"powermode.enableExplosions": true,
|
"powermode.enableExplosions": true,
|
||||||
"powermode.maxExplosions": 1,
|
"powermode.maxExplosions": 1,
|
||||||
"editor.rulers": [
|
"editor.rulers": [
|
||||||
|
|||||||
+30
-7
@@ -1,20 +1,43 @@
|
|||||||
% compression
|
% compression
|
||||||
|
|
||||||
# Create a tar archive containing files
|
# Create a tar archive
|
||||||
tar cf <name>.tar <files>
|
tar -cvf <name>.tar <files>
|
||||||
|
|
||||||
# Create a tar archive with gz compression
|
# Create a tar archive (gz compression)
|
||||||
tar czf <name>.tar.gz <files>
|
tar -cvzf <name>.tar.gz <files>
|
||||||
|
|
||||||
|
# Create a tar archive (pigz compression)
|
||||||
|
tar -I pigz -cvf <name>.tar.gz <files>
|
||||||
|
|
||||||
|
# Create a tar archive (bzip2 compression)
|
||||||
|
tar -cvjf <name>.tar.bz2 <files>
|
||||||
|
|
||||||
|
# Create a tar archive (pbzip2 compression)
|
||||||
|
tar -I pbzip2 -cvf <name>.tar.bz2 <files>
|
||||||
|
|
||||||
# Extract a tar archive
|
# Extract a tar archive
|
||||||
tar xf <tar_file>
|
tar -xf <tar_file>
|
||||||
|
|
||||||
# Create a gz archive containing files
|
# Extract a tar (gz compression)
|
||||||
|
tar -xzf <targz_file>
|
||||||
|
|
||||||
|
# Extract a tar (pigz compression)
|
||||||
|
tar -I pigz -xf <targz_file>
|
||||||
|
|
||||||
|
# Extract a tar (bzip2 compression)
|
||||||
|
tar -xjf <tarbz2_file>
|
||||||
|
|
||||||
|
# Extract a tar (pbzip2 compression)
|
||||||
|
tar -I pbzip2 -xf <tarbz2_file>
|
||||||
|
|
||||||
|
# Create a gz archive
|
||||||
gzip -9 -c <files> > <name>.gz
|
gzip -9 -c <files> > <name>.gz
|
||||||
|
|
||||||
# Extract a gz archive
|
# Extract a gz archive
|
||||||
gzip -d <gz_file>
|
gzip -d <gz_file>
|
||||||
|
|
||||||
$ files: ls | awk -F: '{ print $1}'
|
$ files: ls | awk -F: '{ print $1}'
|
||||||
$ tar_file: ls *.{tar,tar.*} | awk -F: '{ print $1}'
|
$ tar_file: ls *.tar | awk -F: '{ print $1}'
|
||||||
|
$ targz_file: ls *.tar.gz | awk -F: '{ print $1}'
|
||||||
|
$ tarbz2_file: ls *.tar.bz2 | awk -F: '{ print $1}'
|
||||||
$ gz_file: ls *.gz | awk -F: '{ print $1}'
|
$ gz_file: ls *.gz | awk -F: '{ print $1}'
|
||||||
|
|||||||
@@ -1,15 +1,39 @@
|
|||||||
% docker-compose
|
% docker-compose
|
||||||
|
|
||||||
|
# Build a compose YAML
|
||||||
|
sudo docker compose -f <file> build
|
||||||
|
|
||||||
# Up a compose YAML
|
# Up a compose YAML
|
||||||
sudo docker-compose -f <file> up
|
sudo docker compose -f <file> up
|
||||||
|
|
||||||
# Up and daemonze a compose YAML
|
# Up and daemonze a compose YAML
|
||||||
sudo docker-compose -f <file> up -d
|
sudo docker compose -f <file> up -d
|
||||||
|
|
||||||
# Up and daemonze a compose YAML (force)
|
# Up and daemonze a compose YAML (force)
|
||||||
sudo docker-compose -f <file> up -d --force-recreate
|
sudo docker compose -f <file> up -d --force-recreate
|
||||||
|
|
||||||
# Up and daemonze a compose YAML
|
# Down a compose YAML
|
||||||
sudo docker-compose -f <file> down
|
sudo docker compose -f <file> down
|
||||||
|
|
||||||
|
# Execute command in a compose YAML
|
||||||
|
sudo docker compose -f <file> exec <service> <command>
|
||||||
|
|
||||||
|
# Print logs of a compose YAML
|
||||||
|
sudo docker compose -f <file> logs --tail 100
|
||||||
|
|
||||||
|
# Print service logs of a compose YAML
|
||||||
|
sudo docker compose -f <file> logs --tail 100 <service>
|
||||||
|
|
||||||
|
# Print and follow logs of a compose YAML
|
||||||
|
sudo docker compose -f <file> logs --tail 100 -f
|
||||||
|
|
||||||
|
# Print and follow service logs of a compose YAML
|
||||||
|
sudo docker compose -f <file> logs --tail 100 -f <service>
|
||||||
|
|
||||||
|
# Remove volume of a compose YAML
|
||||||
|
sudo docker volume rm <dir>_<volume>
|
||||||
|
|
||||||
|
$ dir: basename $PWD
|
||||||
$ file: ls *.yaml | awk '{print $1}'
|
$ file: ls *.yaml | awk '{print $1}'
|
||||||
|
$ volume: sudo docker compose -f <file> config --volumes | awk '{print $1}'
|
||||||
|
$ service: sudo docker compose -f <file> config --services | awk '{print $1}'
|
||||||
|
|||||||
+27
-12
@@ -3,24 +3,24 @@
|
|||||||
# Create a volume
|
# Create a volume
|
||||||
sudo docker volume create <name>
|
sudo docker volume create <name>
|
||||||
|
|
||||||
|
# Remove a volume
|
||||||
|
sudo docker volume rm <volume>
|
||||||
|
|
||||||
# List all volumes
|
# List all volumes
|
||||||
sudo docker volume ls
|
sudo docker volume ls
|
||||||
|
|
||||||
# Remove volume
|
$ volume: sudo docker volume ls --format "{{.Name}}" | sort | awk '{print $1}'
|
||||||
sudo docker volume rm <volume>
|
|
||||||
|
|
||||||
$ volume: sudo docker volume ls --format "{{.Name}}" | awk '{print $1}'
|
|
||||||
|
|
||||||
# Create new network
|
# Create new network
|
||||||
docker network create <name>
|
sudo docker network create <name>
|
||||||
|
|
||||||
# List the networks
|
# Remove network
|
||||||
|
sudo docker network rm <network>
|
||||||
|
|
||||||
|
# List all networks
|
||||||
sudo docker network ls
|
sudo docker network ls
|
||||||
|
|
||||||
# Remove volume
|
$ network: sudo docker network ls --format "{{.Name}}" | sort | awk '{print $1}'
|
||||||
sudo docker volume rm <network>
|
|
||||||
|
|
||||||
$ network: sudo docker network ls --format "{{.Name}}" | awk '{print $1}'
|
|
||||||
|
|
||||||
# List the running containers
|
# List the running containers
|
||||||
sudo docker ps
|
sudo docker ps
|
||||||
@@ -38,9 +38,24 @@ sudo docker exec -it <container> bash
|
|||||||
sudo docker exec -it <container> sh -c '<command>'
|
sudo docker exec -it <container> sh -c '<command>'
|
||||||
|
|
||||||
# Print the last lines of a container's logs
|
# Print the last lines of a container's logs
|
||||||
sudo docker logs --tail 100 <container> | less
|
sudo docker logs --tail 100 <container>
|
||||||
|
|
||||||
# Print the last lines of a container's logs and following its logs
|
# Print the last lines of a container's logs and following its logs
|
||||||
sudo docker logs --tail 100 <container> -f
|
sudo docker logs --tail 100 <container> -f
|
||||||
|
|
||||||
$ container: sudo docker container ls --format "{{.Names}}" | awk '{print $1}'
|
$ container: sudo docker container ls --format "{{.Names}}" | sort | awk '{print $1}'
|
||||||
|
|
||||||
|
# List all images
|
||||||
|
sudo docker image ls
|
||||||
|
|
||||||
|
# Remove an image
|
||||||
|
sudo docker image rm <image>
|
||||||
|
|
||||||
|
# Save an image into an archive
|
||||||
|
sudo docker image save <image> -o <name>
|
||||||
|
|
||||||
|
# Load an image from an archive
|
||||||
|
sudo docker image load -i <archive>
|
||||||
|
|
||||||
|
$ image: sudo docker image ls --format "{{.Repository}}:{{.Tag}}" | sort | awk '{print $1}'
|
||||||
|
$ archive: ls | awk '{print $1}'
|
||||||
|
|||||||
+27
-2
@@ -38,8 +38,8 @@ git push --set-upstream <remote_name> <branch_name>
|
|||||||
# Displays formatted log of commits for a repo
|
# Displays formatted log of commits for a repo
|
||||||
git log --all --decorate --oneline --graph
|
git log --all --decorate --oneline --graph
|
||||||
|
|
||||||
# Clear everything
|
# Clean everything
|
||||||
git clean -dxf
|
git clean -fdx
|
||||||
|
|
||||||
# Add a new module
|
# Add a new module
|
||||||
git submodule add <repository> <path>
|
git submodule add <repository> <path>
|
||||||
@@ -67,5 +67,30 @@ git push origin <name>
|
|||||||
git tag -d <tag_name>
|
git tag -d <tag_name>
|
||||||
git push -d origin <tag_name>
|
git push -d origin <tag_name>
|
||||||
|
|
||||||
|
# Create a patch from current full diff
|
||||||
|
git diff > <patch_name>.patch
|
||||||
|
|
||||||
|
# Create a patch from current file diff
|
||||||
|
git diff <diff_file> > <patch_name>.patch
|
||||||
|
|
||||||
|
# Create a patch from commit(s)
|
||||||
|
git format-patch <first_commit>..<last_commit>
|
||||||
|
|
||||||
|
# Show a diff patch
|
||||||
|
git apply --stat <patch_name>
|
||||||
|
|
||||||
|
# Check a diff patch
|
||||||
|
git apply --check <patch_name>
|
||||||
|
|
||||||
|
# Apply a diff patch
|
||||||
|
git apply <patch_name>
|
||||||
|
|
||||||
|
# Apply a commit patch
|
||||||
|
git am <patch_name>
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
$ tag_name: git tag -l | awk '{print $1}'
|
$ tag_name: git tag -l | awk '{print $1}'
|
||||||
|
$ diff_file: git diff --name-only | awk '{print $1}'
|
||||||
|
$ first_commit: git log -n 20 --oneline | fzf --preview 'git show --color=always {1}' | awk '{print $1}'
|
||||||
|
$ last_commit: git log -n 20 --oneline | fzf --preview 'git show --color=always {1}' | awk '{print $1}'
|
||||||
|
$ patch_name: ls *.patch | awk '{print $1}'
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
% gpg
|
||||||
|
|
||||||
|
# GPG version
|
||||||
|
gpg --version
|
||||||
|
|
||||||
|
# GPG generate key
|
||||||
|
gpg --gen-key
|
||||||
|
|
||||||
|
# List keys
|
||||||
|
gpg --list-keys
|
||||||
|
|
||||||
|
# Export public key
|
||||||
|
gpg --output <filename> --export <gpg_public_keys>
|
||||||
|
|
||||||
|
# Export public key as ASCII
|
||||||
|
gpg --output <filename> --export --armor <gpg_public_keys>
|
||||||
|
|
||||||
|
# Import public key
|
||||||
|
gpg --import <gpg_files>
|
||||||
|
|
||||||
|
# Encrypt document
|
||||||
|
gpg --output <filename> --encrypt --recipient <gpg_public_keys> <files>
|
||||||
|
|
||||||
|
# Decrypt document
|
||||||
|
gpg --output <filename> --decrypt <files>
|
||||||
|
|
||||||
|
# Make a signature
|
||||||
|
gpg --output <signature_file> --sign <files>
|
||||||
|
|
||||||
|
# Verify signature
|
||||||
|
gpg --verify <files>
|
||||||
|
|
||||||
|
# Clearsign documents
|
||||||
|
gpg --clearsign <filename>
|
||||||
|
|
||||||
|
# Detach signature
|
||||||
|
gpg --output <filename_sig> --detach-sig <filename>
|
||||||
|
|
||||||
|
$ files: ls * | awk '{print $1}'
|
||||||
|
$ gpg_files: ls *.gpg | awk '{print $1}'
|
||||||
|
$ gpg_public_keys: gpg --list-keys | grep uid | sed 's/.*<\(.*\)>.*/\1/' | awk '{print $1}'
|
||||||
|
|
||||||
+8
-2
@@ -54,12 +54,18 @@ meld <(hexdump -C <file_1>) <(hexdump -C <file_2>)
|
|||||||
# Compare 2 files (bcompare)
|
# Compare 2 files (bcompare)
|
||||||
bcompare <file_1> <file_2>
|
bcompare <file_1> <file_2>
|
||||||
|
|
||||||
# Replace expression in files
|
# Replace expression in files (ack)
|
||||||
ack -rl "<expression>" | xargs sed -i 's#<expression>#<replace_expression>#g'
|
ack -rl '<expression>' | xargs sed -i 's#<expression>#<replace_expression>#g'
|
||||||
|
|
||||||
|
# Replace expression in files (rg)
|
||||||
|
rg -l '<expression>' | xargs sed -i 's#<expression>#<replace_expression>#g'
|
||||||
|
|
||||||
# Disable Bluetooth ERTM
|
# Disable Bluetooth ERTM
|
||||||
sudo bash -c "echo Y > /sys/module/bluetooth/parameters/disable_ertm"
|
sudo bash -c "echo Y > /sys/module/bluetooth/parameters/disable_ertm"
|
||||||
|
|
||||||
|
# Show disk usage
|
||||||
|
df -h
|
||||||
|
|
||||||
$ user: cat /etc/passwd | awk -F: '{ print $1}'
|
$ user: cat /etc/passwd | awk -F: '{ print $1}'
|
||||||
$ group: cat /etc/group | awk -F: '{ print $1}'
|
$ group: cat /etc/group | awk -F: '{ print $1}'
|
||||||
$ interface: ip link | grep "^[0-9]*:" | sed "s/[0-9]*: \(.*\):.*/\1/" | awk -F: '{ print $1}'
|
$ interface: ip link | grep "^[0-9]*:" | sed "s/[0-9]*: \(.*\):.*/\1/" | awk -F: '{ print $1}'
|
||||||
|
|||||||
@@ -24,3 +24,9 @@ $ target: echo "ATSAMR21E19A nRF52" | tr " " "\n"
|
|||||||
<pyet>/zigbee/python_zigbee_interface.py -c <channel>
|
<pyet>/zigbee/python_zigbee_interface.py -c <channel>
|
||||||
|
|
||||||
$ pyet: echo "$HOME/Netatmo/core/python-emb-tools/python/bin"
|
$ pyet: echo "$HOME/Netatmo/core/python-emb-tools/python/bin"
|
||||||
|
|
||||||
|
|
||||||
|
% mac
|
||||||
|
|
||||||
|
# Get MAC infos
|
||||||
|
curl 'https://www.macvendorlookup.com/oui.php?mac=<mac>' | jq
|
||||||
|
|||||||
+6
-6
@@ -1,22 +1,22 @@
|
|||||||
% syncapi
|
% syncapi
|
||||||
|
|
||||||
# SyncAPI Muller
|
# SyncAPI Muller
|
||||||
<syncapi_path>/syncapiadmin.py --project muller -s <server> --endpoint <endpoint> -c <syncapi_path>/muller_<server>.swp --mac <gateway_mac>
|
<syncapi_path>/syncapiadmin.py --project muller -s <server> --endpoint <endpoint> --mac <gateway_mac>
|
||||||
|
|
||||||
# SyncAPI Legrand
|
# SyncAPI Legrand
|
||||||
<syncapi_path>/syncapiadmin.py --project legrand -s <server> --endpoint <endpoint> -c <syncapi_path>/legrand_<server>.swp --mac <gateway_mac>
|
<syncapi_path>/syncapiadmin.py --project legrand -s <server> --endpoint <endpoint> --mac <gateway_mac>
|
||||||
|
|
||||||
# Debug parser Legrand
|
# Debug parser Legrand
|
||||||
<debug_path>/debug_parser.py --project legrand -s <server> -c <syncapi_path>/legrand_<server>.swp -r -pp -g <gateway_mac>
|
<debug_path>/debug_parser.py --project legrand -s <server> -r -pp -g <gateway_mac>
|
||||||
|
|
||||||
# Enable debug mode Legrand
|
# 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
|
<debug_path>/debug_config_setter.py --project legrand -s <server> -g <gateway_mac> -t NLG -ke debug_enabled
|
||||||
|
|
||||||
# Disable debug mode Legrand
|
# 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
|
<debug_path>/debug_config_setter.py --project legrand -s <server> -g <gateway_mac> -t NLG -kd debug_enabled
|
||||||
|
|
||||||
# Analyse diagnosis
|
# 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
|
<syncapi_path>/syncapiadmin.py --project legrand -s <server> --endpoint getdebuginfo --mac <gateway_mac> | jq -r .body.diagnosis_content | <release_path>/decode_diagnosis.py
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
$ syncapi_path: echo "$HOME/Netatmo/core/python-emb-tools/python/bin/syncapiadmin"
|
$ syncapi_path: echo "$HOME/Netatmo/core/python-emb-tools/python/bin/syncapiadmin"
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
[global_config]
|
[global_config]
|
||||||
window_state = maximise
|
window_state = maximise
|
||||||
scroll_tabbar = True
|
scroll_tabbar = True
|
||||||
title_inactive_bg_color = "#000000"
|
|
||||||
inactive_color_offset = 1.0
|
inactive_color_offset = 1.0
|
||||||
enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
|
enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
|
||||||
suppress_multiple_term_dialog = True
|
suppress_multiple_term_dialog = True
|
||||||
title_use_system_font = False
|
|
||||||
title_font = Fira Code weight=453 11
|
|
||||||
[keybindings]
|
[keybindings]
|
||||||
[profiles]
|
[profiles]
|
||||||
[[default]]
|
[[default]]
|
||||||
background_darkness = 0.7
|
background_darkness = 0.7
|
||||||
background_type = transparent
|
background_type = transparent
|
||||||
cursor_color = "#908c8c"
|
|
||||||
font = Fira Code weight=453 11
|
font = Fira Code weight=453 11
|
||||||
foreground_color = "#ffffff"
|
foreground_color = "#ffffff"
|
||||||
scrollback_infinite = True
|
scrollback_infinite = True
|
||||||
|
|||||||
Reference in New Issue
Block a user