-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html> | ||
<head> | ||
<title>Welcome</title> | ||
<body> | ||
<p>Test filezilla update: success</p> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<html> | ||
|
||
<head> | ||
<title>HelloW</title> | ||
</head> | ||
<body> | ||
|
||
<?php | ||
|
||
echo "saving file..."; | ||
|
||
$_id = $_GET["id"]; | ||
$_time = $_GET["time"]; | ||
$_data = $_GET["data"]; | ||
|
||
echo "id equals $_id \n"; | ||
echo "time equals $_time \n"; | ||
echo "data equals $_data \n"; | ||
echo getcwd(); | ||
|
||
|
||
|
||
if ( $fl = fopen('logs.txt','a')) { | ||
fwrite($fl,"\"data\": { \"id\" : \"". $_id . "\", " | ||
.\"time\" : \"". $_time . "\", " | ||
."\"data\" :\"" . $_data . "\" }\n" ); | ||
fclose($fl); | ||
} | ||
|
||
/* | ||
$myfile = fopen("C:\\Users\\romak\\Desktop\\CS\\Zilla downloads\\newfile.txt", "a") or die("Unable to open file!"); | ||
$txt = "Minnie Mouse\n"; | ||
fwrite($myfile, $txt); | ||
fclose($myfile); | ||
*/ | ||
echo " complete"; | ||
?> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|1|XASLdPCoqMDV1fFX3nwDqehvOdg=|520r4KhXOWrgupiq4+i0Mgse3Mw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBASuP4YhZ92KVvTct8oy+Or6OXKL8hfAktgXkhjTb+GyuuYCla2BlgbfMIYBi348Zz9TC8HBeDRO3wXWKS4bh/0= | ||
|1|Awy3bum4iPR5rXZKYx7yKeiQxtM=|2fDX9GPAzvwVcpUwqQ1LamDHeEc= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBASuP4YhZ92KVvTct8oy+Or6OXKL8hfAktgXkhjTb+GyuuYCla2BlgbfMIYBi348Zz9TC8HBeDRO3wXWKS4bh/0= |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html><body> | ||
<?php | ||
$user = "muntean"; | ||
require '/var/composer/vendor/autoload.php'; | ||
$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017"); | ||
$collection = new MongoDB\Collection($manager, $user, 'testData'); | ||
$filter = []; | ||
$options = []; | ||
$query = new MongoDB\Driver\Query($filter, $options); | ||
$cursor = $manager->executeQuery("$user.testData", $query); | ||
print("The contents of the collection $user.testData are:"); | ||
print_r($cursor->toArray()); | ||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<html><body> | ||
<?php | ||
$user = "muntean"; | ||
require '/var/composer/vendor/autoload.php'; | ||
$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017"); | ||
$collection = new MongoDB\Collection($manager, $user, 'testData'); | ||
$ts = new MongoDB\BSON\Timestamp(0,0); | ||
# Get JSON as a string | ||
if ($_SERVER['REQUEST_METHOD'] === 'POST') { | ||
var_dump($_POST); | ||
$json_str = $_POST['json']; | ||
} | ||
else if ($_SERVER['REQUEST_METHOD'] === 'GET') { | ||
$json_str = $_GET['json']; | ||
} | ||
else { | ||
$json_str = file_get_contents('php://input'); | ||
} | ||
# Decode | ||
$json_obj = json_decode($json_str, true); | ||
print(json_last_error()); | ||
print("Request: "); | ||
print_r($json_str); | ||
print("<br>Array: "); | ||
var_dump($json_obj); | ||
print("<br>"); | ||
$myfile = file_put_contents('logs.txt', $json_str.PHP_EOL , FILE_APPEND | LOCK_EX); | ||
try { | ||
$collection->insertOne($json_obj); | ||
} catch (\Exception $e) { | ||
print("Insert failed."); | ||
print_r($e); | ||
exit(); | ||
} | ||
$filter = []; | ||
$options = []; | ||
$query = new MongoDB\Driver\Query($filter, $options); | ||
$cursor = $manager->executeQuery("$user.testData", $query); | ||
print("The contents of the collection $user.testData are:"); | ||
print_r($cursor->toArray()); | ||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from network import Sigfox | ||
import socket | ||
import ubinascii | ||
|
||
print("SiPy test program.\n") | ||
| ||
# init Sigfox for RCZ1 (Europe) | ||
sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1) | ||
|
||
s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW) | ||
|
||
# make the socket blocking | ||
s.setblocking(True) | ||
|
||
# configure it as uplink only | ||
s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) | ||
|
||
# send some bytes | ||
msg="ABCD" | ||
print("Sending message") | ||
print(msg) | ||
s.send(msg) | ||
print("sent.\n") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<html> | ||
<head> | ||
<title>Demonstrateur SigFox</title> | ||
</head> | ||
<body> | ||
<?php | ||
$_id = $_GET["id"]; | ||
$_time = $_GET["time"]; | ||
#$_signal = $_GET["signal"]; | ||
#$_station = $_GET["station"]; | ||
#$_lat = $_GET["lat"]; | ||
#$_lng = $_GET["lng"]; | ||
$_data = $_GET["data"]; | ||
|
||
echo hex2bin ($_data); #echoes nothing | ||
echo hex2bin ("$_data"); #echoes nothing | ||
echo hex2bin("39715100"); #echoes 9qQ | ||
echo ("shouldBE"); | ||
|
||
if ( $fl = fopen('logs.txt','a')) { | ||
fwrite($fl,"\"msg\": { \"id\" : \"". $_time . "\", " | ||
."\"data\" :\"" . $_data . "\" }\n" ); | ||
fclose($fl); | ||
} | ||
?> | ||
</body> | ||
</html> |