Hello,
beeing curious about BoneScript, I've played a bit around.
As the Cloud9 IDE isn't fully open source and does some things I don't
like (e.g. using google analytics when opened, do they track which files
I'm editing?), I've searched a bit around and discovered Scripted. It
isn't as nice and polished as the Cloud9 IDE, but it is fully open
source and does the job as an browser-only remote editor for the BBB.
I've even seen that it has a vi mode.
The result are some few exact steps to install and use Scripted on the
BeagleBone Black, maybe some people like them. I've used an Angstrom
image which was from around July 2013, so something might have changed
since them. Feel free to update and/or add other exact steps and post
them wherever you like.
- Connect the BBB such that it has access to the Internet which is
necessary to install some things.
- Login as root
- Switch to user xuser, this is necessary because bower (a node.js
package installer) doesn't want run as root:
su - xuser
- Clone the repository for Scripted:
git clone git://github.com/scripted-editor/scripted.git scripted.git
- Switch to your very own branch of Scripted (and a commit number known
to work with my steps):
cd scripted.git
git checkout -b bbb bf924f98a210de49700366f22b89ab61c7d6203d
- Install necessary node.js modules:
npm install
- Get some patches from me:
wget http://ahsoftware.de/scripted-bone-patches.tar.bz2
(Nothing else needed from the Internet, you can disconnect the world.)
- Get root again:
exit
- Move the repository:
mv /home/xuser/scripted.git .
- Delete some leftovers:
rm -rf /home/xuser/.npm /home/xuser/.bower /home/xuser/tmp
- Change permissions:
chown -R root:root scripted.git
- Add my patches:
cd scripted.git
tar xjf scripted-bone-patches.tar.bz2
rm scripted-bone-patches.tar.bz2
git am 000*
rm 000*
- Start the server:
node server/start-bone.js
- Browse to your BBB at http://192.168.7.2:8123/editor
(This is the IP if the BBB is connected using USB, it might different for you)
- Do a simple test for BoneScript:
Click on BoneScript (on the left side)
Click on test.js
Click on the editor field (the source) and press SHIFT-ALT-x to run
(a reload might be necessary to use shift-alt-x, don't ask me why)
Click on .scripted to see how this is done
- Do a simple test for C++:
Click on Cpp (on the left side)
Click on test.cpp
Click on the editor field (the source) and press SHIFT-ALT-x to run
(a reload might be necessary to use shift-alt-x, don't ask me why)
Click on .scripted to see how this is done
A warning is necessary: As I've configured Scripted to be able to
execute almost everthing by remote (and as root!), be sure you don't
connect it to a network reachable by world+dog. See server/start-bone.js
(at the end of the script) about how to disable the exec functionality
with the used version of Scripted. But even then, everyone will still be
able to save arbitrary files, filling up the available filesystem space.
Things you could do:
- Create a user for scripted to not let it run as root. Beeing root
isn't needed to run scripted and a very bad idea. I've just done it in
the steps above for simplicity.
- Add startup-script (similiar to the cloud9 startup-script)
- Add an button/icon for exec
- Modify the application server (the top right button in the editor) to
work remotely.
- Improve Scripted
Regards,
Alexander Holler