Skip to content

Instantly share code, notes, and snippets.

View raster's full-sized avatar

Pete Prodoehl raster

View GitHub Profile
@raster
raster / Configuration.h
Created September 5, 2012 13:57
Marlin config
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
// This configurtion file contains the basic settings.
// Advanced settings can be found in Configuration_adv.h
// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
//User specified version info of THIS file to display in [Pronterface, etc] terminal window during startup.
//Implementation of an idea by Prof Braino to inform user that any changes made
//to THIS file by the user have been successfully uploaded into firmware.
@raster
raster / DrawCircles
Created August 8, 2012 18:14
Processing sketch that draws circles
/*
* DrawCircles
*
*/
import processing.opengl.*;
void setup() {
size(screen.width, screen.height, OPENGL);
frameRate(120);
@raster
raster / G-code for RepRap
Created June 27, 2012 18:46
G-code for RepRap
; Start G-code
G28 ; home all axes
; End G-code
G1 X12.0 F4000 ; home (almost) x
G1 Y170 F4000 ; move the print to the front.
M104 S0 ; make sure the extruder is turned off.
M140 S0 ; make sure the bed is turned off.
M84 ; shut down motors.
@raster
raster / TeensyTwoButtons.ino
Last active October 5, 2015 05:58
Simple two button control with a Teensy #3
/*
* Button.pde
*
* Created in collaboration with Basti Böhm
*
*/
void setup() {
Serial.begin(9600);
pinMode(10, INPUT_PULLUP);
@raster
raster / TeensyTwoButtons2.ino
Last active October 4, 2015 21:58
Simple two button control with a Teensy #2
/*
* TeensyTwoButtons.pde
*
* You must select Keyboard from the "Tools > USB Type" menu
*
* Download and install the Bounce library: http://www.pjrc.com/teensy/td_libs_Bounce.html
*
*/
#include <Bounce.h>
@raster
raster / TeensyTwoButtons.ino
Last active October 4, 2015 14:08
Simple two button control with a Teensy
/*
* TeensyTwoButtons.pde
*
* You must select Keyboard from the "Tools > USB Type" menu
*
* Download and install the Bounce library: http://www.pjrc.com/teensy/td_libs_Bounce.html
*
*/
#include <Bounce.h>
@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
@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 / 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 / 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/;