maZZoo maZZoo's blog
very low frequency tech postings  -   11 2005
    home
    blog
    feed
    eyes
    info

    code [12]
    dect [4]
    hard [8]
    meta [5]
    security [5]

jul 2009 (1)
jun 2009 (1)
jan 2009 (2)
dec 2008 (1)
oct 2008 (1)
jan 2008 (1)
oct 2007 (1)
jun 2007 (1)
feb 2007 (3)
jan 2007 (3)
nov 2006 (2)
aug 2006 (2)
jul 2006 (1)
may 2006 (1)
nov 2005 (2)
oct 2005 (1)
apr 2005 (2)
mar 2005 (2)
feb 2005 (1)
jan 2005 (1)
may 2004 (1)
jan 2004 (1)
apr 2003 (1)
jan 2003 (1)

Fri, 18 Nov 2005

color snapshots from a black n white Tektronix oscilloscope

lucky me owns a Tektronix TDS540 oscilloscope (4 channels, 500MHz BW, 1 GS/s) without floppy drive and BW monitor.
Here's an easy way to create colored .png files from the TDS540 (and probably other TDS series CRO) :

  • connect the TDS to your PC via RS232
  • in the Hardcopy Menu set the printer to "EPS Color Encapsulated Postscript color plot"
  • Layout: Landscape
  • Port: RS232
  • have ghostscript installed on your PC
  • run the perl script TDSsnap (also below)
  • press the HARDCOPY button
  • you should obtain two files TDSsnapshot.eps and TDSsnapshot.png
snapshot from Tektronix TDS540


#!/usr/bin/perl -w

use strict;

my $device="/dev/ttyS7"; # change this to your needs!

print "ensure the Tektronix prints as \"EPS Color /Encapsulated Postscript color plot/\"\n";
print "connect it to $device (for me: Quatech interface D)\n";

open F, "<$device" or die "cannot open $device\n";

print "\npress the HARDCOPY button\n\n";

my $eps="";
my $i=0;

while (<F>){
        s/.*translate 90 rotate$/20.00 20.00 translate/;
        $eps .= $_;
        print "\rEPS line " . $i++;
        last if /^%\%EOF$/;
}

close F or die "cannot close $device\n";

print "\n";

my $outname="TDSsnapshot";

$outname=$ARGV[0] if $ARGV[0];

print "creating $outname.eps\n";


open F, ">$outname.eps" or die "cannot open $outname.eps\n";
print F $eps;

close F or die "cannot close $outname.eps\n";

print "creating $outname.png\n";

open F, "| /usr/bin/gs -sDEVICE=png256 -q -dSAFER -dNOPAUSE -dBATCH -g630x480 -sOutputFile=$outname.png -_"
        or die "cannot pipe into /usr/bin/gs (ghostscript not installed?)\n";
print F $eps;

close F or die "cannot close $outname.eps\n";

print "done.\n";




posted in /hard  |  link  |  comments [0]   


Thu, 10 Nov 2005

bluestep

/*
 * bluestep - locks your screen once you step out of the room,
 *            provided that you took your bluetooth enabled
 *            mobile phone with you.
 *
 * version 0.01
 *
 * usage: bluestep <bdaddr>
 *
 *      bdaddr  - MAC address of the remote bluetooth device
 *
 *
 * (c) 2005 by Matthias Wenzel, licensed under GPLv2
 *
 */

this tiny daemon peridically pings your bluetooth mobile, if doesn't get responses for a while it will lock your X desktop with "xscreensaver-command -lock".

hints:
figure out your <bdaddr> with:
# hciconfig hci0 up
# hcitool scan
Scanning ...
        00:11:22:33:44:55       my_left_foot
# 
try to ping your device (hciconfig/hcitool/l2ping come with your bluetooth libraries and tools):
# l2ping -c 3 00:11:22:33:44:55
Ping: 00:11:22:33:44:55 from 00:55:44:33:22:11 (data size 44) ...
0 bytes from 00:11:22:33:44:55 id 0 time 27.52ms
0 bytes from 00:11:22:33:44:55 id 1 time 32.05ms
0 bytes from 00:11:22:33:44:55 id 2 time 47.04ms
3 sent, 3 received, 0% loss

if the above command works you're probably set to run bluestep!

bluestep-0.01.tar.bz2



posted in /code  |  link  |  comments [0]   


validate HTML