Sunday, 5. January 2025 Week 1
Thursday, 2. January 2025 Week 1

Getting iPhone Photos to Linux - with PhotoSync

During casual surfing I found this article from Brain Baker explaining their revised backup strategy.
The most interesting part was the brief mention of PhotoSync used to sync photos to their Linux system.

This came just at the right moment, as I was exploring options how to get photos from an iPhone to a Linux machine as seemlessly as possible.
Previous attempts with ifuse/libimobiledevice didn't work reliably, and uploading the photos to iCloud and somehow scraping/downloading them again doesn't look very future-proof either.
Thus very happy about PhotoSync which runs on the iPhone and talks a plethora of protocols on the other side (in my case I opted for SFTP).

It is a freemium app with paid in-app purchase for the pro/premium features (raw photo sync and autosync in the background).
Based on the good reviews and initial functionality testing of the free version I decided to fo for the one-time purchase to unlock the premium features.

I did setup a chrooted SFTP user to receive the photos on the Linux machine.
Then configured this SFTP access in the app which worked seamless.
So far the manual sync of existing photos and videos worked reliably over WiFi.
And I'm looking forward for the geofence-triggered autosync to run 🤞🏻

Wednesday, 1. January 2025 Week 1

Fetching RSS feeds respectfully with curl

In this article, MacKenzie builds up a config, script and systemd file to respectfully fetch an RSS feed with curl.

It uses the following as base config for curl:

fail
compressed
max-time = 30
no-progress-meter
alt-svc = alt-svc-cache.txt
etag-compare = tech.CitizenLab.rss.etag
etag-save = tech.CitizenLab.rss.etag
output = tech.CitizenLab.rss.xml
time-cond = "Tue, 05 Nov 2024 15:00:35 GMT"
write-out = "%output{tech.CitizenLab.rss.lm}%header{last-modified}"
url = "https://citizenlab.ca/feed/"
next

Then adds conditional checks for the etag-compare and time-cond directives, so they are only added if the corresponding file contains a non-empty value.

The last part is then to use a systemd Timer file with OnUnitInactiveSec=1hour, so that the command will be run one hour after the previous run finished.

Tuesday, 31. December 2024 Week 1
Monday, 30. December 2024 Week 1

How to link to any text on a page

Text fragments allow linking to any text on a page, not limited to <a name="anchorname"> anchors or elements with an id="anchorname" attribute.
To achieve this it introduces the special #:~:text=... prefix which browsers recognize and navigate to the text on a page.

https://example.com#:~:text=[prefix-,]textStart[,textEnd][,-suffix]

The simplest case is to just use textStart:

https://blog.x-way.org/Misc/2024/12/27/Scheduled-Screenshots.html#:~:text=GitHub%20Action

example link

By using the textEnd we can link to a whole section of a text:

https://blog.x-way.org/Misc/2024/12/27/Scheduled-Screenshots.html#:~:text=steps,per%20month

example link

And with prefix- and -suffix we can further control the exact location when there are multiple matches:

https://blog.x-way.org/Misc/2024/12/27/Scheduled-Screenshots.html#:~:text=blog-,screenshots

example link

https://blog.x-way.org/Misc/2024/12/27/Scheduled-Screenshots.html#:~:text=screenshots,-repo

example link

There is also a corresponding CSS pseudo-element which can be used to style the linked to text fragment on a page:

::target-text { background-color: red; }

(via)

Friday, 27. December 2024 Week 52

Scheduled Screenshots

Alex explains in this article how to automatically take regular screenshots of their website.
The automation happens with a GitHub Action that uses Playwright to take the screenshots and then stores them in the Git repository.
Alex has made the repo public, thus we can have a look at how this is implemented.

I followed the steps listed in their repo and did setup my own scheduled screenshots repo.
It will now take some screenshots of my blog once per month.

A project for the future will be to leverage the Internet Archive to backfill my repo with blog screenshots of the last 22 years 😅
Thankfully Alex did some pioneering work on this already and wrote two articles which will become handy:

How to create a highlighter marker effect in CSS

In this article Max explains how to build a highlighter marker effect using only CSS.
The result is a nice looking effect to spice up the default highlighting style of the <mark> element.
This is the resulting CSS code from the article (now integrated in the blog here):

mark {
  margin: 0 -0.4em;
  padding: 0.1em 0.4em;
  border-radius: 0.8em 0.3em;
  background: transparent;
  background-image: linear-gradient(
    to right,
    rgba(255, 225, 0, 0.1),
    rgba(255, 225, 0, 0.7) 4%,
    rgba(255, 225, 0, 0.3)
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
Thursday, 26. December 2024 Week 52