Overlaying text files on desktop with a simple shell script

May 6, 2008 by c0dejammer

Well, since superkaramba is too much for my taste, i created a simple shell script that will let you overlay contents of a file (or output of a command, whatever..) on your wallpaper. Yes, i know about root-tail. You will need imagemagick installed to make this work.

—BEGIN—

#!/bin/bash

#X and Y coordiantes at where we will start drawing.
OFF_X=650
OFF_Y=15
FILE=”/home/c0de/blah.txt” #take blah.txt
WALLPAPER=”/home/c0de/wallpaper.jpg” #take wallpaper.jpg
FONT_SIZE=”12″
COLOR=”green1″
#take first 10 lines of blah.txt and overlay on our wallpaper.
DATA=”head $FILE”

while [ 1~ ]; do
convert -font helvetica -pointsize $FONT_SIZE -fill $COLOR -draw \
“text $OFF_X,$OFF_Y ‘`$DATA`’” $WALLPAPER /tmp/wallpaper2.png &
#convert is a imagemagick command, pretty cool thingy too…

dcop kdesktop KBackgroundIface setWallpaper \
“/tmp/wallpaper2.png” 1 &

sleep 120 #change this to your wanted refreshtime in seconds.

done

—END—
you can put this script in ~/.kde/Autostart/ so it will start everytime when you boot KDE.

Also, additional cool stuff: Dont use head on a file, simply parse /proc with grep and awk and make a nice sysmonitor, or head /var/log/auth.log from a remote machine :)

Well, hope you like it…

T-Mobile web’n'walk on Debian Sid / Sidux with K610i

May 6, 2008 by c0dejammer

I believe everyone was in the situation that you needed to SSH to a server or mail someone something important. Well, if you don’t have any free wireless access, no dial-up or ethernet, you sure wish some Mobile Connect / HSDPA / EVDO something to hop on the net. Since in my country the alternatives are expensive (about 20$ – 25$ monthly on a 2 year subscription plan for a crappy 512 Mb or similar) i found something that i liked – 25 Mb for 6$ monthly without subscription plan. Thats about enough for my SSH and mail.

Well, the whole thing uses the web’n'walk S model (bout 6$ monthly for 25 Mb, it’s better than no plan = 6$ for 512Kb which is a bit perversly overpriced). So after that plan, you will need the following things:

Kernel modules for:

“USB Modem (CDC ACM) support” and “USB Serial Converter support”

use your datacable and plug in your SE K610i, select Phone Mode.

Actually, this should work with any mobile phone that has adhered to CDC ACM specs (usbcdc11.pdf)

run dmesg in your shell.

Find on which device is the phone registered. In my case that was /dev/ttyACM0 and ttyACM0 is what it will be in most cases.

Edit /etc/wvdial.conf

[Dialer Defaults]

Init1 = ATH
Init2 = ATE1
Phone = *99*1#
Dial Command = ATD
Modem = /dev/ttyACM0
Password = NULL
Username = NULL

well, after that, just run wvdial and that is it.

Well, nothing special and “new” but it helped me. Don’t be shy to add a comment if it worked for you or not.

First post

May 6, 2008 by c0dejammer

Well, after a long period i decided that i will open a blog. Don’t worry, no sob stories, politically incorect flames (atleast not yet…). The only thing you will find here are short articles, recepies and stuff that is generally too small to put on sourceforge or somewhere else, yet i think will help someone else.