Skip to content

Instantly share code, notes, and snippets.

--- a/src/drivers/net/intel.c
+++ b/src/drivers/net/intel.c
@@ -181,21 +181,41 @@ static int intel_init_eeprom ( struct intel_nic *intel ) {
static int intel_fetch_mac_eeprom ( struct intel_nic *intel,
uint8_t *hw_addr ) {
int rc;
+ uint16_t offset;
/* Initialise EEPROM */
if ( ( rc = intel_init_eeprom ( intel ) ) != 0 )
@keyz182
keyz182 / Ultrasonic.ino
Created August 17, 2012 17:35
Ultrasonic Reader
#include <SoftwareSerial.h>
#include <Wire.h>
#include <NewPing.h>
#define TRIGGER_PIN 13 // Arduino pin tied to trigger pin on ping sensor.
#define ECHO_PIN 5 // Arduino pin tied to echo pin on ping sensor.
#define MAX_DISTANCE 100 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
SoftwareSerial mySerial(2, 3); // RX, TX, Serial is needed to debug
@keyz182
keyz182 / qtforpi.bash
Created August 23, 2012 10:25
QT Module Compile
#!/bin/bash
for i in qtimageformats qtsvg qtjsbackend qtscript qtxmlpatterns qtdeclarative qtsensors qt3d qtgraphicaleffects qtjsondb qtlocation qtquick1 qtsystems qtmultimedia
do
cd ~/opt/qt5/$i && echo "Building $i" && sleep 3 && /usr/local/qt5pi/bin/qmake . && make -j5 && sudo make install && touch COMPILED
cd ~/opt/qt5/
done
for i in qtimageformats qtsvg qtjsbackend qtscript qtxmlpatterns qtdeclarative qtsensors qt3d qtgraphicaleffects qtjsondb qtlocation qtquick1 qtsystems qtmultimedia
@keyz182
keyz182 / bakeqtpi.bash
Created August 27, 2012 13:09
Script to "Bake" the QT5 libraries for the Pi
#!/bin/bash
#This script will download, set up, compile QT5, and set up the SDCard image ready to use.
#Pass -h to use https for git
OPT=~/opt
CC=$OPT/gcc-4.7-linaro-rpi-gnueabihf
CCT=$OPT/cross-compile-tools
MOUNT=/mnt/rasp-pi-rootfs
QTBASE=$OPT/qt5
@keyz182
keyz182 / knife-openstack-hadoop
Last active December 18, 2015 18:59
Install the tools for getting hadoop on openstack.
#!/bin/bash
sudo apt-get update -y
sudo apt-get install ruby1.9.1-full
sudo update-alternatives --set ruby /usr/bin/ruby1.9.1
sudo mv /usr/bin/gem /usr/bin/gem.old
sudo update-alternatives --set gem /usr/bin/gem1.9.1
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.8-1.ubuntu.12.04_amd64.deb
__author__ = 'keyz'
import zmq
import sys
import random
PROXY_ADDRESS = "tcp://localhost:5559"
def main():
context = zmq.Context()
print "Connecting to server..."
@keyz182
keyz182 / gist:7962484
Last active December 31, 2015 08:49
Make a timelaspe video at 15x speed from a normal video.
#!/bin/bash
mkdir frames
ffmpeg -i in.flv -f image2 -vf fps=fps=2 frames/%05d.png
ffmpeg -f image2 -i frames/%05d.png -i timelapse.mp3 -map 0 -map 1 -acodec copy -shortest -vcodec libx264 -r 30 out.mp4
rm frames/*
rmdir frames
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
console.log('file system retrieved.');
fs = fileSystem;
var dir = fs.root.getDirectory('tiles', null, function (directory) {
var absoluteCDVFileName = directory.toURL() + '/' + localFileName;
var name = 'test.mbtiles';
mbTilesPlugin.open({name: name, url: absoluteCDVFileName, type: type}, success, fail);
}, fail);
},fail);
var totalProgress = 0;
var localFileName = 'test.sqlite';
var remoteFile = "http://www.example.com/test.sqlite"
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
console.log('file system retrieved.');
fs = fileSystem;
//Not exclusive, so success on create or open
@keyz182
keyz182 / minecraft.sh
Last active August 29, 2015 14:04
Minecraft init script
#!/bin/bash
### BEGIN INIT INFO
# Provides: minecraft
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6