This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// defines for all commands and the max length of spi messages | |
#define CHIPERASE "\xc7\x94\x80\x9a" | |
#define SPILENGTH 32 | |
// array to receive data | |
unsigned char spi_rxdata[SPILENGTH]; | |
// transfer a byte on spi | |
static unsigned char spi_transfer (unsigned char c) { | |
SPDR = c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import yate | |
import cgi | |
import os | |
form = cgi.FieldStorage() | |
item = form["filename"] | |
message = 'File uploaded' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>File upload</title> | |
</head> | |
<body> | |
<h1>File upload</h1> | |
<p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start_response(resp="text/html"): | |
return('Content-type: ' + resp + '\n\n') | |
def html_header(title="default"): | |
return(""" | |
<head> | |
<meta charset="utf-8" /> | |
<title>""" + title + """</title> | |
</head>""" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct fifo { | |
uint8_t size; /* size of buffer in bytes */ | |
uint8_t read; /* read pointer */ | |
uint8_t write; /* write pointer */ | |
unsigned char buffer[]; /* fifo ring buffer */ | |
}; | |
/* define a FIFO type for 'size' bytes */ | |
#define MK_FIFO(size) \ | |
struct fifo_ ## size { \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
THERM=$(cat $1) | |
CPU=$(cat /sys/class/thermal/thermal_zone0/temp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -r BLA | |
TEMP=$(echo $BLA | sed "s/.*\([0-9][0-9].[0-9][0-9][0-9]\)/\1/") | |
echo $TEMP | mail -s "Temperatur" $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
raspistill -t 100 -vf -hf -q 50 -o $(date +%Y-%m-%d-%T).jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// variable to en-/disable debug | |
// set to 1 to enable debug log | |
if (DEBUG === undefined) { | |
var DEBUG = 0; | |
} | |
// wrap all in anonymous function to get out of global scope | |
(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import cgi | |
import json | |
import re | |
import os | |
import hashlib | |
import base64 | |
import datetime |
OlderNewer