Skip to content

Instantly share code, notes, and snippets.

@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 root@raspberrypi.local 'aptitude install screen'
ssh root@raspberrypi.local 'screen -d -m -S clone'
ssh root@raspberrypi.local 'echo u > /proc/sysrq-trigger'
ssh root@raspberrypi.local 'screen -x clone'
dd if=/dev/mmcblk0 bs=1M of=/dev/sda count=4K
#for the first 4GB
#detach with "CRTL-a d"
@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 / gist:15806587b5d3a1c07d8a
Last active August 29, 2015 14:19
create OPK raspberry pi image
sudo -s
# download new rpi image
wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2015-02-17/2015-02-16-raspbian-wheezy.zip
# insert new SDcard in my case /dev/sdb1 gets mounted ... umount
umount /dev/sdb1
zcat 2015-02-16-raspbian-wheezy.zip > /dev/sdb
# insert SDcard into rpi2 with serial cable attached to the laptop
#https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/test-and-configure
screen /dev/ttyUSB0 115200
# login using username pi password raspberry
@treehouse-su
treehouse-su / autorun.sh
Created May 12, 2015 02:11
jack in the box for wifi and blink
#!/bin/sh
sudo pirateship rename pirate1
sudo pirateship adapter pirate.sh/ip "" none
sudo ifdown wlan0
sudo ifup wlan0
sudo apt-get install libusb-1.0-0-dev
cd /root
git clone https://github.com/todbot/blink1.git
@treehouse-su
treehouse-su / autorun.sh
Last active August 29, 2015 14:21
piratebell
#!/bin/sh
# configure pirateship image
sudo pirateship rename piratebell
# install couchdb image drivers
docker pull dogi/rpi-couchdb
docker run -d -p 5984:5984 --name pirateship -v /srv/data/pirateship:/usr/local/var/lib/couchdb -v /srv/log/pirateship:/usr/local/var/log/couchdb dogi/rpi-couchdb
docker run -d -p 5985:5984 --name pirateisle -v /srv/data/pirateisle:/usr/local/var/lib/couchdb -v /srv/log/pirateisle:/usr/local/var/log/couchdb dogi/rpi-couchdb
@treehouse-su
treehouse-su / autorun.sh
Last active August 29, 2015 14:21 — forked from dwblair/autorun.sh
temper1 OPK script
#!/bin/sh
# configure pirateship image
pirateship rename temper
pirateship adapter pirate.sh/ip "" none
# install opk drivers
# NOTE: must manually copy phant 'keys_*.json' file to /boot directory
cd /root
@treehouse-su
treehouse-su / autorun.sh
Created May 15, 2015 00:29
yoctopuce temp OPK script
#!/bin/sh
# configure pirateship image
sudo pirateship rename temper
sudo pirateship adapter pirate.sh/ip "" none
sudo ifdown wlan0
sudo ifup wlan0
# install opk drivers
@treehouse-su
treehouse-su / autorun.sh
Last active August 29, 2015 14:21
1wire temp OPK script
#!/bin/sh
# configure pirateship image
sudo pirateship rename onewire
sudo pirateship adapter pirate.sh/ip "" none
sudo ifdown wlan0
sudo ifup wlan0
# install opk drivers
@treehouse-su
treehouse-su / autorun.sh
Last active September 4, 2015 12:38
pirate.sh/ip raspberry pi image ole bell startup files
#!/bin/sh
sleep 1
docker start community
sleep 1
docker start nation
@treehouse-su
treehouse-su / autorun.sh
Last active August 29, 2015 14:25
qa bell nation install scripts
#!/bin/sh
sleep 1
docker start oldnation
sleep 1
docker start newnation