Python port listen

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

Raspberry PI : install PHP, apache and Git

# Install packages sudo apt-get install apache2 php5 php5-mysql libapache2-mod-php5 mysql-server git-core -y   # Setup user for MySQL mysql -u root -p CREATE DATABASE db; USE db; CREATE USER ‘user’@’localhost’ IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON db.* TO ‘user’@’localhost’; FLUSH PRIVILEGES; quit# Install packages sudo apt-get install apache2 php5 php5-mysql libapache2-mod-php5 mysql-server git-core
Continue reading Raspberry PI : install PHP, apache and Git