Old Laptop Wall Decoration
Posted 12-18-2010 at 12:18 AM by leehanken
Photo
Aim was to recycle an old Windows 98 Toshiba laptop to do something useful or fun.
- Using an installation of Slackware 13.0 and a wireless dongle.
- Script to display email inbox, facebook stream and a number of rss feeds, onto the console.
- Alternatively to play a slideshow of photos.
- Choose a radio station and play in the background, depending on the time of day.
How this was achieved:-
- To make the script start automatically:
In /etc/initab
autologin.c
- To get email
/etc/anacrontab
.fetchmailrc
- To get and display rss feeds in python
- To pipe output to console one line at a time, in C
- Shell script to do all of the above
/usr/bin/go
- Startup script to decide what to do based on time
/usr/bin/playradio1
Aim was to recycle an old Windows 98 Toshiba laptop to do something useful or fun.
- Using an installation of Slackware 13.0 and a wireless dongle.
- Script to display email inbox, facebook stream and a number of rss feeds, onto the console.
- Alternatively to play a slideshow of photos.
- Choose a radio station and play in the background, depending on the time of day.
How this was achieved:-
- To make the script start automatically:
In /etc/initab
Code:
# These are the standard console login getties in multiuser mode: c1:1235:respawn:/sbin/agetty -n -l /usr/sbin/autologin 38400 tty1 linux c2:1235:respawn:/sbin/agetty -n -l /usr/sbin/autologin 38400 tty2 linux c3:1235:respawn:/sbin/agetty -n -l /usr/sbin/autologin 38400 tty3 linux
Code:
int main() { execlp ( "login","login","-f","user",0); }
Code:
/usr/sbin/anacron -s -n /usr/bin/fetchmail -f /root/.fetchmailrc -k -d 300
Code:
SHELL=/usr/bin/bash PATH=/usr/sbin:/usr/bin MAILTO=root RANDOM_DELAY=0 START_HOURS_RANGE=0-24 1 0 clearmail /usr/bin/cat /dev/null > /var/mail/root
Code:
set daemon 300 poll imap.isp.com with proto IMAP user 'user@domain.com' there with password 'mypassword' is 'root' here
Code:
import feedparser feeds = ("http://feeds1.server.com/rss.xml","http://feed2.server.com/rss.xml") c = 0 for feed in feeds: d = feedparser.parse(feed) for value in d.entries: str = value['summary_detail']['value'] str = str.encode('ascii', 'replace') if (c == 0): print "\033[31m"; else: print "\033[35m"; print str c = (c + 1) % 2 print "\033[37m"
Code:
#include <stdio.h> #include <stdlib.h> main() { char buffer[80]; char *ok; while (!feof(stdin)) { ok=fgets(buffer,80,stdin); if (ok != 0) printf("%s",buffer); system("/usr/bin/sleep 1"); } }
/usr/bin/go
Code:
setterm -blank 0 while true; do /usr/bin/mail -u root -H > /root/item1.txt /usr/bin/python /root/my/my.py > /root/item2.txt /usr/bin/fbcmd stream > /root/item3.txt /usr/bin/slowoutput < /root/item1.txt /usr/bin/slowoutput < /root/item2.txt /usr/bin/slowoutput < /root/item3.txt done
Code:
HOUR="`/usr/bin/date +\"%H\"`"; if [ "`/usr/bin/tty`" = '/dev/tty1' ]; then if [[ $HOUR -lt 7 ]]; then /usr/bin/playradio1 & elif [[ $HOUR -gt 6 && $HOUR -lt 12 ]]; then /usr/bin/playradio2 & elif [[ $HOUR -gt 11 && $HOUR -lt 14 ]]; then /usr/bin/playradio3 & elif [[ $HOUR -gt 13 && $HOUR -lt 20 ]]; then /usr/bin/playradio4 & elif [[ $HOUR -gt 19 ]]; then /usr/bin/playradio5 & fi elif [ "`/usr/bin/tty`" = '/dev/tty2' ]; then if [[ $HOUR -lt 19 && $HOUR -gt 2 ]]; then chvt 2 /usr/bin/go fi elif [ "`/usr/bin/tty`" = '/dev/tty3' ]; then if [[ $HOUR -gt 18 || $HOUR -lt 3 ]]; then chvt 3 /usr/bin/mplayer -fs -vo fbdev -loop 0 /root/slides.avi fi fi
Code:
mplayer -playlist http://music.someradioserver.com/Show.asx?StreamID=10
Total Comments 1
Comments
-
ZOMG this is really funny!
Posted 12-18-2010 at 08:07 PM by Web31337