clarify ssh tricks

This commit is contained in:
Malin Freeborn 2022-02-05 18:47:46 +01:00
parent e0aa935d97
commit ab17ba8644
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
2 changed files with 4 additions and 14 deletions

View File

@ -1,10 +0,0 @@
---
title: "tricks"
tags: [ "Documentation", "data" ]
---
# Find data from any table
> pg_dump --data-only --inserts -U postgres your-db-name > a.tmp
> grep 'my string' a.tmp

View File

@ -1,11 +1,11 @@
--- ---
title: "tricks" title: "ssh tricks"
tags: [ "Documentation", "Networking" ] tags: [ "Documentation", "Networking", "ssh", "tricks" ]
--- ---
Mount a remote filesystem locally with fuse-sshfs: Mount a remote filesystem locally with fuse-sshfs:
> sshfs ghost@192.168.0.10:/home/ghost /tmp/mnt > sshfs *user*@192.168.0.10:/home/*user* /tmp/mnt
Unmount with: Unmount with:
@ -17,5 +17,5 @@ Set it up on /etc/fstab with:
Make image backup of sda1 and sda2 from one machine and pass it through ssh to another. Make image backup of sda1 and sda2 from one machine and pass it through ssh to another.
> for i in {1,2};do sudo dd if=/dev/sda$i | ssh -C ghost@192.168.0.10 "dd of=/mnt/Biggie/Backup/winback-oct-\"$i\".img" status=progress; done > for i in {1,2};do sudo dd if=/dev/sda$i | ssh -C *user*@192.168.0.10 "dd of=/mnt/Backup/winback-oct-\"$i\".img" status=progress; done