diary @ telent

Cracking over the papers#

Fri Aug 30 10:19:35 2019

Topics: nix paperless

One of the several billion things that needs sorting in our new house is a filing system for all the paper junk we get sent that we don't immediately need to deal with but probably shouldn't throw away: bills, PAYE coding notices, letters from the council, bank statements etc. After some thought and thanks to @antifuchs alerting me to the existence of the Paperless project I decided to go digital. Recommend.

Notes, in the order they occur to me

    services.paperless = {
      enable = true;
      extraConfig = {
        PAPERLESS_CORS_ALLOWED_HOSTS="http://localhost:8080";
      };
    };

sudo -u scanner scanimage --format png --batch=/var/spool/scans/$(date +%Y%m%d%H%M%S)Z_p%04d.png  --resolution 300 --source 'ADF Duplex'

where scanner is the username that paperless is running as and /var/spool/scans/ is where I arbitrarily decided the consumption directory should be. I scan to png not pdf because scanimage was silently failing to convert to pdf and instead leaving the files as pbm images. (1) pbm images are huge; (2) pbm images files with .pdf suffixes confuse the paperless web frontend and they confuse me too. I would like to automate this so it runs whenever I (or a family member) presses the "scan" button on the scanner itself, but haven't got that far yet. scanbd will probably do it but seems excessively featureful for my needs.

[dan@loaclhost:~]$ systemctl cat paperless-consumer.service| grep 'ExecStart='
ExecStart=/nix/store/2jaqzp6yhqwb2p0vs93whkwj0r0jf509-paperless document_consumer
[dan@loaclhost:~]$ sudo -u scanner /nix/store/2jaqzp6yhqwb2p0vs93whkwj0r0jf509-paperless document_correspondents

Nix wrought#

Tue Sep 3 21:00:29 2019

Topics: nix nixwrt

Time from unboxing new GL.iNet GL-MT300N-V2 to an ssh-able NixWRT installation: 30 minutes. Though admittedly this does not include the actual firmware build time itself as I did that bit yesterday when I ordered the box.

I lost the CPU for my backup server somewhere when we moved - I still have the disk, just not the bit that makes it go. Probably it's in a box I haven't unpacked yet, but anyway. Having generated much new "content" over the past few days - I've now scanned something over 500 pieces of paper into my paperless archive - it becomes somewhat more pressing to get the automated backup service running again.

  1. make the image
  2. find some scissors, open the box
  3. plug the device LAN port into my laptop and configure it to use a different RFC1918 address than the one it came with (which conflicts with the LAN here)
  4. upload the firmware.bin using the gl.inet web router admin page
  5. wait
  6. why is it not showing up on the LAN?
  7. wait
  8. ah yes, because it's still plugged into my laptop. Try plugging it into a LAN switch instead
  9. odds bodikins, I can ssh into it!

So, 30 minutes, would have been quicker if I weren't an idiot at step 6. To say I am mildly stoked this went so smoothly would be an understatement.

There are a couple of niggles: I need to rebuild the image because I forgot to update the name of the syslog host and I think I have probably also forgotten to put a real password on the rsync service. But both those are (or should be) simple fices.