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/env node | |
// Bardzo^3 prosty CURL-like | |
// Wywołanie: | |
// node requesturl.js adres_strony_bez_http | |
// np.: | |
// node requesturl.js wileczeknet.blogspot.com | |
// Wersja 2 | |
// - zastąpiono klasyczną obsługę parametrów linii polecenia funkcjonalnością dostarczaną |
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
' Latająca małpa - demo | |
' Program prezentujący podstawowe operacje związane z wyświetlaniem | |
' znaków na standardowym alfanumerycznym wyświetlaczu LCD (16 znaków, 2 wiersze). | |
' Przeróbka programu z zajęć 25 kwietnia 2012 r. | |
$regfile = "attiny2313.dat" | |
$Crystal=4000000 | |
$hwstack=40 | |
$swstack=16 | |
$framesize=32 |
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/sh | |
# | |
# Uruchamia php5-cgi - na potrzeby nginx | |
# Położenie: | |
# /etc/network/if-up.d | |
# | |
#if [ "$IFACE" = "wlan1" ] ; then | |
if [ "$IFACE" = "eth0" ] ; then | |
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 3 -u www-data -- /usr/bin/php5-cgi |
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
<?php | |
echo date('D M j Y H:i:s \G\M\TO (T)'); | |
?> |
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/env node | |
var http = require("http"); | |
http.createServer(function(req, res) { | |
res.end(Date()); | |
}).listen(8081); | |
console.log("Usługa daty i czasu uruchomiona"); |
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 | |
for i in 0 1 2 3 4 5 6 7 8 9 | |
do | |
# Test nginx | |
ab -n 2000 -c 200 http://192.168.1.2/date_srv.php > tst-nginx-$i | |
# Test node.js | |
ab -n 2000 -c 200 http://192.168.1.2:8081/ > tst-node-$i | |
done |
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
$regfile = "attiny2313.dat" | |
$crystal = 4000000 | |
$hwstack = 40 | |
$swstack = 16 | |
$framesize = 32 | |
Config Portb = &B11111111 | |
Portb = &B00000000 | |
Portb.6 = 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
' 3 efekty świetlne na 8 LED-ów i mikrokontroler. | |
$regfile = "attiny2313.dat" | |
$crystal = 4000000 | |
$hwstack = 40 | |
$swstack = 16 | |
$framesize = 32 | |
' Poniższa dyrektywa musi być aktywna dla avrdude, stk500.exe oraz AVRStudio; | |
' Programator USBASP z poziomu Bascoma wymaga binarnego wsadu do EEPROM (domyślnie) |
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
' Obsługa pamięci EEPROM 24c04 | |
' - przykład + efekty specjalne | |
$regfile = "attiny2313.dat" | |
$crystal = 4000000 | |
$hwstack = 40 | |
$swstack = 16 | |
$framesize = 32 | |
' Liczby wpisywane do pamięci w banku 0 i 1 (bit P0 adresu urządzenia) | |
Const Val_p0 = 220 |
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
' Obsługa pamięci EEPROM 24c04 i zegar czasu rzeczywistego PCF8583P | |
$regfile = "attiny2313.dat" | |
$crystal = 4000000 | |
$hwstack = 40 | |
$swstack = 16 | |
$framesize = 32 | |
' UWAGA: | |
' Fragment programu dotyczący komunikacji z pamięcią szeregową AT24C04C został | |
' usunięty ze względu na zbyt duży rozmiar kodu wynikowego (został przekroczony |