Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
romakarol authored Mar 26, 2019
1 parent eb710e5 commit f72c793
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 0 deletions.
Binary file added FRUIT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added InterimReportRomanMuntean.rtf
Binary file not shown.
7 changes: 7 additions & 0 deletions index.html
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>
40 changes: 40 additions & 0 deletions index.php
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>
2 changes: 2 additions & 0 deletions known_hosts
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=
13 changes: 13 additions & 0 deletions list.php
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());
?>
Binary file added phplog.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added puttyDEBUGphp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions record.php
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());
?>
Binary file added scumficcacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added serverdetails.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions sigfoxMessage.py
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")
27 changes: 27 additions & 0 deletions test.php
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>

0 comments on commit f72c793

Please sign in to comment.