Puppy Linux for keeping my grandma up to date

A home for all kinds of Puppy related projects
Post Reply
Message
Author
Zipi
Posts: 1
Joined: Thu 01 May 2008, 12:36
Location: Imatra, Finland

Puppy Linux for keeping my grandma up to date

#1 Post by Zipi »

Hi,

I have over 90 years old grandma and she has some problems keeping up with the current date and weekday. Otherways she has her sanity pretty well reserved, so I thought I have to do something to help her keeping up to date.

Hardware:

I have one really flat 15" LCD display and one small Compaq P3 1GHz machine with 512MB ram. I want to keep it as quitet as possible so I removed the hard drive and boot the system from CD and save all the data to 256MB USB stick. The machine won't boot from the USB, not even with WakePup2. Other distros like DSL was able to boot from USB with a boot floppy, but those were using Linux boot floppy instead of Puppy's DOS one.

The idea:

My initial idea is to autostart web browser to fullscreen and show three lines of very big white text at the screen on black background. First line will be date, second is the day of the week and the third one will be 24H clock. To this point I think I won't have any problems of doing my little project, but I have other plans as well...

There is one analog telephone line and no internet connection available. I have considered to put the computer to call to the internet once per day and download one small text file from my home page which could include for example greetings from her relatives. These greetings would be shown every now and then at the display.

The problem:

I know PHP/MySQL, JavaScript and HTML pretty well but I don't have too much experience of Linux or other Unix systems. I have played a little with some linux boxes but I feel very handicapped with it due my lack of knowledge. Puppy Linux seems to be a very intresting and well polished small distro and I'd like to use it to this project.

How I can make Puppy Linux to call to the Internet once per day, download one text file, sync its time with NTP servers and immediately after that drop the connection? How I can make sure it won't call to internet at any other cases than this daily text file download?

I also have some problems to get the browser starting up automatically, but this one I think I can solve by myself...

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#2 Post by Lobster »

you need a bash script

Shell scripts
start with:
#!/bin/sh

wget will download the text file
once connected

the important code in the below example script (pwget)
is this:

Code: Select all

wget -c -P "$DEST" $SOURCE

Code: Select all

#! /bin/bash

# Pwget created by Lobster with thanks to Zigbert
# for Puppy Dingo and Linux Tmxxine
# Jan 2008 GPL v3 License
# http://tmxxine.com

export Pwget='
<window title="Pwget - File downloader utility">
<vbox>
 <hbox>
  <text><label>Copy and Paste URL location of required file into "Address". Add destination and click "OK"</label></text>
 </hbox>
 <hbox>
  <text><label>Address</label></text>
  <entry accept="directory"><variable>SOURCE</variable><input>/tmp/pm_source_dir</input></entry>
 </hbox>
 <hbox>
  <text><label>Destination Dir</label></text>
  <entry accept="directory"><variable>DEST</variable><input>/tmp/pm_mirror_dir</input></entry>
  <button>
   <input file icon="gtk-open"></input>
   <action type="fileselect">DEST</action>
   <action>refresh:DEST</action>
  </button>
 </hbox>
 <hbox>
  <button help>
   <action>`Xdialog --wrap --screencenter --left --title "Pwget - HELP" --msgbox "Pwget is a simple front end to the wget utility. Wget is used for downloading larger files from the internet such as ISOs. The files are verified during the download procedure. As ISO and other files are checked and downloads resumed, they do not require a md5sum check. Copy and paste the source file you wish to download. Use the file selector to choose the destination. \n\n Lobster, Jan 2008" 600x0`</action>
  </button>
  <button cancel></button>
  <text><label>Download</label></text>
  <button ok></button>
 </hbox>
</vbox>
</window>'

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog3 --program=Pwget --center); do
   eval $STATEMENTS
done
IFS=$I
if [ $EXIT = OK ]; then
  rxvt -name Xwget -bg "#F3F2DF" -e wget -c -P "$DEST" $SOURCE
  rox -d "$DEST"
fi 
other help will arrive shortly no doubt . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Post Reply