Closed i5o closed 7 years ago
pi@raspberrypi:~ $ cat /boot/version.txt
release-29
pi@raspberrypi:~ $ pirateship
Usage: pirateship [options] [command]
Options:
-h, --help output usage information
Commands:
default sets a raspbian back to default configuration
rename <hostname> changes Hostname
wifi <ESSID> [password] connects to a wifi network
staticwifi <ip> <mask> <gateway> <dns> configures rpi wifi interface to a static ip address
ethernet <ip> <mask> <gateway> <dns> configures rpi network interface to a static ip address
hotspot <ESSID> [password] creates a mobile hotspot
expandfs expands the partition of the RPI image to the maximum of the SDcard
detectrpi detects the hardware version of a raspberry pi
version returns the version of pirateship command
docker [dockerimagezip] loads all images under /root/dockerimages to docker; then the images are removed
password <password> change the password for `pi` user
sshkeyadd <public_key> add a public key to `pi` and `root` user's authorized_keys
* temporary catch all
pi@raspberrypi:~ $
I know that staticwifi, ethernet are not working. Same with default, since we have to update the paths/commands.
We already know that wifi
and hotspot
are working
pirateship version :white_check_mark:
root@raspberrypi:~# pirateship version
0.3.0
root@raspberrypi:~#
pirateship detectrpi :white_check_mark:
root@raspberrypi:~# pirateship detectrpi
RPI3B
root@raspberrypi:~#
pirateship expandfs :white_check_mark:
root@raspberrypi:~# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/root 4.4G 3.4G 789M 82% /
root@raspberrypi:~# pirateship expandfs
:)
root@raspberrypi:~# reboot
Connection to 192.168.1.12 closed by remote host.
Connection to 192.168.1.12 closed.
ignacio@mint ~ $ ssh pi3c
pi@raspberrypi:~ $ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.9G 3.4G 4.1G 46% /
pi@raspberrypi:~ $
pirateship password :white_check_mark:
root@raspberrypi:/home/pi# login
raspberrypi login: pi
Password: raspberry
pi@raspberrypi:~ $ logout
root@raspberrypi:/home/pi# pirateship password ignacio
password change success
root@raspberrypi:/home/pi# login
raspberrypi login: pi
Password: raspberry
Login incorrect
raspberrypi login: pi
Password: ignacio
pi@raspberrypi:~ $
pirateship sshkeyadd :white_check_mark:
root@raspberrypi:~# cat /home/pi/.ssh/authorized_keys | sed '$!d'
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCu+1p/iSndK7zjjDl67m6Wpzphpf2y8mRyton7B+VdzMm0Hsq5BwWey2AePiWo7kJpSQEeRLQOKImnk7itsuqZL6VXsFLWc6FElkEiyokM4JadwqGYZUKaZtLDVCaJlSR6AfvUc5XwuBI785GSsBd58rPo3P4BTebF1wY5poFkPF07jVx+TmpLg13e/NPbrX01CC14v0QVz+EKKuTzHk4BB7Gb3dyF1sm8b4DKOCUZ7JcQuVA3PToOpblqeiF4y48FA/YTAhbs75/kT1CPOQy1y7KMh2DPLHnjk+OYuz6C8fo/ghdGl0nJhrbur0dtofNGPrj/1KofizNCnImJI6QbHLsWmwSmuumhQ9SxKPp237ApGb915hksFnZVVFP2ueuSVMfGLaUxAvP4hYwG0MiCLDXVCZySfLAIjb3GCps95dzr57+Jjsam8L9GWjU96ydWQ57DkEOoirTLwiOH1LMoaEJ+TgirSyvPwfYRLJIiKaqltNK3BNTaUsMCGzCCXXRFGCv3oCJ/y7Ue+0zDkipBWBW0THpifoNtwk3w0YSSJsYrTlTEqeewnI8toMFgLWZvNpDrmdHxpEhFM0fjhEKFoEgMncpr6PeOlO9MThE0oE17OTTz8kHcfGOKLwsxug6buxyBIKQ3dqRFu5AX14k7cfT2apUXyUevHm8uPltodw== Yurockkk
root@raspberrypi:~# cat /root/.ssh/authorized_keys | sed '$!d'
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCu+1p/iSndK7zjjDl67m6Wpzphpf2y8mRyton7B+VdzMm0Hsq5BwWey2AePiWo7kJpSQEeRLQOKImnk7itsuqZL6VXsFLWc6FElkEiyokM4JadwqGYZUKaZtLDVCaJlSR6AfvUc5XwuBI785GSsBd58rPo3P4BTebF1wY5poFkPF07jVx+TmpLg13e/NPbrX01CC14v0QVz+EKKuTzHk4BB7Gb3dyF1sm8b4DKOCUZ7JcQuVA3PToOpblqeiF4y48FA/YTAhbs75/kT1CPOQy1y7KMh2DPLHnjk+OYuz6C8fo/ghdGl0nJhrbur0dtofNGPrj/1KofizNCnImJI6QbHLsWmwSmuumhQ9SxKPp237ApGb915hksFnZVVFP2ueuSVMfGLaUxAvP4hYwG0MiCLDXVCZySfLAIjb3GCps95dzr57+Jjsam8L9GWjU96ydWQ57DkEOoirTLwiOH1LMoaEJ+TgirSyvPwfYRLJIiKaqltNK3BNTaUsMCGzCCXXRFGCv3oCJ/y7Ue+0zDkipBWBW0THpifoNtwk3w0YSSJsYrTlTEqeewnI8toMFgLWZvNpDrmdHxpEhFM0fjhEKFoEgMncpr6PeOlO9MThE0oE17OTTz8kHcfGOKLwsxug6buxyBIKQ3dqRFu5AX14k7cfT2apUXyUevHm8uPltodw== Yurockkk
root@raspberrypi:~# pirateship sshkeyadd "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNtR1gq8JF+y+sAgUV+4wfF9OTXkaNVpDVWv4JU8GPNaVJP1dMQ1GcYRrI877z/QsZk9UOu08bSUU8ggengygyz7RJPDV3+HYTjIJXO9FmfGA/1FrE1aoEPfTkNhqq70PbPwJCPQZf/T2zNIGKeMLJ/E/I+Jysg6SDlHk6zWIWbTeBFKQsNj9fQTsAGoSThGHcxEB/eQJ0tLBUb8MhGJSLtExSbhT8Dw63pYAb0BtzNnGesaCQTxAycxBk8XOQP0nO6rjyRPF9hjfYFslk1aeq29HIeLrC+tX0Vql59M/2CRx8inmYvZJetjf79TBymlclj/Zulum9KJ6nCGwXuIuv ignacio@ignacio-laptop"
====== Added to `pi` and `root` user's authorized_keys ======
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNtR1gq8JF+y+sAgUV+4wfF9OTXkaNVpDVWv4JU8GPNaVJP1dMQ1GcYRrI877z/QsZk9UOu08bSUU8ggengygyz7RJPDV3+HYTjIJXO9FmfGA/1FrE1aoEPfTkNhqq70PbPwJCPQZf/T2zNIGKeMLJ/E/I+Jysg6SDlHk6zWIWbTeBFKQsNj9fQTsAGoSThGHcxEB/eQJ0tLBUb8MhGJSLtExSbhT8Dw63pYAb0BtzNnGesaCQTxAycxBk8XOQP0nO6rjyRPF9hjfYFslk1aeq29HIeLrC+tX0Vql59M/2CRx8inmYvZJetjf79TBymlclj/Zulum9KJ6nCGwXuIuv ignacio@ignacio-laptop
root@raspberrypi:~# cat /root/.ssh/authorized_keys | sed '$!d'
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNtR1gq8JF+y+sAgUV+4wfF9OTXkaNVpDVWv4JU8GPNaVJP1dMQ1GcYRrI877z/QsZk9UOu08bSUU8ggengygyz7RJPDV3+HYTjIJXO9FmfGA/1FrE1aoEPfTkNhqq70PbPwJCPQZf/T2zNIGKeMLJ/E/I+Jysg6SDlHk6zWIWbTeBFKQsNj9fQTsAGoSThGHcxEB/eQJ0tLBUb8MhGJSLtExSbhT8Dw63pYAb0BtzNnGesaCQTxAycxBk8XOQP0nO6rjyRPF9hjfYFslk1aeq29HIeLrC+tX0Vql59M/2CRx8inmYvZJetjf79TBymlclj/Zulum9KJ6nCGwXuIuv ignacio@ignacio-laptop
root@raspberrypi:~# cat /home/pi/.ssh/authorized_keys | sed '$!d'
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNtR1gq8JF+y+sAgUV+4wfF9OTXkaNVpDVWv4JU8GPNaVJP1dMQ1GcYRrI877z/QsZk9UOu08bSUU8ggengygyz7RJPDV3+HYTjIJXO9FmfGA/1FrE1aoEPfTkNhqq70PbPwJCPQZf/T2zNIGKeMLJ/E/I+Jysg6SDlHk6zWIWbTeBFKQsNj9fQTsAGoSThGHcxEB/eQJ0tLBUb8MhGJSLtExSbhT8Dw63pYAb0BtzNnGesaCQTxAycxBk8XOQP0nO6rjyRPF9hjfYFslk1aeq29HIeLrC+tX0Vql59M/2CRx8inmYvZJetjf79TBymlclj/Zulum9KJ6nCGwXuIuv ignacio@ignacio-laptop
root@raspberrypi:~#
pirateship docker :white_check_mark:
root@raspberrypi:~# pirateship docker
pack
- Image: /root/dockerimages/dogi-rpi-couchdb.tar.gz
- Image: /root/dockerimages/portainer-portainer.tar.gz
The image portainer-portainer.tar.gz has been loaded.
The image dogi-rpi-couchdb.tar.gz has been loaded.
root@raspberrypi:~# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
portainer/portainer latest 6cafdc66421d 2 weeks ago 33.1MB
dogi/rpi-couchdb latest 9d5f8c7d3197 2 years ago 180MB
root@raspberrypi:~#
devel
pirateship ethernet :white_check_mark:
root@raspberrypi:/home/pi/pirateship# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::14ef:98f4:6a61:f67d prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:5f:b5:a8 txqueuelen 1000 (Ethernet)
RX packets 833 bytes 94480 (92.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 322 bytes 46672 (45.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@raspberrypi:/home/pi/pirateship# ./cli.js ethernet 192.168.1.14 255.255.255.0 192.168.1.1 8.8.8.8
This pirateship has anchored successfully!
root@raspberrypi:/home/pi/pirateship# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.14 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::14ef:98f4:6a61:f67d prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:5f:b5:a8 txqueuelen 1000 (Ethernet)
RX packets 1124 bytes 116247 (113.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 519 bytes 74339 (72.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@raspberrypi:/home/pi# exit
pi@raspberrypi:~ $ logout
Connection to 192.168.1.12 closed.
ignacio@mint ~/Desktop/trabajo/pirateship/lib $ ssh pi@192.168.1.14
pi@raspberrypi:~ $
pirateship staticwifi :white_check_mark:
root@raspberrypi:/home/pi/pirateship# ./cli.js staticwifi 192.168.1.50 255.255.255.0 192.168.1.1 8.8.8.8
This pirateship has anchored successfully!
root@raspberrypi:/home/pi/pirateship# ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.49 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::ba27:ebff:fe0a:e0fd prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:0a:e0:fd txqueuelen 1000 (Ethernet)
RX packets 27 bytes 2814 (2.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 66 bytes 11018 (10.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@raspberrypi:/home/pi/pirateship# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:5f:b5:a8 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.16/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fe5f:b5a8/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:0a:e0:fd brd ff:ff:ff:ff:ff:ff
inet 192.168.1.49/24 brd 192.168.1.255 scope global wlan0
valid_lft forever preferred_lft forever
inet 192.168.1.50/24 brd 192.168.1.255 scope global secondary wlan0
valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fe0a:e0fd/64 scope link
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:f8:c3:0e:dd brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
root@raspberrypi:/home/pi/pirateship#
I was able to ssh into pi with 192.168.1.50 too
Everything is working, and release-30 is available http://dev.ole.org/treehouse-30.img.gz
Test all commands of pirateship in stretch, and fix the ones that are not working