Skip to content

Instantly share code, notes, and snippets.

@priyank
priyank / spidev_test.c
Created September 21, 2012 03:46
SPI Test Program in C
/*
* SPI testing utility (using spidev driver)
*
* Copyright (c) 2007 MontaVista Software, Inc.
* Copyright (c) 2007 Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program 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 2 of the License.
*
@priyank
priyank / opencv.sh
Created September 20, 2012 15:22
Script to install OpenCV on Raspberry Pi
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -q -y update
sudo apt-get -q -y install build-essential
sudo apt-get -q -y install cmake
sudo apt-get -q -y install pkg-config
sudo apt-get -q -y install libpng12-0 libpng12-dev libpng++-dev libpng3
sudo apt-get -q -y install libpnglite-dev libpngwriter0-dev libpngwriter0c2
sudo apt-get -q -y install zlib1g-dbg zlib1g zlib1g-dev
sudo apt-get -q -y install pngtools libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools
sudo apt-get -q -y install libjpeg8 libjpeg8-dev libjpeg8-dbg libjpeg-progs
@priyank
priyank / blink.py
Created September 20, 2012 09:53
A sample Python program to test the GPIO library
@priyank
priyank / blink.c
Created September 20, 2012 09:39
A sample C program to test the wiringPi library
@priyank
priyank / tightvncserver
Created September 20, 2012 08:37
To auto start the VNCServer at every boot.
# First configure the user you want to run this under - this will generally be pi, unless you've created your own users
export USER='pi'
eval cd ~$USER
# Check the state of the command - this'll either be start or stop
case "$1" in
start)
# if it's start, then start vncserver using the details below
su $USER -c '/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565'
@priyank
priyank / raspi-motd.sh
Created September 20, 2012 07:17
Script for setting a nice raspberry pi logo as MOTD on debian.
#!/bin/bash
logo=" $(tput setaf 2)
.~~. .~~.
'. \ ' ' / .'$(tput setaf 1)
.~ .~~~..~. $(tput sgr0) _ _ $(tput setaf 1)
: .~.'~'.~. : $(tput sgr0) ___ ___ ___ ___| |_ ___ ___ ___ _ _ ___|_|$(tput setaf 1)
~ ( ) ( ) ~ $(tput sgr0) | _| .'|_ -| . | . | -_| _| _| | | | . | |$(tput setaf 1)
( : '~'.~.'~' : ) $(tput sgr0) |_| |__,|___| _|___|___|_| |_| |_ | | _|_|$(tput setaf 1)
~ .~ ( ) ~. ~ $(tput sgr0) |_| |___| |_| $(tput setaf 1)