Skip to content

Instantly share code, notes, and snippets.

@treehouse-su
treehouse-su / regenerate_ssh_host_keys
Created April 3, 2013 18:30
regenerate_ssh_host_keys
#!/bin/sh
### BEGIN INIT INFO
# Provides: regenerate_ssh_host_keys
# Required-Start:
# Required-Stop:
# Default-Start: 2
# Default-Stop:
# Short-Description: Regenerate ssh host keys
# Description:
### END INIT INFO
@treehouse-su
treehouse-su / cloneRPI.sh
Last active December 11, 2015 16:19
Cloning the SDcard of the raspberry pi while running remotely ... (second SDcard is attached usb SDcard-Reader)
#copy your ssh key to root@raspberrypi
ssh [email protected] 'aptitude install screen'
ssh [email protected] 'screen -d -m -S clone'
ssh [email protected] 'echo u > /proc/sysrq-trigger'
ssh [email protected] 'screen -x clone'
dd if=/dev/mmcblk0 bs=1M of=/dev/sda count=4K
#for the first 4GB
#detach with "CRTL-a d"