binfalse
Say »Hello« to Staticman
February 20th, 2020Recently, I stumbled upon Staticman, which seems like a nice solution for comments on static sites (such as this). Today I implemented Staticman into binfalse.de :)
The idea is, that you have your static site version controlled at GitHub. Then you can add the Staticman App to your repository and add some configuration file, so Staticman knows where and how to save the comments. Also add a form to your static site, that sends the commenting user with the form values to an API page of Staticman.
Staticman will then create the necessary YAML files and send you a pull request to the corresponding repository. Thus, you only need to accept the PR and your site will rebuild with the new comment. Pretty smart I think :)
Integrating Staticman is pretty easy. Just follow the step-by-step guide at staticman.net/docs/index.html.
In contrast to many other approaches you still own the comment and don’t need to load it from some third party. The only privacy concern is, that users need to contact the Staticman API for sending the form values. However, that seems to be rather harmless compared to what is the default out there… As it’s still a concern, you can always use any of the other options to send comments. I’ll keep listing them above the comment form. Thus, it’s up to the user what’s more convenient/important :)
If you’re curious, I’d be happy if you give it a try!
Migrating from sSMTP to msmtp
February 17th, 2020As I described earlier, I’ve been using sSMTP for email support in Docker containers. Unfortunately, sSMTP is not maintained anymore. Instead msmtp should be used. I put the migration off for as long as possible, but eventually implemented the change!
For legacy reasons I will leave my orginal articles about sSMTP
untouched (I’ll just add a link to this page), and instead post this migration how-to.
Given
Let’s assume we’ve been using the following sSMTP
config in /etc/ssmtp/ssmtp.conf
:
In addition, we somewhere needed to tell the system/software/module how to send mails.
For example, for PHP it would be somthing like that in /usr/local/etc/php/conf.d/mail.ini
:
Then
In that case you would need a msmtp
configuration in /etc/msmtprc
:
In addition, you need to tell the system/software/module send mails via /usr/bin/msmtp -t
.
For example, for PHP it would be somthing like that in /usr/local/etc/php/conf.d/mail.ini
:
Please note that msmtp
is in /usr/bin
not /usr/sbin
!! ;-)
Supplemental Material
- The paths mentioned above are target paths. Thus, if you’re using Docker it actually doesn’t matter where you store the files, but you need to mount them to those paths inside the container..
- There are much more options for msmtp! You can also configure an actual mail account at Posteo or Google or wherever. I recommend checking its documentation and Arch’s Wiki.
Jekyll throwing Strange Error at library.rb:112
February 7th, 2020Just had a strange error when renbuilding one of the websites I’m in charge of.. Pretty quickly it turned out, that Jekyll was broken..!? Ruby itself was running as usual, but I couldn’t even ask Jekyll for its version.
The error was very cryptic and didn’t provide any hint on how to fix things.
The internet also didn’t help much, that’s why I’m logging it here.
I just managed to fix it by chance: A (rather unsimilar) bug report was talking about sassc
.
As I did not have an idea on how to approach the problem, I just tried (re)installing the tool.
And it did the trick…!? Not sure why, and not sure why it wasn’t installed as a dependency with Jekyll, or …!?
However, running
did fixed it for me (patch for the corresponding Docker image).
Update
The above didn’t actually fully-solve the problem.
It just re-installed sassc
locally, which fixed the issue in the container on the current platform.
However, when I compile the very same image at the Docker Hub and pull the new version it’s broken again..!?
The sassc
compilation product seems to be plattform dependent!? #wtf
Anyway. I finally got it fixed by installing sassc
using --disable-march-tune-native
, see also github.com/sass/sassc-ruby/issues/146:
The updated patch for my Docker image is available from GitHub.
Log
Maybe that can be of help for somebody else? Here is the full error that was thrown:
Practical Challenges of Interdisciplinary Teamwork
October 4th, 2019Working in an interdisciplinary field is my vocation. I am a Bioinformatician – my whole education was shaped by an interdisciplinary nature. I get paid by the University of Rostock, which is also everything but straight forward: Part-time I am working as a systems engineer for the institute of computer science, the other time I’m working at the department of systems biology and bioinformatics (SBI). Thus, I have two desks at the university, which are approximately 2km away from each other. At these desks I am doing hardcore IT stuff and/or/xor applied computer science in various projects and roles. My colleagues are again purely non-pure: There are computer scientists from Italy, mathematicians from India, medical biotechnologists from Canada, neurobiologists from Germany, computational engineers from Pakistan, and so on.. At one desk I am talking in English, at the other everyone’s expecting German (including complaints about anglicisms)..
Here I’m just jotting down some experiences from the recent past to increase the awareness of the complexity on the meta-level of interdisciplinary and intercultural collaborations.
Different Cultures…
Pretty early I learned about the issues when working across different domains, languages, and cultures. For example, a yes from a German to Do you understand what I just explained? typically means (s)he understood what I just explained. However, some cultures would not publicly admit a lack of understanding. Thus, my colleague will say (s)he understood and then go away to actually do the opposite.
Some time ago, I offered a beer to an Asian friend. He denied and so he did not get one. Months later he confessed that he has been suffering, watching me enjoying the cold beer – as he desperately wanted a beer as well! But in his culture you wouldn’t immediately take something offered. Instead he wants to be persuaded into a beer…
Hence, a no does not necessarily mean no. And vice versa, if he offers me some tea or sweets, he would not take my no for granted, but would offer the sweets again and again ;-)
Different Languages…
Such contradictions are not necessarily a cultural issue, but it is sometimes due to the language: If our mother tongues differ we are typically falling back to English, which is then a foreign language for both dialogue partners. Consequently, everyone struggles expressing and grasping thoughts. This entails a good potential for misunderstandings. In addition, there may be a clash of domain languages – experts from different fields think in orthogonal concepts or use the same words differently.
I recently had a kitchen-conversation with a biophysicist from Iran about PCR: The polymerase chain reaction. For quite some time I thought he must be drunk, because it did absolutely make no sense what he was talking about. Until I realised, that he was actually talking about PCA: The Principal Component Analysis! Both, PCR and PCA would have made sense to chat about with him and the pronunciation of the German A (
ʔaː
) and the English R (ɑːr
) is quite similar..
There are many similar confusions. At our department, for example, PSA is used for a public service announcement or for a prostate-specific antigen – that’s not always crystal clear. Similarly, APT is an abbreviation for apartment at one of my desks, while it may mean advanced persistent threat or that someone is talking about Debian’s package manager at the other desk.
Different Tools…
However, it is not only about languages, but also about best-practices in different domains! People from diverse disciplines learnt to use diverging tools and workflows, that sometimes seem crazy from the opposite perspective.
Not long ago, we built a website in an interdisciplinary project. The developer drafted some text for the webpage and asked the others to review the wording and correct typos – assuming to get a pull request, as the sources are shared on a common code platform. However, the response was an email with a
.docx
attachment: The whole text of the web page was copied to Microsoft Word and then corrected using track-changes! Which in turn caused further trouble with the developer, who’s not used to work with Microsoft’s office… ;-)
Indeed, that happens all too often!
The other day, someone sent an email
Please kindly find the attached file, the first draft of workflow.
I am looking forward to your feedback.attached was a file
Präsentation2.pptx
. That, of course, made the tech-guy’s hair stand on end! Powerpoint to draw figures? A meaningless file name with German diaeresis (Umlaut)? And the2
in the file’s name explains everything about how the documents are versioned..
And so goes the whole communication between the experts from different domains. While some always communicate through tickets on the coding platform, others will respond with attachments to emails or using some other channels (such as Twitter messages or whatever chat protocols). Consequently, you are spending a significant amount of time on searching, jigsawing, and puzzling messages.
Different Times…
The communication becomes even more difficult if the partners are located in different time zones. Obviously, there is then less overlap in working hours.
When I write an email to a collaborator in New Zealand, he will typically receive it around the middle of his night and answer in the middle of my night. For a call, we need to schedule a meeting which is out-of-office-time for both of us.
Consequently, decisions, that would have been made in a few minutes during a f2f meeting, can take several days of discussions.
Different Goverments…
Working across different time zones typically also implies working across loyalties. My collaborators may need to comply with very different laws – or they may be affected by other absurd rules!
In a recent project we decided to use one of these big American platforms to facilitate our collaboration. Suddenly, it turned out that some people in the team cannot access the platform anymore. Even though they did nothing wrong, a wigged carrot on steroids violently banned them with embargos or sanctions. Including all consequences.
Such things are simply unpredictable, but have serious impact on the collaboration.
Ergo… Stop?
With all these difficulties, should you stop interdisciplinary teamwork? Certainly not!! Instead, be aware of these challenges and budget some extra time
- to learn how to speak to one another without confusion,
- to acknowledge the complexity on the meta-level of interactions, and
- for unexpected interruptions.
Despite all the difficulties, it’s great to work in diverse teams! Even though it drove me crazy multiple times, I learnt to appreciate decelerations. Different skills, contradictory perspectives, and orthogonal peculiarities entail many discussions and cost a great deal of energy, but almost always improve the quality of the product.
In addition, and maybe more importantly, working in an interdisciplinary field expands your horizon and you will learn things you cannot imagine.
A recent visitor from Hong Kong exchanged insights about the current protests in his home country. I had a conversation with two colleague from India and Pakistan about the Kashmir conflict. And I actually felt the effects of embargos - which are otherwise far away from Germans..
However, the outcome is absolutely worth the “trouble” ;-)
Dockerising Contao 4
July 17th, 2019Last year, we moved the website of our department from Typo3 to Contao version 3. I wrote about that in Dockerising a Contao website and Dockerising a Contao website II. Now it was time to upgrade from Contao version 3 to 4. And as usual: Things have changed… So, how to jail a Contao 4 into a Docker container?
Similar to Contao 3, we use two images for our Contao 4 site. One is a general Contao 4 installation, the other one is our personalised version.
A general Contao 4 image
The general Contao 4 is based on an PHP image that includes an Apache webserver. In addition, we need to
- install a few dependencies,
- enable some Apache modules,
- install some extra PHP extensions,
- install Composer,
- and finally use Composer to install Contao.
This time, I outsourced the installation of Composer into a seperate script install-composer.sh:
Thus, you’ll find a current composer installation in /composer
.
The Dockerfile for the general image then boils down to the following:
PLEASE NOTE: sSMTP is not maintained anymore! Please switch to
msmtp
, for example, as I explained in Migrating from sSMTP to msmtp.
This image includes the package for sSMTP to enable support for mails. To learn how to configure sSMTP, have a look into my earlier article Mail support for Docker’s php:fpm.
Alltogether, this gives us a proper recipe to get a dockerised Contao 4. It is also available from the Docker Hub as binfalse/contao.
A personalised Contao 4 image
Based on that general Docker image, you can now create your personalised Docker image. There is a template in the corresponding Github repository.
A few things worth mentioning:
- After installing additional contao modules, you should clear Contao’s cache using:
- Contao still does not respect the
HTTP_X_FORWARDED_PROTO
… Thus, if running behind a reverse proxy, Contao assumes its accessed through plain HTTP and won’t deliver HTTPS links. I explained that in Contao 3: HTTPS vs HTTP. However, the workaround for Contao 3 doesn’t work anymore - and there seems to be no proper solution for Contao 4. Therefore, we need to inject some code into theapp.php
… Yes, you read correctly… Ugly, but anyway, can easily be done using:
- The composer-based installation apparently fails to set the files’ links. Thus we need to do it manually:
Everything else should be pretty self-explaining…
Tying things together
Use Docker-Compose or whatever to spawn a container of your personalised image (similar to Contao 3: Docker-Compose).
Just make sure, you mount a few things correctly into the container:
- your files need to go to
/var/www/html/files
- Contao’s configuration belongs to
/var/www/html/system/config/*.php
, as usual - Symfony’s configuration belongs to
/var/www/html/app/config/parameters.yml
and/var/www/html/app/config/config.yml
- For the mail configuration see Mail support for Docker’s php:fpm
Please note, that the database connection must be configured in Symfony’s parameters.yml
! Instead of Contao’s localconfig.php
, as it used to be for Contao 3.