import socket import subprocess host = "172.18.0.1" port = 8888 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM | socket.SO_REUSEADDR) s.bind((host, port)) while 1: data, addr = s.recvfrom(1024) if data == ‘wakeonlan’: subprocess.call(["/usr/bin/wakeonlan", "-i", "192.168.178.20", "08:60:6e:6c:be:d8"])import socket import subprocess host = "172.18.0.1" port = 8888 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM | socket.SO_REUSEADDR) s.bind((host, port)) while 1: data, addr = s.recvfrom(1024)
Continue reading Python port listen
Category: PHP
Google Analytics API v4
Using OAuth 2.0 for Server to Server Applications The Google APIs Client Library for PHP supports using OAuth 2.0 for server-to-server interactions such as those between a web application and a Google service. For this scenario you need a service account, which is an account that belongs to your application instead of to an individual
Continue reading Google Analytics API v4
Scrapy: open source crawling and web scraping framework
Scrapy is a fast high-level web open source crawling and web scraping framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing. Requires Python 2.7 or Python 3.4+.
PHP7: backward incompatible changes
Changes to the handling of indirect variables, properties, and methods Indirect access to variables, properties, and methods will now be evaluated strictly in left-to-right order, as opposed to the previous mix of special cases. The table below shows how the order of evaluation has changed. Code that used the old right-to-left evaluation order must be
Continue reading PHP7: backward incompatible changes
PHP: find extension directory
You can find the location by calling: php -r ‘echo ini_get("extension_dir")."\n";’php -r ‘echo ini_get("extension_dir")."\n";’