Skip to content

Instantly share code, notes, and snippets.

@mattfelsen
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfelsen/69541387e4a9d610acca to your computer and use it in GitHub Desktop.
Save mattfelsen/69541387e4a9d610acca to your computer and use it in GitHub Desktop.
Raspberry Pi Related Things

SD card-related

Clone an SD card for backup

Use diskutil list to figure out which disk number the SD card is mounted as. Then:

sudo dd if=/dev/rdisk2 bs=1m | gzip > image.img.gz

Flash an image onto an SD card

Basically the reverse of the above. Make sure you decompress the gzip first if it's compressed. Use diskutil list to figure out which disk number the SD card is mounted as. Then:

cd path/to/image
diskutil unmountDisk /dev/disk2
sudo dd if=image.img of=/dev/rdisk2 bs=1m

Output over HDMI

Turn off output so that a connected display will go into sleep:

tvservice -o

Turn on output:

tvservice -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment