Skip to content

Instantly share code, notes, and snippets.

@stetro
stetro / printrbotsimple.ini
Last active August 29, 2015 14:06
My Printrbot Simple Configuration
# generated by Slic3r 1.1.7 on Fri Oct 17 20:03:23 2014
[filament:Simple]
bed_temperature = 0
bridge_fan_speed = 100
cooling = 0
disable_fan_first_layers = 1
extrusion_multiplier = 1
fan_always_on = 1
fan_below_layer_time = 60
@stetro
stetro / wirelessPlug.c
Created May 27, 2015 21:00
First try of wireless power plug reverse engineering with xy-mk-5v
int digiPin = 52;
void setup() {
// put your setup code here, to run once:
pinMode(digiPin, OUTPUT);
}
void zero(){
delayMicroseconds(650);
@stetro
stetro / AVC1.m
Last active August 29, 2015 14:23
Practical Exercise 1 Audio and Video Coding (AVC)
% 2. Vertical Grey-Scale
gradient = linspace(0.0, 199, 256);
matrix = repmat(gradient, [200 1]);
I8 = uint8(matrix);
I6 = uint8(matrix/8);
I4 = uint8(matrix/16);
I2 = uint8(matrix/32);
img = horzcat(mat2gray(I8), mat2gray(I6), mat2gray(I4), mat2gray(I2));
f = figure(1);
h = imshow(img);
@stetro
stetro / Main.java
Created June 20, 2015 15:39
Jena Reasoning
package de.fhkoeln.stetro.reasoning;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.reasoner.Reasoner;
import com.hp.hpl.jena.reasoner.ReasonerRegistry;
import com.hp.hpl.jena.reasoner.ValidityReport;
import com.hp.hpl.jena.util.FileManager;
import com.hp.hpl.jena.vocabulary.RDFS;
@stetro
stetro / ipcheck.sh
Created April 16, 2012 18:13
IP Checker
for i in "139.6.57.1" "139.6.57.8" "139.6.57.11" "139.6.57.63" "139.6.57.66"
do
ping -c 1 $i > /dev/null
if [ $? == 0 ]
then
echo "$i is online : $i"
else
echo "$i is offline : $i"
fi
done
@stetro
stetro / calculator.c
Created April 27, 2012 07:08
C Parameter Taschenrechner
#include<stdio.h>
#include<stdlib.h>
int main(int argc, char* argv[])
{
int i=0; // Laufvariable fuer alle Parameter
long int solution; // Ergebnisvariable
char op; // aktueller Operand
// Wenn keine Parameter angegeben sind
@stetro
stetro / env.c
Created April 27, 2012 07:09
C Umgebungsvariablen auslesen, erstellen und ändern
#include<stdio.h>
#include<stdlib.h>
// #include<unistd.h> (char ** environ) (alternative zu char*envp[])
int main(int argc, char* argv[],char *envp[])
{
char * variable; // Definierte Variable
int i = 0; // Laufvariable
// Gib alle Variablen aus wenn keine Parameter gegeben sind
@stetro
stetro / pipe.c
Created April 27, 2012 07:12
C Pipe zwischen 2 Programmen erstellen und beide Programme aufrufen
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#define PARAM_ERROR "Falsche Angabe von Parametern !\n"
#define FORK_ERROR "Kinprozess konnte nicht erzeugt wernden !\n"
#define PIPE_ERROR "Pipe konnte nicht erzeugt werden !\n"
#define DUP2_ERROR "IO-Stream konnte nicht dupliziert werden !\n"
/*
@stetro
stetro / forks.c
Created April 27, 2012 07:10
C Prozesse Erzeugen und Ausgaben generieren
#include<stdio.h>
#include<stdlib.h>
#define PROCESS 3
#define LOOP 20
// Prozessinstruktionen
void run_process(int i);
@stetro
stetro / fifo.c
Created April 27, 2012 07:16
C Benannte Pipe Erstellen und Client/Server Applikation
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<errno.h>
#define FIFO_NAME "fifo"
#define ARGUMENT_ERROR "a.out < s/r >\n"