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
@keyz182
keyz182 / designer.html
Last active July 12, 2016 20:27
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../google-map/google-map-search.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
@keyz182
keyz182 / Configuration.h
Last active March 19, 2017 15:37
wanhao-di3-prometheus-v2
/*
This file is part of Repetier-Firmware.
Repetier-Firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Repetier-Firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
# generated by Slic3r 1.2.9 on Sun Apr 2 20:25:14 2017
[filament:My Settings]
bed_temperature = 0
bridge_fan_speed = 100
cooling = 1
disable_fan_first_layers = 3
extrusion_multiplier = 2.5
fan_always_on = 0
fan_below_layer_time = 60