Sunday, 23 July 2017

What is a MAC Address?

What is a MAC Address?

Whether you work in a wired network office or a wireless one, one thing is common for both environments: It takes both network software and hardware (cables, routers, etc.) to transfer data from your computer to another—or from a computer thousands of miles away to yours.
And in the end, to get the data you want right to YOU, it comes down to addresses.
So not surprisingly, along with an IP address (which is networks software), there's also a hardware address. Typically it is tied to a key connection device in your computer called the network interface card, or NIC. The NIC is essentially a computer circuit card that makes it possible for your computer to connect to a network.
An NIC turns data into an electrical signal that can be transmitted over the network.

how to get operating system And Browser information Using PHP


how to get operating system And Browser information Using PHP code..

<?PHP
class OS_BR{

    private $agent = "";
    private $info = array();

    function __construct(){
        $this->agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : NULL;
        $this->get_Browser();
        $this->getOS();
    }

    function get_Browser(){
        $browser = array("Navigator"            => "/Navigator(.*)/i",
                         "Firefox"              => "/Firefox(.*)/i",
                         "Internet Explorer"    => "/MSIE(.*)/i",
                         "Google Chrome"        => "/chrome(.*)/i",
                         "MAXTHON"              => "/MAXTHON(.*)/i",
                         "Opera"                => "/Opera(.*)/i",
                         );
        foreach($browser as $key => $value){
            if(preg_match($value, $this->agent)){
                $this->info = array_merge($this->info,array("Browser" => $key));
                $this->info = array_merge($this->info,array(
                  "Version" => $this->getVersion($key, $value, $this->agent)));
                break;
            }else{
                $this->info = array_merge($this->info,array("Browser" => "UnKnown"));
                $this->info = array_merge($this->info,array("Version" => "UnKnown"));
            }
        }
        return $this->info['Browser'];
    }

    function getOS(){
        $OS = array("Windows"   =>   "/Windows/i",
                    "Linux"     =>   "/Linux/i",
                    "Unix"      =>   "/Unix/i",
                    "Mac"       =>   "/Mac/i"
                    );

        foreach($OS as $key => $value){
            if(preg_match($value, $this->agent)){
                $this->info = array_merge($this->info,array("Operating System" => $key));
                break;
            }
        }
        return $this->info['Operating System'];
    }

    function getVersion($browser, $search, $string){
        $browser = $this->info['Browser'];
        $version = "";
        $browser = strtolower($browser);
        preg_match_all($search,$string,$match);
        switch($browser){
            case "firefox": $version = str_replace("/","",$match[1][0]);
            break;

            case "internet explorer": $version = substr($match[1][0],0,4);
            break;

            case "opera": $version = str_replace("/","",substr($match[1][0],0,5));
            break;

            case "navigator": $version = substr($match[1][0],1,7);
            break;

            case "maxthon": $version = str_replace(")","",$match[1][0]);
            break;

            case "google chrome": $version = substr($match[1][0],1,10);
        }
        return $version;
    }

    function show_Info($switch){
        $switch = strtolower($switch);
        switch($switch){
            case "browser": return $this->info['Browser'];
            break;

            case "os": return $this->info['Operating System'];
            break;

            case "version": return $this->info['Version'];
            break;

            case "all" : return array($this->info["Version"], 
              $this->info['Operating System'], $this->info['Browser']);
            break;

            default: return "Unkonw";
            break;

        }
    }
}

// using
// create an new instant of OS_BR class
$obj = new OS_BR();
// // if you want to show one by one information then try show_Info() function

// get browser
echo $obj->show_Info('browser');

// get browser version
echo $obj->show_Info('version');

// get Operating system
echo $obj->show_Info('os');

// get all information and it returns an array
echo "<pre>".print_r($obj->show_Info("all"),true)."</pre>";
?>  


- MAC+tech

Friday, 21 July 2017

Removing a virus without using any anti-virus software

Virus is a computer program that can copy itself and infect computers.
The term "virus" is erroneously used to refer to other types of malware, including adware and spyware programs that do not have the reproductive ability.
A true virus can spread from one computer to another (in some form of executable code).
One of the ways by which a virus can infect your PC is through USB/Flash drives.
Common viruses such as 'Ravmon' , 'New Folder.exe', 'Orkut is banned' are spreading through USB drive .
Most anti virus programs are unable to detect them and even if they do, in most cases they are unable
to delete the file, only quarantine it.So in our post we use command prompt to remove harmful files that
any anti-virus can't.

create and activate a Python virtual environment on macOS and Windows

create and activate a Python virtual environment on macOS and Windows: Prerequisites: Python 3: Ensure you have Python 3 installed. You ca...