detfalskested

Microservices

“Everyone is doing microservices, yet we have a single Django monolith maintained by just a few engineers, and a MySQL instance - what are we doing wrong?”. The answer is almost always “nothing”.

Læs mere hos Renegade Otter (via Carlton Gibson)

Keep It Live

Om Human League's album Dare:

The rock establishment were horrified at the lack of conventional instruments and a bitter debate developed over fears that the new technology would banish guitars forever. In a move against synths, the Musician's Union even began a campaign in the light of Dare called 'Keep it Live'. They believed that the keyboards could compose melodies 'at the touch of a button' thus making session musicians redundant.

Musik at lægge sig ned og dø til

Jeg var på ferie i Slovenien i sidste uge. Med meget få undtagelser blev der på cafeer og restauranter spillet covermusik. Jeg går ud fra det handler om rettigheder og er et kneb for at slippe for at betale (fuld pris) for at spille musik i det offentlige rum.

Enkelte steder var det tilnærmelsesvist anstændige covers, hvor de udøvende tilsyneladende forsøgte at bidrage med noget anderledes i deres fortolkning. Men de fleste steder var det decideret rædsomt.

Især på en bestemt cafe – hvor vi kom for skade at sætte os for at drikke eftermiddagskaffe – var det slemt. Det var tydeligvis en playliste af numre der var lavet netop til formålet[1], at kunne spille covermusik i stedet for originalerne. Primært bossa nova-versioner af nyere(ish) hits, komplet blottet for sjæl og følelser. Et af disse numre, et cover af The Weeknds Blinding Lights, har – til stor frustration – rumsteret i mit hoved siden da.

Jeg antager at playlisten hed Musik at lægge sig ned og dø til eller noget i den stil.

[1] Efterspørgslen på covermusik har givetvis skabt en hel industri, hvor numre køres ud på samlebånd.

A more advanced case for opening feed items externally from Newsboat

I am using Newsboat as my RSS reader. I have it running on my home server, which will periodically update the feeds I have subscribed to. And then I have a local script that will SSH into it from whatever computer I'm sitting at. I really like this setup. But I ran into an issue that took some time to solve.

Newsboat is super powerful and can be configured in a ton of different ways. You can read the feed content directly in it. Or you can open the feed item URLs in an external browser. Most of my reading needs are covered by making "open w3m in a vertical tmux split, next to Newsboat" as my "open in browser command".

But once in a while, the things I'm reading has important images embedded in them or other visual elements that a browser in a terminal does not render well. In these cases I prefer opening the URLs in the Firefox running on the machine I'm physically sitting at, from which I SSH'ed into the server running Newsboat.

Sure, this can be done by clicking or copy/pasting the URL from Newsboat in the terminal. But one of the points of using Newsboat is to keep my hands on they keyboard as much as possible and leave the mouse alone. I solved this with the macros in Newsboat.

With a macro, you can string together several commands, thus achieving more complex tasks than just "open" or "mark read". So I created the following macro:

macro f set browser "ssh localhost -p2221 DISPLAY=:0 firefox %u"; open-in-browser ; set browser "tmux split-window -hb -l 80 w3m %u"

What it does is:

This, of course, requires a reverse port forward in the SSH connection, but I have build this into the Newsboat script I'm running locally to open the SSH connection, so I never have think about this. it also does other things, which I will cover later.

Thus, by typing ,f in Newsboat, I can open the current feed item in my local Firefox, without taking my hands off the keyboard. Neat!

But this stopped working a while back. And I never got around to trying to fix it until now. I was getting this error:

Authorization required, but no authorization protocol specified
Error: cannot open display: :0

After a bit of searching the internet, it turned out that I need to specify an XAUTHORITY environment variable along with the one for DISPLAY. This should point to an authority file, which used to be located at $HOME/.Xauthority. But (it seems) after Ubuntu switched from X to Wayland, this is no longer the case.

Instead I found out mine is located at /run/user/1000/.mutter-Xwaylandauth.RPLA81. The "RPLA81" suffix indicates that this occasionally changes (after a reboot or what do I know) and probably also varies across computers. So I didn't want to just copy paste this value in. Instead, I expanded the SSH command to include another SSH call to the remote server, in order to determine the location of this file:

ssh localhost -p2221 XAUTHORITY=`ssh localhost -p2221 ls /run/user/1000/.mutter-*` DISPLAY=:0 firefox %u

And now my Newsboat macro works again, yay!

For the full picture, my local script for starting Newsboat remotely via SSH looks like this:

ssh remote-server -R 2221:localhost:2222 -t \
    "tmux -2 new-session -d -s newsboat; tmux -2 a -t newsboat \; new-window \
    'newsboat || (echo \"Unable to start newsboat. The reload cron job is \
    probably running. Try again in a few seconds.\" && read -s OKAY)' \; \
    swap-window -s 1 -t 2 \; kill-window -t 2"

Apart from setting up the reverse port forwarding, it also makes sure to run Newsboat in a tmux session called "newsboat", preparing the whole things for the tmux splits I previously talked about.

I consider this a prime example of using software following the Unix philosophy ideas write programs that do one thing and do it well and write programs to work together: By mixing ssh, tmux, w3m and even firefox together in the right way, I have a super useful setup for reading whatever my feeds bring me.

Dear Billy

Max Alper svarer en af sine tidligere studerende, der er depressionsramt og ser sig selv som en kunstnerisk fiasko:

Look at your favorite artists, alive or dead, the ones who you have always aspired to be as a professional. Chances are they have had one of three types of musical careers. Every professional musician I’ve met has fallen into one of these macro categories. I know it seems like an overgeneralization, but it continues to prove itself to be tried and true in my experience, so just hear me out.

Læs forhistorien og resten af Max's rørerende svar hos Klangmag (via @elsemusic)