A chronological documentation test project, nothing serious, really!

02 Dec 2011 Grab several screenshots from specified window in linux

This was a short bash script I wrote to help document some startup problems on a server.
The script was grabbing screen dumps from iDRAC during boot on a RHEL6 server, but it can be used on other distributions as well since the console command xwd is common.

# Description:
# Grab screenshot of a specified X-window and wait X-seconds

# Use xwininfo to find the Window id to the window you are going to 
# grab screenshots from.

# filename for output

# seconds sleep between grabs

padding="000" # put as many padding zeros as you want on filename
for ((i=0; i<1000; i+=1))
        # Perform the actual screenshot grab
        xwd -id $xwininfo -out $outfile-${padding:${#i}}$i.xwd

        # Convert the xwd file to a better image format like PNG
        convert $outfile-${padding:${#i}}$i.xwd $outfile-${padding:${#i}}$i.png

        # Delete the converted XWD-file
        rm -f $outfile-${padding:${#i}}$i.xwd

        # wait 
        sleep $sleeping

Stop the script after you have grabbed enough screenshots.

I ended up with several files named outfile-000.png outfile-001.png ...
Deleted those files that were not needed and sent the images a documentation of the booting process.

Tags: , , , ,

Posted by

30 Sep 2007 Text to image using imagemagick

convert -size 200x30 xc:transparent -font /usr/share/fonts/dejavu/DejaVuSansMono.ttf -fill black -pointsize 12 -draw "text 5,15 'this is just a test'" test.png

Tags: , ,

Posted by

04 Jun 2007 Creating ScreenCapture Videos in Linux

A solution that is fast flexible and gives great results. It is not Open Source but it is a free download for Linux. You may have heard of it before. Wink is a utility for creating flash/swf based presentations.

Tags: , , ,

Posted by

15 Apr 2007 Extract pictures from a VOB file using transcode

Sometimes it is useful to collect some pictures from some different DVD’s to a new one. But what to do if the original pictures are deleted now. You can use the following command to extract the pictures first.

transcode -x mpeg2 -i VTS_01_1.VOB -y im -F jpg -w 100

-F jpg, png, gif ==> picture format (default jpg)-w number ==> quality for jpeg and compression-level/quality for png (for example 95, see “man transcode”)Now you can choose and delete some and collect new with the described procedure at dir2slideshow.

Tags: , , , ,

Posted by

02 Feb 2007 Resize of images in a folder with imagemagick

# Hans-Henry Jakobsen
# Script som bl.a resizer bilder og legger de i rett mappe
# NB! ikke bruk originalfil da dette script sletter fila

# Sjekker at mapper eksisterer
if [ ! -d 320 ]
        mkdir 320
if [ ! -d 480 ]
        mkdir 480

for file in  $(ls|grep JPG)
        base320=`basename $file .JPG`_Resized_320.png
        base480=`basename $file .JPG`_Resized_480.png

        convert $file -resize 320 $base320
        convert $file -resize 480 $base480

        convert $base320 -background black \
        -font Verdana -pointsize 10 -fill black \
        -gravity center -set caption "Copyright \© 2007"  +polaroid \

        convert $base320 -background black \
        -font Verdana -pointsize 10 -fill black \
        -gravity center -set caption "Copyright \© 2007"  +polaroid \

        # Sletter temp filer
        rm $base320
        rm $base480
        # Ikke bruk originalfil da den blir slettet!
        rm ${file}

# Ordner rettigheter
chmod g+rw 320/*
chmod g+rw 480/*
chgrp knausen 320 -R
chgrp knausen 480 -R

Tags: , , , , ,

Posted by