RSSAmplifier

Blog

Albin Larsson

byabbe.seRSS feed ↗116 posts

Latest posts

Cloning and Initializing Git Repositories for Work Tree Workflows

I’m very fond of Git work trees, but I’m rather opinionated regarding the directory structure of my projects. I prefer a “root” project directory containing my .git and all my work trees next to it. Like this: my-project .git main feature-branch-1 bug-branch-398 To accomplish the above with git clone you need to go through a few steps: make a bare clone into given both the Git URI and the…

Scripting KDE Konsole

I finally got(took) the time to automate away the 2 seconds it takes me to set up my Konsole development layout. Given the sparse examples showing Konsole’s DBus interface and its quirks in action, I thought it made sense to share my script here. Having recently moved from Bash to Fish , I rediscovered the joy of shell scripting and added some git and just checks as well. The following Fish…

Reconcile Against any MediaWiki Instance

You have just deployed your 55th reconciliation service for a MediaWiki or Wikibase-based service. You start wondering if this isn’t the time to stop copy-pasting your code around and apply some of that don’t-repeat-yourself wisdom. That was me a moment ago after a few months of pushing it in front of me. Now a prototype intended to replace all of our reconciliation services targeting MediaWiki…

EXIF to GeoJSON Converter

I made a small tool for extracting EXIF location data and “converting” it into GeoJSON. It comes from my need to display EXIF locations in OpenOrienteering Mapper . Turns out it’s useful for other things like OpenStreetMap mapping and Wikidata( WikiShootMe supports custom GeoJSON layers). You find the tool on this webpage and the code over at Codeberg .

Cloudflare Worker to resolve URLs

The other day, I needed to resolve a w.wiki URL from a client-side application. However, the UrlShortener MediaWiki extension does not provide an API for resolving URIs ( T358049 ), and client-side applications can’t simply resolve the URLs normally due to CORS. To unblock myself, I decided to write a generic Cloudflare Worker to resolve URLs, as it is a common task and I always end up dealing…

Using Python virtual environments through Just

I have gotten quite fond of Just lately much thanks to how it forces you into the habit of creating structured documentation for the various commands and scripts that you end up writing. When adding a Justfile to a Python/Django project the other day I found myself in a situation where I wanted to make sure that all commands ran in a virtual environment. However, because Just run each line in a…

Ensuring VS Code can watch Snowman projects for file changes

Rencently VS Code and VS Codium has been throwing the following error at me when working with Snowman projects: Visual Studio Code is unable to watch for file changes in this large workspace Turns out that VS Code is trying to watch all the files in the .snowman directory and it’s subdirectories. No wonder it’s complaining, there are a lot of files in there! Adding .snowman to the…

Building and deploying Snowman sites with Gitlab Pages

I have previously written about how to build Snowman sites on Github Actions . Yesterday I had to figure out not only how to build Snowman sites on Gitlab Pages but also how to deploy them. Not only was the Gitlab CI/CD configuration a joy compared to Github Actions, but it integrats well with the Gitlab Pages service to the extent that any Snowman site should be able to build and deploy with the…

Partial updates of large Snowman sites

Snowman is a static site generator for SPARQL backends, since its inception a goal has been that one should be able to use it to build large sites with 100,000 pages. Oneway Snowman makes this possible by relying heavily on the caching of all SPARQL queries. Building the Govdirectory website from a blank cache would issue thousands of SPARQL queries to the Wikidata Query Service. This, however,…

MediaWiki development with SQLite and PHP

Recently I have been ranting a little bit about the many different solutions for setting up MediaWiki development environments. A visit to mediawiki.org and you will likely find solutions based on Docker, Vagrant, and custom CLI tools. Some are maintained, some are usable on some particular Linux distros, etc. However, all you need for the vast majority of MediaWiki development is PHP and SQLite.…

Building Snowman sites on Github Actions

Snowman is a static site generator for SPARQL backends. HTML templates and SPARQL queries in, a website out. I have a set of Snowman sites that needs to be built and deployed once a day to ensure that they are up to date. I wanted to do this a while back for one of them using Github actions. The following Github action will: Checkout the repository Download the Snowman binary and make it…

Making Everything an RSS Feed

A while back I made a goal along the line of “make all the data on fornpunkt.se available as an RSS feed”. One might ask why, well, I think that one shouldn’t be required to use the FornPunkt website to access and reuse its content. I also think that RSS is a great format for this given that most content has a temporal component to it and that RSS has many great clients, integrations, and…

