Diary

Welcome! :-)

This is both a wiki (a website editable by all) and a blog (an online diary about the stuff Alex Schroeder reads and does). If you’re a friend or relative, you might be interested in reading Life instead of this page. If you’ve come here from an RPG blog, you might want to head over to RPG. There are other similar categories to be found on the SiteMap.

Für Rollenspieler gibt es ebenfalls eine eigene RSP Kategorie.

2016-05-28 nginx as a caching proxy

Remember the fiasco at the end of 2014 and the beginning of 2015, when Emacs Wiki was down as I tried to switch to Fast CGI, and it kept staying down as I tried to use mod_perl, when finally Nic Ferrier stepped in and started paying for new hosting. He used nginx as a caching proxy for Apache, which continued to call the wiki as a simply CGI script.

The comments reveal quite a bit of caching issues, though. The problem was that nginx seemed to ignore that two pages with an identical URL but for different language preferences could be different. This in turn meant that a German visitor to page not in the cache would put the page in the cache but with German menus at the bottom, for example (“Diese Seite bearbeiten” instead of “Edit this page”). And if the next visitor to the same page didn’t understand German, this was annoying.

I thought the answer was that Apache should send the “Vary” header telling the cache that accept-language should be part of the cache key. See this discussion of the Vary header, for example: Understanding the HTTP Vary Header and Caching Proxies. But it just didn’t work.

Recently, I suddenly realized that perhaps nginx doesn’t care about the Vary header Apache is sending. I learned about the proxy_header_key setting in the nginx caching guide. As you can see, the default is inadequate! $scheme$proxy_host$request_uri is not what I’m expecting. I needed to add http_accept_language to that key:

# proxy cache key is $scheme$proxy_host$request_uri by default
proxy_cache_key $scheme$proxy_host$request_uri$http_accept_language;

I get the feeling that things are working, right now! If so, it only took 17½ month to find the solution. I’m writing it down in case anybody else stumbles over this problem (and in case I need to remember in the future).

Perhaps the problem is also related to how I compute Etags for my pages: the wiki doesn’t take accept-language into account when computing Etags. Now that I think about it, perhaps that would also have helped solve the problem?

Tags: RSS RSS RSS RSS

Add Comment

2016-05-28 Blog Design

Edward Morbius just linked to Designing blogs for readers, on Google+. Or, as Edward puts it: “Designing Blogs Websites for Readers”. I felt that many of his points had been on my mind as well and that encouraged me to take a few more steps:

  1. getting rid of the big RSS symbols for some of the big categories; auto-discovery will handle this
  2. getting rid of the small RSS symbols at the end of new blogs posts (the HTML cache for old blog posts will keep these around for a long time)
  3. a link to all the posts I made in the same month; sometimes this has been useful for trips, but usually using a tag would simply be better

Then again, I think I’m going to keep comments.

Tags:

Add Comment

2016-05-27 Über die Kirche

Die Frage nach der Zukunft der Kirche bleibt spannend. Via Facebook stiess ich auf den Artikel Tut um Gottes willen etwas Tapferes! zum Thema Kirchenaustritte und Reform.

In meinem Umfeld waren die Austritte vor allem durch das Geld (Kirchensteuer), die Kindermissbrauchskandale, und die Korruptionsskandale motiviert. Selbst dort, wo der Zusammenhang klar nur für die katholische Kirche gegeben ist (Spotlight, Vatikan AG), warf man irgendwie alle Kirchen in einen Topf. Die Marke “Kirche” funktioniert nicht gut.

Auch als Identitätsstifter sehe ich überall Probleme: Ich kannte nur eine Person, die regelmässig in die Kirche ging, und sie ist dieses Jahr ausgetreten. Ich kenne ein paar Leute, die kirchlich geheiratet habe, aber mir schien das jeweils auf Druck der älteren Familienmitglieder zu geschehen, nie aus eigenem Antrieb; und auch was das Wissen selber anbelangt, ist die Situation beängstigend: kaum jemand kennt die Bibel, Referenzen werden nicht verstanden, selbst wenn es Klassiker sind (in den letzten Wochen musste ich zum Beispiel Hiob/Ijob, die Zehn Plagen und Palmsonntag erklären), auch die Kirchengeschichte ist den meisten Leuten ein Rätsel und keiner weiss mehr, was der Grund für die Spaltung der Kirche in Ost und West ist, was Nestorianismus, Arianismus, oder Monophysitismus ist, was die Anglikanische Gemeinschaft ist, und vieles mehr. Und ich interessiere mich ja eigentlich auch nur am Rande dafür, bin ja Atheist und nicht getauft. :-)

