This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/exp/io/i2c" | |
"os" | |
"strconv" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo groupadd removable | |
$ sudo usermod -a -G removable my_user_name_here | |
$ cat /etc/udev/rules.d/99-removable-disk.rules | |
KERNEL=="sd*", SUBSYSTEM=="block", ATTRS{removable}=="1", GROUP="removable" | |
$ sudo udevadm control --reload-rules | |
$ ls -l /dev/sdf | |
brw-rw---- 1 root removable 8, 80 Jan 24 16:19 /dev/sdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import util.Random | |
class ControlFunction { | |
def respond(input: String) = { | |
val cmd = Command(input) | |
cmd.opcode match { | |
case "React" => { | |
if (cmd.generation == 0) { | |
val view = cmd.view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net/http" | |
func main() { | |
panic(http.ListenAndServe(":8080", http.FileServer(http.Dir("/home/chronos/user/src")))) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/toolchain | |
cd ~/toolchain | |
wget http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a_hardfp/stage3-armv7a_hardfp-20130209.tar.bz2 | |
export C_INCLUDE_PATH=~/toolchain/usr/include | |
export LD_LIBRARY_PATH=~/toolchain/usr/lib:~/toolchain/usr/lib/binutils/armv7a-hardfloat-linux-gnueabi/2.22 | |
export PATH=$PATH:~/toolchain/usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/4.6.3:~/toolchain/usr/armv7a-hardfloat-linux-gnueabi/binutils-bin/2.22 | |
sed -i 's/\/usr/\/home\/chronos\/user\/toolchain\/usr/g' ~/toolchain/usr/lib/libc.so | |
sed -i 's/\/usr/\/home\/chronos\/user\/toolchain\/usr/g' ~/toolchain/usr/lib/libpthread.so |