New York Times Sudoku Scraper

You get home late and go to bed only to find that you missed the New York Times’ daily sudoku puzzle? Maybe you skip the puzzle one day? Or maybe you just want to play it in an app of your choise. I just wrote a basic script, which uses Regular Expressions to extract the puzzle from the New York Times website. I’m particularly fond of how it parses the JavaScript game data as JSON, who knows how…

Quick Links in Django Admin

Whenever you are viewing a model-page in Django’s admin-interface there is a sidebar to the left giving you quick access to other models: This sidebar, however, isn’t utilized on the start/index page. By enabeling the sidebar we can get space for various types of shortcuts and links that can be useful to admins. The sidebar will also fit right into Django’s structure and style. By creating…

Python Dependencies and Flatpak

I’m learning how to create responsive Gnome applications with Python, GTK4, and Flatpak. One of the early issues I ran into after I generated a new Python project using Gnome Builder ’s built in template was how to make Python dependencies from the Python package index aviable to my app. I’m currently lacking a good resource describing the solution for my development log, so here is my take.…

Incognito User Agents

User Agent spoofing isn’t news and is necessary for many Internet users. Today, however, I noticed something I hadn’t earlier. User Agent spoofing causing analytics and security services to report the wrong operating system and browser altogether. I logged into Twitter from GNOME Web on a PostmarketOS device, and the login notice I received a while later told me I had logged in from an Android…

Wikimedia Commons Upload Campaigns for Cultural Heritage

Since the first Swedish edition of Wiki Loves Monuments in 2011, participants have uploaded almost 30 000 images of heritage sites, protected buildings, ships, and working life museums. Wiki Loves Monuments (WLM) goes on for 30 days per year. While many experienced users take images all year round for the event, many new contributors are introduced to WLM and the broader Wikimedia community for…

HTML Markup for Citation Tools

Isn’t it great when a citation tool like Zotero or Wikipedia’s Citoid takes a link and turns it into a citation? In this post, I show some of the HTML markup needed for your web pages to support just that. How Zotero and Citoid works The most common citation tools out there are just like Citoid and Zotero powered by Zotero-translators , a set of JavaScript files that parse web pages into citations…

Govdirectory and the Unlock Accelerator

A crowdsourced and fact-checked directory of official governmental online accounts and services. That was how Jan Ainali and I described Govdirectory in late April last year when we wrote the initial application to the Unlock Accelerator . The idea, a global directory of government agencies and their online presence based on Wikidata, was accepted, and we got started. Highlights of the Unlock…

Notes on launching an MVP

Following a decade of procrastination, I decided that it was about time to create a Swedish citizen-science platform for heritage sites and historic environments and 80 work hours later I launched fornpunkt.se . I have built quite a few crowdsourcing platforms some over a long period of time , some over a very short period of time . However, I’m not sure any of them would qualify as even close to…

My Self-hosting Setup

Having self-hosted various tools and services for a few years, I now believe I got a solid home server setup that covers almost all of my use-cases, and therefore I thought I would share my current setup. Core services Pi-hole While the common use case for Pi-hole is content and ad-blocking I use it as both a DNS and DHCP Server in addition to content blocking. It essentially keeps most of my…

Live Editing Wikidata: 50 Episodes and Counting

It has been more than 17 months since Jan Ainali asked if I wouldn’t be up for some live-streamed Wikidata editing. It seemed like an insightful and valuable thing to do. Now, over 50 episodes later , we have showcased more than 30 community tools, issued over 100 SPARQL queries, and even so, we don’t lack ideas for future content. Tools Behind the Scenes From day one, we have been using…

Using SPARQL in QGIS

A couple of months back I discovered the SPARQLing Unicorn QGIS Plugin and it has been super useful for both data visualizations and Wikidata editing. After installing it adds a new option under the “Vector” menu item in QGIS. Its interface allows one to access and query a set of predefined SPARQL endpoints including Wikidata as well as pointing to a custom endpoint or RDF file. One of my use…

Getting Random Results in SPARQL

Just the other day I decided to take a stab at an old StackOverflow questing about getting random results from SPARQL . The most obvious solution might first appear to be using SPARQL’s built-in RAND() function and order by that random number: SELECT ?s WHERE { ?s ?p ?o . BIND(RAND() AS ?random) . } ORDER BY ?random LIMIT 1 This could have been perfectly fine if it weren’t for SPARQL engines…

