Last active
February 24, 2021 06:43
-
-
Save marktyers/9c4a03bfd5de64566ed2 to your computer and use it in GitHub Desktop.
Installing Cloud9 on a Raspberry Pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use base image of minibian (mac install) | |
wget https://sourceforge.net/projects/minibian/files/2016-03-12-jessie-minibian.tar.gz/download | |
diskutil list | |
diskutil unmountDisk /dev/disk4 | |
sudo dd bs=1m if=2016-03-12-jessie-minibian.img of=/dev/disk4 | |
# make sure you ssh into the correct IP address (not hostname) | |
Resize Partition | |
df -h | |
fdisk /dev/mmcblk0 | |
# options p (note start of partition 2) d 2 n p 2 (enter start value, default end) w | |
reboot | |
resize2fs /dev/mmcblk0p2 | |
df -h | |
# install packages | |
apt-get update -y && apt-get dist-upgrade -y && apt-get install -y sudo nano tree xclip git curl make gcc python nodejs && apt-get autoremove -y && apt-get clean -y | |
# update node (create a symlink called node that points to nodejs) | |
ln -s /usr/bin/nodejs /usr/bin/node | |
node -v | |
ln -s /usr/bin/nodejs /usr/bin/node | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash | |
# log out and in again | |
nvm list-remote | |
nvm install 5.9.1 | |
nvm alias default 5.9.1 | |
node -v | |
# installing npm (must be done as root) | |
curl -L https://npmjs.org/install.sh | sh | |
npm -v | |
# remove cached .deb files | |
apt-get clean -y | |
# remove orphaned packages | |
apt-get autoremove -y | |
# to remove a package including data | |
apt-get purge -y packagename | |
# create a normal account added to sudoers group | |
useradd -s /bin/bash -m -d /home/cloud9 -c "Running Cloud 9" cloud9 | |
passwd cloud9 | |
usermod -a -G sudo cloud9 | |
# change host name in two files and restart service | |
nano /etc/hostname | |
nano /etc/hosts | |
reboot | |
# make sure you remove the IP address from the known host file on the local machine | |
nano ~/.ssh/known_hosts | |
# now log in using new host and user | |
ssh cloud9@cloud9 | |
# setting up SSH keys | |
ssh-keygen -t rsa | |
less ~/.ssh/id_rsa.pub | |
# log out then copy local public key to server | |
# need to install ssh-copy-id using brew on mac | |
brew install ssh-copy-id | |
ssh-copy-id -i ~/.ssh/id_rsa.pub cloud9@cloud9 | |
# installing and updating node | |
# now try logging in again, you won't be promted for a password. | |
ssh cloud9@cloud9 | |
git clone git://github.com/c9/core.git c9sdk | |
cd c9sdk/ | |
scripts/install-sdk.sh | |
# alternative installation | |
git clone https://github.com/ajaxorg/cloud9.git | |
cd cloud9 | |
npm install | |
# now ready to start cloud 9 | |
./server.js -l 0.0.0.0 -a : | |
# but this will stop as soon as the terminal window shuts... | |
# install the forever module | |
# parameters control the port, the working directory/workspace and the login required. | |
npm install -g forever | |
forever start server.js -p 8181 -w ~/workspace/ -l 0.0.0.0 --auth testuser:testpass | |
# access Cloud9 (takes a while to load for the first time...) | |
# http://192.168.0.15:8181 | |
# installing and configuring mysql server | |
sudo apt-get install -y mysql-server | |
mysql -u root -p | |
mysql> CREATE USER username IDENTIFIED BY 'password'; | |
mysql> CREATE DATABASE dbname; | |
mysql> GRANT INSERT, UPDATE, DELETE, CREATE ON dbname.* TO username; | |
mysql> exit | |
# configuring wifi and bluetooth on raspberry pi 3 | |
apt-get update | |
apt-get install -y firmware-brcm80211 pi-bluetooth wpasupplicant | |
# configure wifi | |
apt-get install -y iw crda wireless-regdb wireless-tools | |
nano /etc/network/interfaces | |
allow-hotplug wlan0 | |
iface wlan0 inet manual | |
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | |
iface default inet dhcp | |
nano /etc/wpa_supplicant/wpa_supplicant.conf | |
network={ | |
ssid="yourssid" | |
psk="yourpassword" | |
} | |
# https://github.com/blobsmith/raspberryTestNode/wiki/Cloud9-IDE-installation-on-Raspberry-pi | |
# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server | |
# https://minibianpi.wordpress.com/how-to/rpi3/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment