Melksham Chamber of Commerce and Industry
Lisa and Graham served on the executive committee of the Chamber of Commerce from 2000 to 2017

Home Accessibility Melksham Diary The Mouth Wessex Chambers Resources Find Us About Us Contact
 
Python, Lua, Tcl, C and C++ training - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, Ruby, MySQL and Linux / Tomcat systems
 
Changing a screen saver from a web page (PHP, Perl, OSX)

Here's a challenge. I want to change the screen saver on a mac mini, running OSX, from a browser anywhere in the world.

You may well ask why ... the screen of the mac mini is to be visible at Well House Manor where it will provide an information screen at the front door when it's not otherwise in use, and we want it to say things like "Sorry - no Vacancies" and "Welcome to the Chamber of Commerce"

Frontg Door status on the WebTask achieved! Using PHP ... and Perl ... and Web2 technology. With a smattering of OSX!

Here's the control widget on our web page ... the page is in PHP and this particular widget is only displayed to staff members who are logged in - if you look at our Staff Resources Page you won't see it.

And the PHP that's run when you press the update button:


if ($_POST[door] == 12) { // Door Status changed
  $ds = $_POST[doorst];
  $fho = fopen("door.txt","w");
  fputs ($fho,stripslashes($ds)."\n");
  fclose ($fho); // Host and Port changed for security
  $done = file("http://zzz.wellho.net:8080/cgi-bin/dodo.pl?$ds");
  }


That piece of viewing software was called a controller on the Mac - which is running as a Web Server on a port enabled on our firewall, and redirected with NATS to the Mac Mini.

The Perl software dodo.pl looks like this:

#!/usr/bin/perl
print "content-type: text/html\n\n";
print "Changing Page";
`rm -rf /Users/lisaellis/FrontDoor`;
`cp -r /Users/lisaellis/$ENV{QUERY_STRING} /Users/lisaellis/FrontDoor`;
open (FH,"ps aux|");
while (<FH>) {
  if (/ScreenSaverEngine/) {
  @n = split;
  kill 9,$n[1];
  print "$n[1]<br>";
  }
}
sleep 1;
open (FH,'|/System/Library/Frameworks/ScreenSaver.framework/Versions'.
'/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine' );
close FH;
print "Changing Page";


And there's also a standalone version here if you want to download a copy for your own use.

You'll notice - typical use of PHP to front a web application, typical use of Perl as "glueware", and typical use of a Unix / Linux / OSX utility - in this case Mac's ScreenSaverEngine - to do the oddball job we needed.
(written 2008-05-06, updated 2008-05-07)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
A164 - Web Application Deployment - Services and Regular Jobs
  [4487] Starting MySQL. ERROR! The server quit without updating PID file - how we fixed it. - (2015-05-06)
  [3792] Managing daemons from a terminal session - (2012-07-01)
  [3791] The Kernel, Shells and Daemons. Greek Gods in computing - (2012-07-01)
  [3143] On time - (2011-01-23)
  [3011] What are .pid files? - (2010-10-23)
  [2182] What Linux run level am I in? - (2009-05-15)
  [2145] Using the internet to remotely check for power failure at home (PHP) - (2009-04-29)
  [1903] daemons - what is running on my Linux server? - (2008-11-23)
  [1765] Dialects of English and Unix - (2008-08-21)
  [1733] memcached - overview, installation, example of use in PHP - (2008-08-02)
  [1731] Apache httpd, MySQL, PHP - installation procedure - (2008-08-01)
  [1700] FTP server on Fedora Linux - (2008-07-06)
  [1553] Automatic startup and shutdown of Tomcat - (2008-02-24)
  [1288] Linux run states, shell special commands, and directory structures - (2007-08-03)
  [1028] Linux / Unix - process priority and nice - (2007-01-10)
  [907] Browser -> httpd -> Tomcat -> MySQL. Restarting. - (2006-10-28)
  [544] Repeating tasks with crontab - (2005-12-27)