My Essential Backup Script

On my main computer, there are essentially three things that change regularly and aren’t backed up to a could service regularly. These three things are notes, browser bookmarks, and keys/passwords. To be able to back up these to external servers without the hassle, I wrote a Bash script a while back that allows me to type backup anywhere in my terminals to quickly get an encrypted zip containing…

Writing Structured Data on Commons with Python

Pywikibot does not yet have built-in support for writing Structured Data to Wikimedia Commons so to do so currently one needs to do it by posting JSON data to the Wikimedia Commons Wikibase API, this blog post will walk you through how to make the requests needed and how to structure the JSON to get it all working. The minimal example presented here will check if the given file has a statement…

Recently Week 34 2020

Things Took part in the weekly competition on the Swedish Wikipedia about adding video material to articles. In total, I added videos to 44 articles, thanks to the Wikidata query service . Did a Wikidata live-stream with Jan again, I highlighted property 5991 “carbon footprint” hoping that usage will go up! You can watch the recording on Youtube . Following a two day hike this weekend I (finally…

Revisiting a Project with Serverless

Two years back I wrote about runor.rocks a small service I built in five minutes that redirects you to a random article about a runestone. An issue with the solution was speed so when I wanted to explore Serverless a while back it was the perfect small project to revisit. The task at hand was very simple, given a set of URLs redirect to one of them randomly. Small task and perfect for…

Content Management Systems Among Swedish Museums

I recently “visited some” museum websites to determinate which content management system or backend that powers them. Now I have published my dataset with over 370 Swedish museum websites (excluding those museums who uses central CMS solutions (such as hembygd.se or municipality websites)). Almost two thirds are powered by WordPress (general CMS marketshare estimated between 35-50%). Drupal,…

The Nationalmuseum API

Nationalmuseum, the national gallery of Sweden has had an API for about two and a half years (I think),but it has yet to have any public documentation. So I decided to write down its features and some random tips. Capabilities The API is able to return specific objects as well as returning all objects through pagination. Many objects also link to their external IIIF manifest. Retrieving an object…

Reading List Week 6 2020

I haven’t done a weekly reading list on this blog since high school; this week I did for a mysterious unknown reason. Alternative title: Links with random mumblings. GLAM and Museum Tech Building Wellcome Collection’s new archival storage service – Two too common issues: filenames consisting of identifiers that are forgotten sice long ago and file verification. Current efforts will save future…

A SPARQL Editor for SOCH

About a year ago I made a custom SPARQL editor for the Swedish Open Cultural Heritage (SOCH/K-samsök) LOD platform since then it has served me, both at home and at the office. Now I’m hosting an instance for anyone to use. It was built both to aid me (and others) working with the over 8 million RDF records in SOCH as well as to be a prof of concept and reference for future work. The editor comes…

Observations on AI Assisted Crowdsourcing

As a part of the “ Wikimedia Commons Data Roundtripping ” project facilitated by me in my role at the Swedish National Heritage Board we ran a pilot together the Swedish Performing Arts Agency around crowdsourcing translations of image descriptions this spring. In this post I’m briefly sharing some of my observations related to how AI assisted translations impacted the crowdsourcing campaign. So…

An Actionable Approach to Data Quality for Cultural Heritage Institutions

In this post I’m introducing a new data quality portal that we are currently testing with the K-samsöks data partners. It’s a data quality tool without any percentages or metrics. To solve data quality issues at cultural heritage institutions (or anywhere) two key things need to be achieved: Awareness - individuals need to be aware of the specific data quality issues present in their data.…

My new approach to online privacy

I have for the last few yeas had a online privacy approach in the style of “Do not put all eggs in the same basket” or exemplified in the style of “If I use Google for email I won’t use it for browsing the web”. Now after a few years of empirical learning I have decided to change this approach. It’s clear that the owner of “my” online data (the irony) is seldom static nor does it keep the data…

How to set up a Generous Interface Prototype in Less than a Day

Read this post on Europeana Pro.

An Awesome List

I created one of those “awesome lists” for K-samsök resources, I have personally found awesome lists useful when starting with something new our just needs to investigate useful components a hobby project. Therefor I decided that it might help someone else to have one list for all the best K-samsök projects and resources so that people might get started quicker with one of Europe’s largest Linked…

Grasping Concepts through Implementations

I sometimes write code to learn things not at all related to code or technical concepts. It can be an implementation of a concept in math or even a Resting Metabolic Rate calculator. I used this technique quite a lot back when I was in school. Below I’m providing an example I found while looking through old hard drives during the holidays. It’s Python implementation of the basics of complex…

A Five Minute Hack

Click the link or type runes.rocks into your web browser and you will be directed to a random article about a rune inscription or runestone. I love small ideas and experiments. They are cheap they scale from a few hours to a few moths. An example I’m often refer to is Kyrksok.se a site we build a few years ago in less then two days . However runes.rocks and the Swedish version runor.rocks sets a…

I Created Another On this Day API

There are multiple “On this Day” APIs built on top of Wikipedia but I created yet another one. This API can be used to retrieve birth, deaths, and events for any given day of the year. The reason for building this was that I wanted something stable with support for things like Cross-Origin-Requests and SSL. The need wasn’t actually mine. A friend of mine sees the potential of “On this Day”…

Rounding Colors with Colorsnap

While working on an evaluation of Generous Interfaces in the GLAM sector at the Swedish National Heritage Board we extracted colors in images to make them searchable by their palettes. For usability reasons we wanted to limit the extracted colors to a comprehensible palette. Colorsnap is a Python package for snapping/rounding colors to other colors/palettes. Although I could find plenty of…

A Web App for Browsing Sign Languages on Wikidata

I recently built a web app for browsing and learning sign languages. The original goal was to build an interface on top of SparQL and showcase sign languages content on Wikimedia Commons. This weekend I finally took the time to deploy it. You can try it out here .

7 Online Web Development Tools I Use

Seven of my favorite online tools for web development. Coolors I do not think that the Coolors app helps me enough when it comes to selecting a palette for my next project, but hey, we can’t expect that. With its great user experience and useful sharing options it’s my go to tool for creating or sharing color palettes. RegExr RegExr does not only have great UI for writing and testing Regular…

Cache Busting Wikidata SparQL Queries

UPDATE: By setting a cache-control: no-cache header you can disable this query caching. The problem Whenever you write a Wikidata query form which you do not expect the result to be the same each time, you will run into the issue of caching. Lets take the following example, returning a random cat: SELECT ?item ?itemLabel (MD5(CONCAT(STR(?item), STR(RAND()))) as ?random) WHERE { ?item wdt:P31…

Mapillary 2 Commons: A Tool for Easy Image Exporting

Read this post on The Mapillary Blog.

Build Something with K-samsök and Python

Last week I took a day to do a bit of open-source maintenance, fixing bugs, writing documentation, tests, etc and definitive no new features. One of the things I did was to write documentation for my K-samsök Python library KSamsok-PY. It’s a port of KSamsok-PHP which I have written a lot about. Nowadays, I have a local setup of kulturarvsdata.se (the repository behind K-Samsök), so the libraries…

Kyrksok.se gets a VR Viewer

Kyrksok.se is a directory for churches in Sweden that was originally created last autumn over a weekend . Last week I took the opportunity to add a VR Viewer for 360 degrees photos to the site. It’s primarily built on top of three.js and WebVR-UI and you can try it out here . It’s using the WebVR API behind the scenes if you have a headset or Cardboard if not there is a fall-back for mouse and…

Extending Native Context Menus with HTML 5.1 <menu>

One thing that annoys me when using the web is when some developer decided to do preventDefault() on contextmenu to replace the native context menu with some shitty app specific one, blocking my access to thing such as spellcheck, plugins, and search. It’s something I believe should be avoided whenever possible. Therefor I’m a fan of the possibility to extend the native one. It should be noted…

Playing with Service Workers

I’m on a learning spree targeting web technologies, recently I played around with Service Workers adding functionality to some of my existing projects. One of the projects I enchanted with offline support was my “ bookshelf ” a web app for browsing and searching the books I own. It’s a simple static site reading the contents from a single JSON file witch I update every now and then. Two…

VirtualBox&#58; Extending the Storage Size of a VM

I spend way to much time in a Virtual Machine, I always give them to little storage and I always find myself searching the web for a solution to increase the storage of a particular VM. This is my attempt to learn it for real once, or at least have all the information in the same place for future my needs. Note: this solution only works for VDI/VHD files and before attempting this you should…