Today @ work we had a crashed PC. The PC served as a wall monitor to show the call central display via remote desktop.
They said to me: Go fix it, no matter how you do it, fix it!.
So I installed ubuntu, but the pc on win2k was called sparky. They vnc'd into it just by typing sparky.
Now for some strange reason that doesn't work anymore, and I did not had time to fix it.
So I made a script that sets the IP as wallpaper so that they can type that in ultravnc.
(Later I thought that it would be better to auto-start uVNC to the central at login, but that did not came up on my mind earlier.)
(And even later I discovered the /etc/hostname file was empty, and after I set that with 'sparky' it worked again...)

You need to have a white background picture, I created one with GIMP, 800x600 called 2.jpg, and thats what i'll use in the tutorial. So change 2.jpg to whatever you use.

(you can get mine here: http://raymii.org/cms/images/ip.jpg & find my example here: http://raymii.org/cms/images/ip-result.jpg)

First install imagemagick:
sudo apt-get install imagemagick
(and if needed feh)
(sudo apt-get install feh)

Then we'll make a bash script with the following in it:




#!/bin/bash
export DISPLAY=:0.0
convert 2.jpg -pointsize 80 -draw "text 0,150 '`ifconfig eth0 | awk -F ":" '/inet addr/{split($2,a," ");print a[1]}'`'" -draw "text -0,250 'Made with help of:'" -fill blue -pointsize 150 -draw "text -0,390 'Relst.nl'" -fill red -pointsize 72 -draw "text -0,500 '`date`'" 3.jpg
# Uncomment this one if you're not using gnome:
# feh --bg-scale ./3.jpg
# and place a $ (hash) for the following rule:
gconftool -t string -s /desktop/gnome/background/picture_filename ./3.jpg


Save as ~/.back.sh and then chmod 755 ~/.back.sh
(make sure that the image file is also in your home dir.)

So, what this does is basicly put the output of the ifconfig eth0 (change if needed) command, and the time & date on the background image, then it sets the background image to the newly created image.

And the export DISPLAY=:0.0 is because you can then run the script from of ssh to.
For that I also had a problem. Luckaly I found the solution, but I forgot to write down the source...



## as root, extract xauth info from user that started X
$ XAUTHORITY=/home/usrname/.Xauthority xauth list
hostname/unix:0 MIT-MAGIC-COOKIE-1 273bf22484148c6504f5d85e6ef510e5
hostname.sub.domain:0 MIT-MAGIC-COOKIE-1 273bf22484148c6504f5d85e6ef510e5

# as current user, add xauth info to your xauth info...
$ xauth add hostname/unix:0 MIT-MAGIC-COOKIE-1 273bf22484148c6504f5d85e6ef510e5
$ xauth add hostname.sub.domain:0 MIT-MAGIC-COOKIE-1 273bf22484148c6504f5d85e6ef510e5


Now you can set it as a crontab that runs every minute (crontab -e) or add it to the gnome startup apps (gnome-session-properties).

And you have your own IP as the background :D