Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ricjcosme/96691ff6ef822e90f52ace7c85eb5f05 to your computer and use it in GitHub Desktop.
Save ricjcosme/96691ff6ef822e90f52ace7c85eb5f05 to your computer and use it in GitHub Desktop.

Raspberry PI (cli):

  $ DST_HOST=nc_machine_addr
  $ SDSIZE=`sudo blockdev --getsize64 /dev/mmcblk0`;sudo pv -tpreb /dev/mmcblk0 -s $SDSIZE | nc $DST_HOST 19000

Netcat machine | "nc_machine_addr" (srv):

  $ nc -l 19000 | dd bs=1m of=/path/to/file.img

Restoring img to SD card:

  $ sudo dd bs=1m if=/path/to/file.img of=/dev/disk1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment