Tuesday, November 17, 2009

perl regexp one liner to copy some images

oki have the images from one day on the camera card and i need to copy them
this works!

ls /mnt/usb/dcim/100ncd80/ -ltr |grep 2009-10-20|perl -pe 's/.*(dsc.*)/$1/'
lists the images i want
cd /mnt/usb/dcim/100ncd80/

ls -ltr |grep 2009-10-20|perl -pe 's/.*(dsc.*)/$1/'|xargs -I {} cp {} /home/debianuser/conferences/conf20091118

this works well!

and here is the flip images script to rotate the images

cat bin/flip_journal.pl
#!/usr/bin/perl -w
use strict;
my $angle=shift;
my $dir=shift;
if (!($angle && $dir)) {print"missing either the angle or the directory"; die;}
opendir (IN,$dir);
my @list;
@list=readdir (IN);
foreach (@list)
next if ($_ eq '.' || $_ eq '..');
system ("convert -rotate $angle $_ $_ ");

Tuesday, November 10, 2009

sleep article on notebook vs sleepd


idea of using gnome-power-manager

now see the comment

Suspend assumes gnome/kde is running

Pressing the suspend-key will call /etc/acpi/sleebtn.sh, which uses acpi_fakekey to generate an event on /dev/input/event*, which is received by gnome-power-manager or similar applications.

To get suspend to work without gnome-power-manager,
replace the acpi_fakekey line in sleepbtn.sh with the line:/etc/acpi/sleep.sh sleep

now we need to compare to setting this up with the sleepd