Skip to content

Instantly share code, notes, and snippets.

View raster's full-sized avatar

Pete Prodoehl raster

View GitHub Profile
@raster
raster / Drawbot.pde
Created January 19, 2011 17:43
Simple Drawbot code
/*
* Drawbot.pde
*
* See also: http://rasterweb.net/raster/2011/01/12/friday-night-drawbot/
* See also: https://gist.github.com/778622
*
*/
int servoPinL = 9;
int servoPinR = 10;
@raster
raster / ShiftBrite.pde
Created January 19, 2011 17:55
Arduino ShiftBrite code
/*
* ShiftBrite.pde
*
* See also: http://rasterweb.net/raster/2011/01/17/perl-arduino-shiftbrite/
* See also: http://code.google.com/p/shiftbritehughesyarduino/
*
*/
#include "HughesyShiftBrite.h"
@raster
raster / sendserial.pl
Created January 19, 2011 17:57
Send data to the serial port
#!/usr/bin/perl
#
# See also: http://rasterweb.net/raster/2011/01/17/perl-arduino-shiftbrite/
#
use Device::SerialPort;
my $port = Device::SerialPort->new("/dev/tty.usbmodem1d21"); # ymmv here...
$port->databits(8);
$port->baudrate(9600);
@raster
raster / LightOrgan.pde
Created January 19, 2011 18:32
A simple Arduino-based Light Organ controlled by Processing
/*
* LightOrgan.pde - Arduino
*
* See also: http://rasterweb.net/raster/2011/01/19/shiftbrite-light-organ/
*
*/
#include "HughesyShiftBrite.h"
HughesyShiftBrite sb;
@raster
raster / banner.pl
Created October 11, 2011 19:32
Perl Banner Program
#!/usr/bin/perl
use Text::Banner;
$str = $ARGV[0];
$size = $ARGV[1];
$char = $ARGV[2];
if (!(defined($size))) {
$size = '2';
@raster
raster / installed.pl
Created October 11, 2011 19:33
List Installed Perl Modules
#!/usr/bin/perl -w
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
@raster
raster / netisup.pl
Created October 11, 2011 19:35
Check if the Internet is available
#!/usr/bin/perl
use strict;
use warnings;
use Net::Ping;
my $host = shift || 'www.google.com';
my $wait = shift || 5;
my @states = map { "Internet is $_ " } qw/down up/;
@raster
raster / mencoder tricks
Created October 14, 2011 20:19
mencoder tricks
/Applications/ffmpegx/mencoder mf:///Users/pete/Desktop/webcam/*jpg -mf w=320:h=240:fps=6:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o ~/Desktop/output.avi
/Applications/ffmpegx/mencoder mf://*jpg -mf w=320:h=240:fps=12:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o ~/Desktop/output.avi
mencoder mf://*.jpg -mf w=320:h=240:fps=6:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi
@raster
raster / MySQL tricks
Created October 14, 2011 20:20
MySQL tricks
Login as someuser (type password at prompt):
mysql -u someuser -p
(To not be promted for the password, you would use 'mysql -u someuser -ppassword')
Load a database from a dump file:
mysql -u someuser -p dbname < somedatabase.mysql
@raster
raster / SFTP Logging
Created November 30, 2011 18:44
Add to /etc/ssh/sshd_config
# the -l INFO provides logging of SFTP logins
Subsystem sftp /usr/libexec/sftp-server -l INFO