--- /dev/null
+#! /usr/bin/env bash
+
+# Copyright (C) 2016 Daniel Watson
+# See the end of the file for license conditions.
+# GNU AGPLv3 (or later at your option)
+# https://challenge-bot.com/
+
+set -o nounset
+set -o errexit
+
+sudo -- sh -c "
+set -o nounset
+set -o errexit
+
+apt-get update && \
+apt-get install -f && \
+apt-get -y upgrade && \
+apt-get -y dist-upgrade && \
+apt-get -y autoremove
+"
+
+# Challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Affero Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null
+#! /usr/bin/env bash
+
+# Copyright (C) 2016 Daniel Watson
+# See the end of the file for license conditions.
+# GNU AGPLv3 (or later at your option)
+# https://challenge-bot.com/
+
+set -o nounset
+set -o errexit
+
+#TODO: check to see which of these are actually necessary. possibly just
+# the last one, libopencv-dev, is necessary
+sudo aptitude install -y \
+ v4l-utils \
+ libopencv-core2.4 \
+ libopencv-core-dev \
+ libopencv-dev
+
+# This file is part of challenge-bot.
+
+# Challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Affero Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null
+#! /usr/bin/env bash
+
+# Copyright (C) 2016 Daniel Watson
+# See the end of the file for license conditions.
+# GNU AGPLv3 (or later at your option)
+# https://challenge-bot.com/
+
+# run this on the bbb while hooked to host via usb
+set -o nounset
+set -o errexit
+
+route-internet-through-host-via-usb.bash
+
+# TODO: set timezone on beagleboard based on host system timezone
+# TODO: set time on beagleboard based on host system time
+
+# update the system to the latest
+full-update.bash
+sudo apt-get install -y aptitude
+sudo aptitude install -y pkg-config
+
+# TODO: install opencv
+install-opencv.bash
+
+# This file is part of challenge-bot.
+
+# Challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Affero Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null
+#! /usr/bin/env bash
+
+# Copyright (C) 2016 Daniel Watson
+# See the end of the file for license conditions.
+# GNU AGPLv3 (or later at your option)
+# https://challenge-bot.com/
+
+set -o nounset
+set -o errexit
+
+sudo ifconfig usb0 192.168.7.2
+sudo route add default gw 192.168.7.1
+echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf > /dev/null
+
+# This file is part of challenge-bot.
+
+# Challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Affero Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null
+#! /usr/bin/env bash
+
+# Copyright (C) 2016 Daniel Watson
+# See the end of the file for license conditions.
+# GNU AGPLv3 (or later at your option)
+# https://challenge-bot.com/
+
+set -o nounset
+set -o errexit
+
+ETH="${1}"
+sudo ifconfig "${ETH}" 192.168.7.1
+sudo iptables \
+ --table nat \
+ --append POSTROUTING \
+ --out-interface wlan0 \
+ -j MASQUERADE
+sudo iptables --append FORWARD --in-interface "${ETH}" -j ACCEPT
+echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
+
+# Challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Affero Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null
+# Copyright (C) 2016 Daniel Watson
+# See the end of the file for license conditions.
+# GNU AGPLv3 (or later at your option)
+# https://challenge-bot.com/
+
+CFLAGS = `pkg-config --cflags opencv`
+LIBS = `pkg-config --libs opencv`
+
+% : %.cpp
+ g++ $(CFLAGS) $(LIBS) -o $@ $<
+
+all: opencv-hello-world
+ ./opencv-hello-world
+
+# This file is part of challenge-bot.
+
+# Challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Affero Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null
+/*
+ Copyright (C) 2015 Daniel Watson
+ See the end of the file for license conditions.
+*/
+/* challenge-bot
+ GNU AGPLv3 (or later at your option)
+ project available here:
+ https://challenge-bot.com/
+*/
+#include <opencv2/opencv.hpp>
+
+using namespace cv;
+using namespace std;
+
+int main(int argc, char** argv) {
+ VideoCapture camera;
+ camera.open(0);
+ Mat edges;
+ Mat frame;
+ if(!camera.isOpened()) {
+ cout << "not opened :( that's bad" << endl;
+ exit(-1); }
+ camera >> frame;
+ Mat grey_image;
+ cvtColor(frame, grey_image, CV_BGR2GRAY);
+
+ imwrite("image.png", frame);
+ imwrite("image-grey.png", grey_image);
+ return 0; }
+
+/*
+ This file is part of challenge-bot.
+
+ Challenge-bot is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ GNU Affero Emacs is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
+*/
--- /dev/null
+#! /usr/bin/env bash
+
+# Copyright (C) 2016 Daniel Watson
+# See the end of the file for license conditions.
+# GNU AGPLv3 (or later at your option)
+# https://challenge-bot.com/
+
+# run this on the bbb while hooked to host via usb
+set -o nounset
+set -o errexit
+
+route-internet-through-host-via-usb.bash
+
+# TODO: set timezone on beagleboard based on host system timezone
+# TODO: set time on beagleboard based on host system time
+
+# update the system to the latest
+full-update.bash
+sudo apt-get install -y aptitude
+sudo aptitude install -y \
+ pkg-config
+
+# TODO: install opencv
+install-opencv.bash
+
+# This file is part of challenge-bot.
+
+# Challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Affero Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.