H307 - PHP - Web2 and caching
  [4627] Caching results in an object for efficiency - avoiding re-calculation - (2016-01-20)
  [4136] How do I post automatically from a PHP script to my Twitter account? - (2013-07-10)
  [4106] Web server efficiency - saving repetition through caches - (2013-05-30)
  [4075] Further recent PHP examples - (2013-04-28)
  [4055] Using web services to access you data - JSON and RESTful services - (2013-03-29)
  [3999] Handling failures / absences of your backend server nicely - (2013-02-08)
  [3955] Building up from a small PHP setup to an enterprise one - (2012-12-16)
  [3458] On this day ... one PHP script with three uses - (2011-09-26)
  [3186] How to add a customised twitter feed to your site - (2011-02-27)
  [3094] Setting your user_agent in PHP - telling back servers who you are - (2010-12-18)
  [3029] PHP data sources - other web servers, large data flows, and the client (browser) - (2010-11-04)
  [2545] Scraping content for your own page via PHP - (2009-12-21)
  [2321] Uploading and Downloading files - changing names (Perl and PHP) - (2009-08-04)
  [2196] New Example - cacheing results in PHP for faster loading - (2009-05-24)
  [1995] Automated server heartbeat and health check - (2009-01-16)
  [1926] Flash (client) to PHP (server) - example - (2008-12-06)
  [1814] Javascript/HTML example, dynamic server monitor - (2008-09-28)
  [1813] Ajax - going Asyncronous and what it means - (2008-09-28)
  [1812] Starting Ajax - easy example of browser calling up server data - (2008-09-27)
  [1647] Exchange Rates - PHP with your prices in your users currency - (2008-05-19)

P258 - Perl - Solaris, OSX and Linux
  [2834] Teaching examples in Perl - third and final part - (2010-06-27)
  [2022] Pre and post increment - the ++ operator - (2009-02-03)
  [1702] Running operating system commands in Perl - (2008-07-08)

