Skip to content

Instantly share code, notes, and snippets.

View zaxo7's full-sized avatar

AGHILES GHARBI zaxo7

View GitHub Profile
@zaxo7
zaxo7 / sync.sh
Created April 27, 2023 13:25
a script to continiously sync directories between two hosts
#in this example i am trying to sync my current directory to the /var/www on the remote
#note: to avoid typing password at each time i suggest enabling public key authentification by ssh-copy-id root@host
#i use this setup when working in embedded devices it makes life easier
while true; do
inotifywait -r . -e modify,create,delete
rsync -avzz --exclude 'sync.sh' --delete --update . root@192.168.1.1:/var/www/
done
@zaxo7
zaxo7 / commands.Md
Last active April 11, 2022 18:07
Share docker container over the network

computer A (who has docker container running) : 192.168.1.73

computer B (the one who i want to access docker from) : 192.168.1.53

Docker network : 172.17.0.0/16

Docker container : 172.17.0.2

  • On computer A route traffic going to 172.17.0.0/16 over 192.168.1.73

ip route add 172.17.0.0/16 via 192.168.1.73

  • On computer B
@zaxo7
zaxo7 / cloudSettings
Last active June 22, 2021 12:37
vscode config
{"lastUpload":"2021-06-22T11:36:20.695Z","extensionVersion":"v3.4.3"}