Skip to content

Instantly share code, notes, and snippets.

Xen Minimal OS!
start_info: 0xb10000(VA)
nr_pages: 0x6a400
shared_inf: 0xbf702000(MA)
pt_base: 0xb13000(VA)
nr_pt_frames: 0x9
mfn_list: 0x967000(VA)
mod_start: 0x0(VA)
mod_len: 0
flags: 0x0
#!/usr/bin/env node
var fs = require('fs');
var gpioDirectory = "/sys/class/gpio";
var pins = {};
pins["seg7Data"] = { gpio: "145" }; // header pin 10
pins["seg7Clock"] = { gpio: "162" }; // header pin 14
pins["seg7Latch"] = { gpio: "161" }; // header pin 16
pins["ledData"] = { gpio: "158" }; // header pin 12
pins["ledClock"] = { gpio: "159" }; // header pin 18
@jadonk
jadonk / test.js
Created January 5, 2012 19:16
Test stockfish performance
#!/usr/bin/env node
var child_process = require('child_process');
var stockfish = child_process.spawn('time', [ './stockfish' ]);
stockfish.stderr.setEncoding('ascii');
stockfish.stderr.on('data', function(data) {
console.error(data.replace(/\n$/, ''));
});
stockfish.stdout.setEncoding('ascii');
var stockfish_write = function(cmd) {
console.log(cmd);
@jadonk
jadonk / epolltest.c
Created May 3, 2012 17:41
Quick test using epoll to wait on GPIO events
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/epoll.h>
#include <sys/types.h>
int main(int argc, char** argv) {
@jadonk
jadonk / libevtest.c
Created May 9, 2012 01:56
Why does the node.js module only see every 4th event?
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/epoll.h>
#include <sys/types.h>
#include <ev.h>
//******************************************************************
var b = require ('bonescript');
var LCD_RS = "P8_12"; //LCD Register Set (RS) control
var LCD_E = "P8_14"; //LCD Enable (E) control
var LCD_DB0 = "P8_16"; //LCD Data line DB0
var LCD_DB1 = "P8_18"; //LCD Data line DB1
var LCD_DB2 = "P8_20"; //LCD Data line DB2
var LCD_DB3 = "P8_22"; //LCD Data line DB3
@jadonk
jadonk / parse-eeprom
Last active December 28, 2015 22:49
Read the serial number and unused MAC ID off of a BeagleBone
root@ubuntu-armhf:~# ./parse-eeprom
c8:a0:30:ac:e0:be
A335BNLT 0A5A 1513BBBK0837
@jadonk
jadonk / autorun.sh
Last active December 29, 2015 11:39
BeagleSNES from Buildroot not able to set video mode from SDL application using 3.8.13 kernel
#!/bin/bash
sleep 1
cd /mnt
nice -n -20 snes9x-sdl -conf snes9x.conf 2>&1 > output.txt
dmesg >> output.txt
sync
@jadonk
jadonk / qb_showain.html
Created February 18, 2014 05:33
Quickly read the AIN values on BeagleBone Black for debugging the Quickbot (http://o-botics.org/robots/quickbot/). To install, open Cloud9 IDE on your board (http://<bot's IP address>:3000), create a new file and paste this content, then click the PREVIEW button.
<!-- Quickbot testing -->
<html>
<head>
<title>Quickbot testing</title>
<script src="http://beagleboard.org/static/jquery.js"></script>
<script src="http://beagleboard.org/static/bonescript.js"></script>
</head>
<body>
<h1>jQuery Demo</h1>
<p>AIN0 = <span id="ain0"></span></p>
#!/bin/bash
pactl load-module module-loopback
while true
do
DISPLAY=:0 chrt -f 50 /usr/games/pycdg "`ls /root/karaoke/*.cdg | shuf -n 1`"
done