add everything so cindy can get it
authordaniel watson <ozzloy@gmail.com>
Thu, 18 Feb 2016 01:56:08 +0000 (17:56 -0800)
committerdaniel watson <ozzloy@gmail.com>
Sun, 6 Mar 2016 23:10:40 +0000 (15:10 -0800)
bbb/bbb/bin/full-update.bash [new file with mode: 0755]
bbb/bbb/bin/install-opencv.bash [new file with mode: 0755]
bbb/bbb/bin/post-flash.bash [new file with mode: 0755]
bbb/bbb/bin/route-internet-through-host-via-usb.bash [new file with mode: 0755]
bbb/local/bin/allow-bbb-to-use-this-systems-internet.bash [new file with mode: 0755]
bbb/opencv-hello-world/makefile [new file with mode: 0644]
bbb/opencv-hello-world/opencv-hello-world.cpp [new file with mode: 0644]
bbb/post-flash.bash [new file with mode: 0644]

diff --git a/bbb/bbb/bin/full-update.bash b/bbb/bbb/bin/full-update.bash
new file mode 100755 (executable)
index 0000000..1143aee
--- /dev/null
@@ -0,0 +1,33 @@
+#! /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/>.
diff --git a/bbb/bbb/bin/install-opencv.bash b/bbb/bbb/bin/install-opencv.bash
new file mode 100755 (executable)
index 0000000..1361173
--- /dev/null
@@ -0,0 +1,32 @@
+#! /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/>.
diff --git a/bbb/bbb/bin/post-flash.bash b/bbb/bbb/bin/post-flash.bash
new file mode 100755 (executable)
index 0000000..52bfbcb
--- /dev/null
@@ -0,0 +1,38 @@
+#! /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/>.
diff --git a/bbb/bbb/bin/route-internet-through-host-via-usb.bash b/bbb/bbb/bin/route-internet-through-host-via-usb.bash
new file mode 100755 (executable)
index 0000000..4379bc7
--- /dev/null
@@ -0,0 +1,28 @@
+#! /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/>.
diff --git a/bbb/local/bin/allow-bbb-to-use-this-systems-internet.bash b/bbb/local/bin/allow-bbb-to-use-this-systems-internet.bash
new file mode 100755 (executable)
index 0000000..85d1483
--- /dev/null
@@ -0,0 +1,32 @@
+#! /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/>.
diff --git a/bbb/opencv-hello-world/makefile b/bbb/opencv-hello-world/makefile
new file mode 100644 (file)
index 0000000..91052dd
--- /dev/null
@@ -0,0 +1,28 @@
+#  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/>.
diff --git a/bbb/opencv-hello-world/opencv-hello-world.cpp b/bbb/opencv-hello-world/opencv-hello-world.cpp
new file mode 100644 (file)
index 0000000..02fea3e
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+  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/>.
+*/
diff --git a/bbb/post-flash.bash b/bbb/post-flash.bash
new file mode 100644 (file)
index 0000000..1169cf4
--- /dev/null
@@ -0,0 +1,39 @@
+#! /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/>.