Aber wenn ich mehr weiss als die Kirchenmitglieder, habe ich auch meine Zweifel. Wenn ich allerdings die Photos zu The Mass Is Ended anschaue, bin ich gar nicht so traurig. Die Bilder haben einen eigenen Charme.

Tags: RSS

Add Comment

2016-05-27 Krank

Vorgestern hatte ich Halsweh. Gestern bin ich zuhause geblieben, Schnupfen mit verstopfter Nase und jede Menge Kopfweh. Heute ist der Schnupfen nicht ganz so schlimm, aber die Nase tropft pausenlos und aus den Augen quellen Tränen ohne Zahl. Habe ich Schnupfen und Heuschnupfen gleichzeitig?

Dabei hatte ich doch jetzt gerade etwa einen Monat Ruhe…

Tags: RSS RSS

Add Comment

2016-05-26 Proletariat, Precariat, Unnecessariat

The best explanation for the rise of Trump: Unnecessariat.

The Unnecessariat is not like the Proletariat of old, the people who worked hard, nor the Precariat, the people who feared for their jobs but worked. The Unnecessariat are the rest of us. No job, no hope, no future. I remember seeing the first glimpse of that as I watched the movie Winter's Bones (2010). White trash and Meth.

I also like the long arc the Unnecessariat story takes. Gay men dying of AIDS. The economy is not coming back. You can practically hear Bruce Springsteen singing about the post-industrial landscape. Politics for the rich. New tech gadgets for the rich. Tesla! Mars! iPad! For the rich… The rest are simply – unnecessary. No matter who they vote for. But if they vote Trump, at least we'll all go down in flames.

Hello, Hofer, Petry, Le Pen, Orbán. Blocher.

So much posting today. I am alone at home, with a cold. It’s sad, really.

Tags: RSS RSS

Comments on 2016-05-26 Proletariat, Precariat, Unnecessariat

Erkältet? Aber nicht alleine! lese jeden Satz und denke ähnlich.

Chris 2016-05-28 12:54 UTC

Add Comment

2016-05-26 Direct Democracy

Living in Switzerland, I found that reading Referendumania: Direct democracy is spreading across Europe. That is not always a good thing is a teeth grinding experience.

They write, for example: “But the recent referendums are not just wholesome exercises in civic engagement. They also reflect widespread alienation from politics and anger at the governing class. Support for old political parties has withered, while populist, anti-EU parties are gaining ground. Governments derided as elitist and out of touch find it hard to resist calls to submit controversial issues to a popular vote.” It’s hard for me to understand what point they are trying to make. The problem seems to be widespread alienation from politics and the implied solution is to keep people away from politics?

Or: “Still other referendums are pushed by single-issue groups, often with an anti-EU slant. The Dutch Ukraine vote was launched by Eurosceptic activists taking advantage of a new law that grants a referendum on any issue that can attract 300,000 supporting signatures. The vote became a proxy for discontent with the EU, not just the trade deal.” The problem seems to be discontent with the EU. The article is such that its tone seems to imply that more referendums are a problem, but the actual supporting facts they provide seem to indicate that widespread discontent with current politics is the real culprit, here. It is written from the point of view of a political establishment that sees their power base crumble. The countries lie in ruins, people no longer have faith in the future. Will the pension system still be around when we’re old? Will there be jobs for us when we finish our schools and universities? People are realizing that even if you win the rat race, you’re still a rat!

“For a start, it makes it increasingly hard to agree on transnational policies. Treaties are generally signed by governments and then ratified by legislatures. Adding referendums to the mix hugely complicates matters.” Oh no! Complicated issue is complicated!

