Linux Journal December 2016 by Linux Journal
Author:Linux Journal
Language: eng
Format: mobi, epub
Tags: Networking, Privacy, IPv6, Moon, Regular Expression, Bone-Conduction, Automate, Online, Android, Security, Shell, Python, Script, Automation, 6LoWPAN, Raspberry Pi, Machine-Learning, Bash, Trekz Titanium, Jupyter, Slack, Science, Headphones, Server, Orchestration, Docker, Browser, Puppet, SSH, MCollective, Linux, JuiceSSH, PHP
Publisher: Belltown Media
Published: 2016-11-20T08:00:00+00:00
Send comments or feedback via http://www.linuxjournal.com/contact or to [email protected].
COLUMNS
The Open-Source Classroom
SHAWN POWERS
The Family Dashboard in PHP
Tired of explaining how to log in over the phone? Make a dashboard!
I’ve written a little about PHP before, because I think it’s a great utility language for writing quick things you need to do. Plus, it allows you to use a web browser as your interface, and everyone has a web browser. That makes it very convenient for my family, because I can make simple web interfaces for the various things I normally have to do from the command line. (This is extremely useful when I’m gone to a conference and the Plex server needs to be rebooted, or any of a dozen other things need to be done that are hard to explain over the phone.)
My “Family Dashboard” will look different from yours, but the concept is pretty simple. PHP allows you to execute local functions on the server, and so as long as you can create a bash script that does what you need it to do, it can be launched from the “dashboard” you create for your family. Here’s a sample dashboard file I’ve created, so you can see how simple it is to create a custom page that does what you need it to do (see Figure 1 for a screenshot of the dashboard in action):
<html><head><title>My Dashboard</title></head>
<body>
<h3>You need to enter some commands and possibly options,
↳or just press a button:<br />
<button onclick="window.location='lj.php?command=weather&
↳option=houston'">Weather</button>
<button onclick="window.location='lj.php?command=bing'">Bing
↳Photo</button>
<button onclick="window.location='lj.php?command=uname'">Kernel
↳Name</button>
<button onclick="window.location='lj.php?command=time'">Unix
↳Time</button>
</h3>
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25286)
Hello! Python by Anthony Briggs(24338)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23432)
Kotlin in Action by Dmitry Jemerov(22511)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21974)
Dependency Injection in .NET by Mark Seemann(21845)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20710)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19523)
Grails in Action by Glen Smith Peter Ledbrook(18605)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17033)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15843)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13690)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11853)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11151)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10621)
Hit Refresh by Satya Nadella(9199)
The Kubernetes Operator Framework Book by Michael Dame(8570)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8400)
Robo-Advisor with Python by Aki Ranin(8360)