Z402 - Melksham Chamber of Commerce and Industry
  [4738] Melksham Chamber of Commerce - my final Presidents report - (2017-05-10)
  [4672] Annual review of Melksham Matters for Chamber of Commerce AGM - (2016-05-15)
  [4399] The Campus in Melksham - name, logo, and livery choice - (2015-01-18)
  [4278] Future Swindon - Westbury train services. At current level into the future? - (2014-05-25)
  [4170] Herman Miller coming to Melksham - the Chamber of Commerce is briefed - (2013-09-10)
  [4164] Melksham Market - every Tuesday - (2013-09-03)
  [4151] Tell me a bit about Melksham - (2013-08-10)
  [4103] Questions from children about Melksham Campus - (2013-05-26)
  [4097] Melksham Chamber of Commerce - Report for AGM, 21st May 2013 - (2013-05-21)
  [4046] Over a hundred welcoming businesses - Melksham Town Centre - (2013-03-17)
  [4041] Report on the last year - Melksham Chamber of Commerce and Industry for Melksham Without Parish Council - (2013-03-11)
  [4014] Costa Coffee in Melksham - is it a good idea? - (2013-02-22)
  [4002] Images of Melksham you havent seen before - (2013-02-13)
  [3987] Melksham Chamber of Commerce - join us in our future - (2013-01-21)
  [3948] Quiet little town? Advanced Technology Centre? - (2012-12-08)
  [3889] Melksham Chamber of Commerce - whence in 2013 and beyond? - (2012-10-12)
  [3880] Chamber of Commerce - looking forward in Melksham and in Wessex - (2012-10-04)
  [3867] The difficult interface between the business, council and voluntary sectors - (2012-09-19)
  [3850] Bus times - Chippenham Station to Melksham, with London connections - (2012-08-25)
  [3818] Making things happen - litter and ASB and lost dogs in Melksham - (2012-07-25)
  [3812] The Melksham News - July 2012 - Part 1, Campus and Chamber of Commerce - (2012-07-22)
  [3787] Melksham Pride - the Chamber of Commerce, and the future - (2012-06-29)
  [3768] Melksham Chamber of Commerce - looking to our future shape. Pivotal meeting next Tuesday - (2012-06-19)
  [3767] How well do you know Melksham? - (2012-06-17)
  [3752] Melksham Visitors Map - Bus routes and train lines to and from the town - (2012-06-04)
  [3751] Public transport for international arrivals into Melksham - (2012-06-04)
  [3748] Not everyone has a computer - 9 more ways to learn about the Melksham Campus - (2012-06-03)
  [3739] Go green - business seminar in Melksham - (2012-05-21)
  [3732] Ten more visitors to your premises every day? - (2012-05-14)
  [3714] Just 12 winners? Or 371 or more? Town Centres. - (2012-04-30)
  [3710] Encouraging business in Melksham and its neighbourhood - keep business local?? - (2012-04-27)
  [3706] An exciting Chamber of Commerce AGM - sound like an Oxymoron? - (2012-04-25)
  [3700] Why do people use chains rather than independent traders? - (2012-04-18)
  [3697] Events in Melksham - read all about them, and tell us about yours - (2012-04-15)
  [3696] Melksham government and business organisations - (2012-04-14)
  [3693] Wiltshire Business Support Service - (2012-04-11)
  [3682] Melksham Business Newsreel - (2012-04-03)
  [3677] Some advise for guest speakers at meetings - (2012-03-31)
  [3672] Melksham Train Service - please support the TransWilts case for regular trains - (2012-03-25)
  [3663] Changing shops and organisations - Melksham, the last and next five years - (2012-03-21)
  [3627] Meeting Report - Tuesday 21st Feb - to Melksham Chamber of Commerce from Shadow Community Operations Board - (2012-02-27)
  [3598] Melksham Civic Awards - report and pictures - (2012-01-29)
  [3560] Melksham, Month by month through 2011 - (2011-12-23)
  [3527] Melksham - changing times, an opportunity for the future - (2011-11-23)
  [3496] Melksham - Business to Business Speed Networking - build ahead for 2012 - (2011-10-26)
  [3495] Looking forward - Chamber of Commerce has 2012 and beyond on the agenda - (2011-10-26)
  [3492] Upcoming events in and about Melksham - more dates for your diary - (2011-10-22)
  [3481] Some thoughts in answer to some Melksham Campus questions - (2011-10-14)
  [3475] Havant - Shop Frontages. - (2011-10-12)
  [3470] Currently pictured in Melksham - (2011-10-09)
  [3438] Melksham to become a part of Trowbridge? - (2011-09-13)
  [3427] What is on the Melksham Agenda? - (2011-09-09)
  [3423] 1 + 1 + 1 + 1 = 12? - (2011-09-07)
  [3420] Making best use of the new enthusiasm for Melksham - (2011-09-05)
  [3383] Are people who walk into Melksham being asked to subsidise parking? - (2011-08-09)
  [3380] Melksham Jelly - An Occasional Office for Home Workers - (2011-08-06)
  [3343] Summer Sunday Train Service Starts - Swindon Chippenham and Melksham to Weymouth - (2011-07-03)
  [3340] Summer Sunday Timetable - TransWilts Trains - (2011-06-30)
  [3334] A lesson from the sporran market? - (2011-06-25)
  [3325] The Olympic Torch, and Melksham House - (2011-06-14)
  [3307] Melksham Community Radio launches - (2011-05-28)
  [3299] Presidents Report to Melksham Chamber of Commerce, 24.5.2011 - (2011-05-24)
  [3279] Letter to The Editor - (2011-05-06)
  [3275] Melksham Chamber of Commerce - grows to appoint new Press Officer. Welcome. Sam - (2011-05-02)
  [3272] Melksham Car Parking - current charges and limits - (2011-05-01)
  [3249] Events - Spring and Early Summer 2011 in Melksham - (2011-04-17)
  [3246] Melksham - the way forward. 26th April, Well House Manor - (2011-04-13)
  [3217] Vandalism and riot from the minority - the effect - (2011-03-28)
  [3214] Melksham Campus - any last minute inputs from Melksham businesses? - (2011-03-26)
  [3193] Melksham Campus - what, why, questions, concerns and how you can input - (2011-03-04)
  [3188] What proportion of the British Workforce still works a Monday to Friday, 9 to 5, week? - (2011-03-01)
  [3173] What is the Melksham Chamber of Commerce? - (2011-02-18)
  [3172] On consultations, car parking, and Melksham town centre - (2011-02-17)
  [3162] Keep your business customer-friendly! - (2011-02-09)
  [3141] Wiltshire Rail services - a golden opportunity - (2011-01-21)
  [3117] Opportunities for Melksham - new businesses in the town - (2011-01-01)
  [3113] Trowbridge and Melksham to Chippenham - more roadworks, even slower journey over the winter - (2010-12-30)
  [3088] Melksham - two many councils? - (2010-12-16)
  [2995] A river in Melksham is not just for boaters. - (2010-10-11)
  [2982] Travel, Transport and Tourism - A vision for Melksham, 2026 - (2010-10-03)
  [2959] A Melksham news roundup - (2010-09-18)
  [2957] Welcome to Countrywides new Melksham store - (2010-09-15)
  [2932] Getting into and out of Wiltshire towns .. a.k.a. Car Parking? - (2010-08-23)
  [2891] Wiltshire Council ask how they can help businesses - (2010-07-27)
  [2883] Melksham Oak - photos of the new community school - (2010-07-22)
  [2872] Moved - Melksham Lorry Park - (2010-07-15)
  [2867] Cycling in Melksham, and looking forward - (2010-07-11)
  [2853] Transport in Wessex - today and into the future - (2010-07-04)
  [2837] Lorry Parking in Melksham - (2010-06-29)
  [2827] Melksham - a gem in Wiltshire - (2010-06-26)
  [2782] Tell the Melksham Chamber or you only have yourself to blame - (2010-05-26)
  [2779] The history and future of Melksham Chamber of Commerce - (2010-05-25)
  [2770] Melksham Chamber of Commerce - Presidents report to AGM - (2010-05-19)
  [2725] How do our tactics help us meet the strategy, for the greater good? - (2010-04-16)
  [2683] Car Parking in Melksham - (2010-03-18)
  [2666] Random thoughts on Melksham Town Planning and development - (2010-03-08)
  [2640] How is your tax pound spent? - (2010-02-18)
  [2594] Melksham Area - your community view is sought - (2010-01-23)
  [2568] Forums for your Melksham and open source discussions - (2010-01-09)
  [2546] How well do you know Melksham - a quiz for Christmas - (2009-12-21)
  [2544] Vision for Wiltshire - (2009-12-20)
  [2540] Rock and hard place .. and the relaxing right one won - (2009-12-18)
  [2531] Melksham - new Tuesday Market - (2009-12-09)
  [2521] Melksham Market - Tuesdays, 09:00 to 14:00 - (2009-12-01)
  [2514] The road show has been - where now? - (2009-11-27)
  [2508] Community Area Partnership - inaugural AGM - (2009-11-20)
  [2495] Planning the future of Wiltshire - (2009-11-07)
  [2487] Melksham Forum - (2009-11-01)
  [2465] Melksham Town - asleep or awake? - (2009-10-21)
  [2459] New Web Site for Melksham Chamber of Commerce - (2009-10-18)
  [2437] Wiltshire Unitary News - Chamber of Commerce Intelligence - (2009-10-04)
  [2328] Melksham - no trains, no southbound buses through the town - (2009-08-08)
  [2289] pre-Inaugural briefing - Melksham Community Area Partnership - (2009-07-15)
  [2288] Wiltshire Community Area Partnerships - (2009-07-15)
  [2260] Important - the future of Melksham / Chamber of Commerce - (2009-06-28)
  [2220] Melksham Traders - where do we go? - (2009-06-05)
  [2194] Melksham Business Map - Chamber of Commerce, Tourist Information and Town Council - (2009-05-21)
  [2181] You cannot please all of the people all of the time - (2009-05-14)
  [2119] Make your business a DESTINATION business - (2009-04-05)
  [2111] Business Networking for Melksham - 23rd April - (2009-04-01)
  [2095] Blue Ridge and Melksham Chambers of Commerce - (2009-03-21)
  [2043] Confidence, Customer Service and Tourism in Melksham - (2009-02-15)
  [1987] One Cheer for Local Democracy - Asda in Melksham - (2009-01-11)
  [1979] Looking forward, in Melksham, in 2009 - (2009-01-05)
  [1934] Lidl opens in Melksham - (2008-12-11)
  [1904] Ruby, Perl, Linux, MySQL - some training notes - (2008-11-23)
  [1892] Melksham Chamber of Commerce and Industry - (2008-11-17)
  [1881] Wiltshire Council says - part 1 - (2008-11-13)
  [1880] Melksham Chamber of Commerce, or the FSB - (2008-11-12)
  [1792] All the pieces fall into place - hotel and courses - (2008-09-10)
  [1748] Hotel room prices - Melksham, Wiltshire - (2008-08-11)
  [1642] Summer! - (2008-05-15)
  [1507] Comments on proposed Asda Superstore for Melksham - (2008-01-14)
  [1504] Flooding by Asda-s proposed new supermarket - (2008-01-12)
  [1476] Shopping for Christmas and looking forward - (2007-12-17)
  [1432] Wiltshire County Council - Budget Consultation - (2007-11-15)
  [1429] Remembrance day - inside a church and inside the day - (2007-11-11)
  [1250] Business speed networking - a place tonight! - (2007-06-28)
  [1223] Asda opening large new store in Melksham - (2007-06-08)
  [717] A customer service company - (2006-05-11)


Back to
Lua - a powerful, up and coming scripting language
Previous and next
or
Horse's mouth home
Forward to
Kiss and Book
Some other Articles
Providing exceptional service - and carrying on doing so.
What to do if the Home Page is missing
Spring in Devizes
Kiss and Book
Changing a screen saver from a web page (PHP, Perl, OSX)
Lua - a powerful, up and coming scripting language
Looking back through some photos
To provide external links, or not?
A short introduction to our courses
Gant charts - drawing them with a PHP script
4750 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2017: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/1633_Cha ... -OSX-.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat