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
import struct | |
import sys | |
import socket | |
import platform | |
from struct import * | |
from struct import unpack | |
from contextlib import contextmanager | |
import pymysql | |
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
CREATE TABLE `client_info` ( | |
`source_ip` varchar(15) NOT NULL, | |
`source_port` int(11) NOT NULL, | |
`ttl_value` int(11) NOT NULL, | |
`updated_time` timestamp NOT NULL DEFAULT current_timestamp() | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
CREATE TABLE `provider_info` ( | |
`id` int(11) UNSIGNED NOT NULL, |
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 | |
sleep(1); // This is to make sure that the python script have finished committing the records in the table. | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
// Connection checking: | |
$con = mysqli_connect('', '', '', ''); | |
if (!$con) | |
{ | |
echo "<h2>MySQL Error!</h2>"; |
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
import struct | |
import sys | |
import socket | |
import platform | |
from struct import * | |
from struct import unpack | |
from contextlib import contextmanager | |
import pymysql | |