From ab17ba8644218335f9eddb75f48b619923844dd4 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Sat, 5 Feb 2022 18:47:46 +0100 Subject: [PATCH] clarify ssh tricks --- data/sql/tricks.md | 10 ---------- networking/ssh/tricks.md | 8 ++++---- 2 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 data/sql/tricks.md diff --git a/data/sql/tricks.md b/data/sql/tricks.md deleted file mode 100644 index 5f51639..0000000 --- a/data/sql/tricks.md +++ /dev/null @@ -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 diff --git a/networking/ssh/tricks.md b/networking/ssh/tricks.md index 4d00f86..0171423 100644 --- a/networking/ssh/tricks.md +++ b/networking/ssh/tricks.md @@ -1,11 +1,11 @@ --- -title: "tricks" -tags: [ "Documentation", "Networking" ] +title: "ssh tricks" +tags: [ "Documentation", "Networking", "ssh", "tricks" ] --- 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: @@ -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. -> 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