noisybox.net

blogs tagged perl RSS feed Atom feed


Viewing entries 2 to 1 [2 matching entries]
  • |< NEWEST
  • << NEWER
  • OLDER >>
  • OLDEST >|

canon

Ooops! I've been organizing image files recently from my camera and realized that I was losing timestamps when moving them to a remote Samba share. Fortunately, image formats and cameras these days are smart enough to embed the original timestamp inside the image itself (assuming you have a moderately recent camera and assuming you've gone thru the process of configuring the date/time).

I hacked up the almost trivial perl script below to touch each file with the data from the exif data.

----------
#!/usr/bin/perl
# Touch files with Exim timestamps
use strict;
foreach my $f (@ARGV){
   my $d = `jhead $f | grep 'Date/Time'`;
   chomp $d;
   $d =~ s/^Date/Time.*: (d+):(d+):(d+) (d+):(d+):(d+)/$1$2$3$4$5.$6/;
   `touch -t "$d" "$f"`;
}

----------

The script depends on the jhead tool to get the data from the image, but the rest is dead simple.

Late last night I posted a first version of my Perl-based serial packet app for talking with the CrystalFontz 635:

crystalfontz in perl

It's not rocket science, but there just really aren't very many working implementations out there, let alone working implementations that allow one to save the LCD state as the boot state. It's certainly not feature complete, but it does what it does and it actually works.

The app was built with the express purpose of configuring the CF-635 in my audiopint before LCDProc is able to take over. It certainly makes the startup/boot sequence nicer, and it allows me to start LCDProc later in the boot sequence, maybe even asynchronously.

The next step now is to build a small set of puredata (Pd) abstractions to talk directly to LCDproc via the netsend socket abstractions.