“In countries such as Switzerland, the political system has adjusted to them. But elsewhere, […], they tend to make politicians look as if they do not know what they are doing.” Because, in actual fact, they know what they are doing? Sometimes I wonder.

I was reminded of Diese besorgten Bürger werden uns zugrunde richten by Kattascha: “Wir sind die Champions Europas. Aber wer ist eigentlich wir? Der Durchschnittsverdiener, der mitgeteilt bekommt, dass seine Rente für nichts reichen wird? Die Alleinerziehende, die sich von Monat zu Monat durchschlägt und abends auf der Couch erschöpft und traumlos einschläft? Die Pflegerin, die insgeheim hofft niemals bei ihrem Arbeitgeber in Pflege gegeben zu werden, weil längst nach Minuten und nicht nach Bedürfnissen abgerechnet wird? Die Wahrheit ist doch die: Deutschland sagt nicht Sorry für die Agenda 2010. Für Rentenkürzungen. Für Riester-Disaster. Denn Deutschland geht es doch so gut. Nur wird für viele immer klarer: Wir sind nicht dieses Deutschland. Und werden es auch nie sein.”

Tags: RSS RSS RSS

Add Comment

2016-05-26 Die Zukunft der Überwachung

Sascha Lobo schreibt Überwachungstechnik in Extremistenhand: Nazis am Abzug und untertitelt wie folgt: “Von Angst getrieben haben Demokratien die machtvollsten Überwachungsinstrumente aller Zeiten erschaffen. Jetzt könnten sie in die Hände von Egofaschisten wie Trump oder der xenophoben Rechten fallen.”

Meine Befürchtungen werden oft damit abgetan, dass wir ja keine Diktatur seien. Aber dass es so bleibt, ist natürlich kein Naturgesetzt – und erst recht nicht, wenn man so schaut, wie erfolgreich gewisse autoritäre Kandidaten an den Wahlen abschneiden. Gruselig!

Die “chilling effects” bemerke ich schon lange: es fängt an mit einem Link, den man sich nicht zu klicken traut, weil die Firewall des Arbeitgeber vielleicht mitprotokolliert, dann reisst man das Maul nicht mehr so weit auf, wenn man in der nächsten Zeit vor hat, in die USA zu reisen, dann lässt man den Laptop doch lieber zuhause, weil vielleicht sonst die Material gefunden wird, welches in der Schweiz legal runter geladen werden darf, im Ausland aber nicht, und früher wäre das ja kein Problem gewesen, aber jetzt gibt es vielleicht eine Chance, dass der Laptop durchsucht wird, dann traut man sich nicht mehr, das Anarchist Cookbook runter zu laden, obwohl das zu meiner Uni Zeit noch wie ein Initiationsritual auf mich wirkte, dann klebt man mal die Kamera vom Laptop zu, blickt misstrauisch zur Kamera in den Zügen hoch und fragt sich, ob uns da jetzt jemand beim popeln in der Nase zuschaut und am Ende räumt man dann die Handys weg, wenn man über heikle Aspekte vom Geschäft reden will. Nachfolgend ein älterer Artikel aus der WOZ von Carlos Hanimann: Staatliche Überwachung: Was hat das mit mir zu tun?

Tags: RSS RSS

Add Comment

2016-05-22 The real problems with genetically modified organisms

Scot Stevenson linked to Genetically Engineered Crops Are Safe, Analysis Finds and I left a comment on Google+.

My take is that the situation is similar to nuclear power plants. The core technology may be safe, I just don’t trust the people and business practices around them.

In terms of GMOs, my main problem is that they encourage monoculture because they enable monoculture. But, like the use of antibiotics in raising animals, that’s just a single round in the ever turning wheel of resistances pathogens, parasites and weeds acquire. Antibiotics pose an addition risk because the animals pee them into soil, and so the resistances spread. I don’t think that’s a problem with GMOs, or at least, not that I know of. But monoculture is a problem. Once a parasite discovers a way around the defense we engineered, all of our crops are at risk. The result is a system that is very brittle and prone to catastrophic failures. Sadly, the natural defenses against this result in less profits: diversification of crops, smaller patches of land per crop.

