Skip to content

Instantly share code, notes, and snippets.

@jideji
jideji / dmesg.sh
Created November 2, 2013 15:43
dmesg on raspberry pi
pi@raspberrypi ~/hack $ dmesg
...
[ 23.603277] usb 1-1.2: new low-speed USB device number 5 using dwc_otg
[ 23.710086] usb 1-1.2: New USB device found, idVendor=1130, idProduct=0002
[ 23.710116] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
...
@jideji
jideji / pybuddy.lib.py
Last active December 27, 2015 06:18
pybuddy.lib extract
### iBuddy Device Class
class iBuddyDevice:
USB_VENDOR = 0x1130
USB_PRODUCT = int(0x0001) # <-- change this
BATTERY = 0
SETUP = (0x22, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00)
MESS = (0x55, 0x53, 0x42, 0x43, 0x00, 0x40, 0x02)
@jideji
jideji / mci-ibuddy.sh
Last active December 27, 2015 06:09
Create an mci alias for ibuddy.sh
alias mci='$HOME/scripts/ibuddy.sh mvn clean install'
@jideji
jideji / ibuddy.sh
Last active December 27, 2015 06:08
i-buddy script for indicating whether a shell command was successful.
#!/bin/bash
function send_commands() {
for command in $*; do
echo 1 > /proc/driver/ibuddy/0/$command
done
}
function send_multiple_times() {
for f in $(seq 1 $2); do
@jideji
jideji / ExampleTest.java
Last active December 15, 2015 02:19
Example of how Shazamcrest is used.
/*
* Copyright 2013 Shazam Entertainment Limited
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
package com.shazam.shazamcrest;