Skip to content

Instantly share code, notes, and snippets.

View irfanhussain22's full-sized avatar

irfanhussain22

View GitHub Profile
import struct
import sys
import socket
import platform
from struct import *
from struct import unpack
from contextlib import contextmanager
import pymysql
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,
<?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>";
import struct
import sys
import socket
import platform
from struct import *
from struct import unpack
from contextlib import contextmanager
import pymysql