July 06, 2013 | Raspberry Pi |
This is how I develop code on my Raspberry Pi:
ssh into the Pi from my Macbook Pro from 2 Terminals, and use emacs on one to edit the code, while I run the code from the other. This way I don't need to use the annoyingly slow X-server or VNC solutions to display UI from the PI for editing.
Installing emacs on the Pi is exceedingly simple, by the way:
sudo apt-get install emacs
There are other editors, but really nothing beats emacs or vi when it comes to editing code on Linux, and I highly recommend that you spend some time learning one of these editors.
Since I develop code on the Pi directly, I need a backup plan, and the plan is rsync.
rsync is a Unix utility that can synchronyze your files between directories and other machines (via ssh).
rsync is very powerful, and not to be meddled with unless you are paying attention. If you are mucking around it with it, (a) back up your test files and (b) use the -n or "dry run" flag so it only tells you what will be done and not actually do it, till you are satisfied.
Here is my script to back up my code directory (recursively) from the Raspberry Pi on to my Macbook:
Here is a typical run:
Backing up RPi #1...
receiving file list ... done
sent 502 bytes received 24631 bytes 4569.64 bytes/sec
total size is 23024 speedup is 0.92
Need help with a hardware project or product? Drop us an email at email@example.com. We offer consulting services on AVR and Nordic nRF BLE - hardware design, firmware development, prototyping, PCB design/assembly, sourcing and manufacturing. We can help you bring your product to market!
We love hearing from our readers. Email us at firstname.lastname@example.org for questions or comments on this article. If you found this article useful, please support us by buying some of our hardware products.