move-year - A minute tool to help me

Tags:

Time progresses on its own, which manifests itself in timestamps in filenames increasing. Such files are files from the tax office, bank statements and other stuff I download from such websites. I like to have them moved from the Downloads directory into directories that are in my backup run, and already have a script that reacts to such downloads being completed.

This script previously dumped the files in the root directory for documents of my bank or the tax office via

mv -i ~/Downloads/bank-statement-2022-01-01.pdf ~/Documents/finance/my-bank/
mv -i ~/Downloads/tax-report-01012022.pdf ~/Documents/finance/taxes/

So from time to time, I went through ~/Documents/finance/my-bank/ and moved the files into directories according to the year they were in.

But I realized that a small tool can do that automatically and also create the directories directly. And ideally, I don't need to tell the tool very much at all:

move-year --create -ymd -i ~/Downloads/bank-statement-2022-01-01.pdf ~/Documents/finance/my-bank/
move-year --create -dmy -i ~/Downloads/tax-report-31112021.pdf ~/Documents/finance/taxes/

This way, the files will automatically land in the directories ~/Documents/finance/my-bank/2022 and ~/Documents/finance/taxes/2021 .

The tool is not yet on CPAN, but it lives on Github

Reviving Net::Pcap

Tags:

... in which I look at how existing patches floating on the internet can be integrated into Net::Pcap to make it compile again.

Net::Pcap is dear to me, as I have a module implementing an HTTP sniffer using its network capture. So I like it when the module compiles without too much manual work.

Analysis

Continue reading Reviving Net::Pcap...

Patching X11::GUITest

Tags:

The Problem

I'm automating my X11 desktop and watch for windows with certain titles. But sometimes X11::GUITest doesn't find a given window anymore and then xlib takes the complete Perl process with it because X11::GUITest doesn't install the appropriate error handler for missing windows or windows without window decoration.

Error message:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  15 (X_QueryTree)
  Resource id in failed request:  0x0
  Serial number of failed request:  22767
  Current serial number in output stream:  22767

Continue reading Patching X11::GUITest...