In addition to the problem of monoculture and resistances are the problems of single supplier dependencies (Monsanto), the uncertain status of glyphosate (does it cause cancer or not?), and the adverse effect on our intellectual property systems when big corporations depend on tighter regulation. Big pharma is strengthening the patent system all over the world and big agro is following in their footsteps – here I am, wanting to reduce the reach of patents.

Tags: RSS RSS

Add Comment

2016-05-22 Running

I’m trying to start training for a longer running project: I want to run the 300km Jura-Höhenweg (national trail #5). If I want to run two or three days in a row, I need to be able to run 10 to 20 km for three days in a row. Time to start practicing!

I’ve created a log file (a simple text file using Org mode for Emacs), I’m uploading data to the site tied to my wife’s watch (a Polar 3RC GPS), polarpersonaltrainer.com. I really don’t like all this proprietary stuff. What if they close it down? What if their WebSync app no longer works? (If you run into the problem that WebSync won’t install on your Mac because it is the product of an unidentified developer, you might be interested in learning more about Gatekeeper and ways around it.)

So, here’s what I did: I exported the GPX data from the Polar site and imported it to OpenStreetMap. Yay! The OpenStreetMap copyright page has some information about the license. But… I was unable to find a display of my trace with the map in the background. No way to create a useful screenshot for this blog.

And so I returned to the Polar site, which uses Google. And studied their terms of use, and clicked through to their permissions page and more about naming. I think I should be fine if I keep their copyright statement at the bottom, as far as I can tell.

https://alexschroeder.ch/pics/running/Screen%20Shot%202016-05-22%20at%2021.39.28.png

Today I found this question in the FAQ: How can I display a GPS trace on a real map? Apparently, a quick way to do it is to open the trace in the map editor. They hope that you’ll use the trace to improve the map, of course. Let’s see whether I’ll be joining the mapping community. :)

https://alexschroeder.ch/pics/running/Altstetten%20to%20Bonstetten.png
© OpenStreetMap contributors

Tags: RSS RSS

Add Comment

2016-05-18 Renaming Files

I had a bunch of files named like this, from various albums.

Cure - [1984] The top - 01 - Shake dog shake.mp3
Cure - [1984] The top - 02 - Bird mad girl.mp3
Cure - [1984] The top - 03 - Wailing wall.mp3

I wanted to move them into subdirectories, one for each album.

(dolist (file (directory-files "c:/Users/asc/Music/The Cure" t "\\.mp3$"))
  (let* ((name (file-name-nondirectory file))
	 (data (split-string name " - "))
	 (album (nth 1 data)))
    (unless (file-directory-p (concat "c:/Users/asc/Music/The Cure/" album))
      (make-directory (concat "c:/Users/asc/Music/The Cure/" album)))
    (rename-file file (concat "c:/Users/asc/Music/The Cure/" album "/" name))))

Tags: RSS

Comments on 2016-05-18 Renaming Files

If your files have ID3 tags, you can do some thing like this, too:

exiftool '-filename<${Artist;} - ${Year} - ${Album}/${Track;} ${Artist;} - ${Title;}.%e' **.mp3

– Sam 2016-05-18 11:54 UTC


Nice! And using exiftool! :)

– Alex Schroeder 2016-05-18 13:17 UTC


A graphic alternative is exfalso (from quodlibet music player).

– Anonymous 2016-05-19 09:58 UTC


Here is a way to do it combining dired, wdired and multiple-cursors. This approach requires the existence of the album directory which might not make it particularly useful for your exact use case. Still, I find it cool and so should you :-).

Damien Cassou 2016-05-19 18:10 UTC


Very cool. And a nice video on top. Thumbs up!

– Alex Schroeder 2016-05-21 06:33 UTC

Add Comment

More...

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit this page if you need to fix typos. You can subscribe to updates by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.

Referrers: Planet Emacsen The City of Iron: Fatigue based spellcasting in old-school D&D Gothridge Manor Strange Magic: 5 Tips for Horror in D&D Dreams of Mythic Fantasy wikicreole.org/wiki/AlexSchroeder