Skip to content

Instantly share code, notes, and snippets.

@kmpm
Last active December 24, 2015 10:08
Show Gist options
  • Save kmpm/6781543 to your computer and use it in GitHub Desktop.
Save kmpm/6781543 to your computer and use it in GitHub Desktop.

How to make life easier with BeagleBone Black

This is a set of notes and instructions that I use to get my BeagleBone Black to a state that I find usable after installing Debian Wheezy on it.

Neccesary things

sudo apt-get install git curl vim python build-essential openssl libssl-dev

My special vim stuff

A small script that sets up vim more like i want it.

curl https://gist.github.com/kmpm/4461337/raw/viminstall.sh | sh 

Installing Node

curl https://raw.github.com/creationix/nvm/master/install.sh | sh

This adds the line

[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM

to the end of ~/.profile. This doesn't work with byobu which want things in .bashrc instead so move it please.

Next thing is to do the actual installation. If you do not want to log out and in again you have to source the nvm.sh file yourself first.

. ~/.nvm/nvm.sh

# this will take a couple of hours
nvm install 0.10.17 --without-snapshot

# when done do this to have a default node environment
# every time you log on.
nvm alias default 0.10

At the time of writing the --without-snapshot is absolutely essential. Otherwise node will just crash with a segfault. The option slows down the start of the node process some but it's not a huge deal.

Internet on usb0

on beaglebone:

ifconfig usb0 192.168.7.2
sudo sh -c "route add default gw 192.168.7.1"

On Linux computer:


#eth0 is my internet facing interface, eth1 is the BeagleBone USB connection
#sudo su
#ifconfig eth1 192.168.7.1

sudo sh -c "iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE"
sudo sh -c "iptables --append FORWARD --in-interface eth1 -j ACCEPT"
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

Cleanup

sudo sh -c "iptables --table nat --delete POSTROUTING --out-interface wlan0 -j MASQUERADE"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment