+
+
+
+
\ No newline at end of file
diff --git a/_posts/til/2023-04-19-running-python-in-cron-in-docker.md b/_posts/til/2023-04-19-running-python-in-cron-in-docker.md
index a0beeee..5e0c2a7 100644
--- a/_posts/til/2023-04-19-running-python-in-cron-in-docker.md
+++ b/_posts/til/2023-04-19-running-python-in-cron-in-docker.md
@@ -49,7 +49,7 @@ You can then add this to the top of your Python script, as follows:
```
#!/usr/bin/local/python3
```
-## 3. Still missing dependecencies
+## 3. Still missing dependencies
Some modules will still run into errors even when the PYTHONPATH variable has been set. In particular, I ran into problems with `reportlab` and `Pillow/PIL`:
```
ImportError: cannot import name '_imaging' from 'PIL'
diff --git a/_site/blog/2023/01/14/musings-on-the-cinema/index.html b/_site/blog/2023/01/14/musings-on-the-cinema/index.html
index 898ca7f..1110f48 100644
--- a/_site/blog/2023/01/14/musings-on-the-cinema/index.html
+++ b/_site/blog/2023/01/14/musings-on-the-cinema/index.html
@@ -5,6 +5,7 @@
+
andrew conlin
@@ -52,6 +53,12 @@
+ Recently, I’ve been using multiple different languages and frameworks (both at work and personally) and I’ve been thinking about why I prefer some over others. Ultimately, I think it comes...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/cinema/index.html b/_site/blog/tag/cinema/index.html
index e69de29..d104617 100644
--- a/_site/blog/tag/cinema/index.html
+++ b/_site/blog/tag/cinema/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ I’ve realised that going to the cinema makes me sad; a quiet, contemplative melancholy. Ennui. No matter the film, something about the cinema experience is meditative for me. I always...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/copyright/index.html b/_site/blog/tag/copyright/index.html
index e69de29..f21ddf7 100644
--- a/_site/blog/tag/copyright/index.html
+++ b/_site/blog/tag/copyright/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ “For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/cron/index.html b/_site/blog/tag/cron/index.html
index e69de29..3742b8c 100644
--- a/_site/blog/tag/cron/index.html
+++ b/_site/blog/tag/cron/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/css/index.html b/_site/blog/tag/css/index.html
index e69de29..aff958f 100644
--- a/_site/blog/tag/css/index.html
+++ b/_site/blog/tag/css/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, I’ve been using multiple different languages and frameworks (both at work and personally) and I’ve been thinking about why I prefer some over others. Ultimately, I think it comes...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/docker-compose/index.html b/_site/blog/tag/docker-compose/index.html
index e69de29..76b05fc 100644
--- a/_site/blog/tag/docker-compose/index.html
+++ b/_site/blog/tag/docker-compose/index.html
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using...
+
+
+
+ I was trying to rescan the files in my Nextcloud server (running on Raspberry Pi 4 with DietPi), and kept running into some weird php errors. First error - “could...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/docker/index.html b/_site/blog/tag/docker/index.html
index e69de29..59d870f 100644
--- a/_site/blog/tag/docker/index.html
+++ b/_site/blog/tag/docker/index.html
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using...
+
+
+
+ I was trying to rescan the files in my Nextcloud server (running on Raspberry Pi 4 with DietPi), and kept running into some weird php errors. First error - “could...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/film/index.html b/_site/blog/tag/film/index.html
index e69de29..66faa9e 100644
--- a/_site/blog/tag/film/index.html
+++ b/_site/blog/tag/film/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ I’ve realised that going to the cinema makes me sad; a quiet, contemplative melancholy. Ennui. No matter the film, something about the cinema experience is meditative for me. I always...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/html/index.html b/_site/blog/tag/html/index.html
index e69de29..be27355 100644
--- a/_site/blog/tag/html/index.html
+++ b/_site/blog/tag/html/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, I’ve been using multiple different languages and frameworks (both at work and personally) and I’ve been thinking about why I prefer some over others. Ultimately, I think it comes...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/jekyll/index.html b/_site/blog/tag/jekyll/index.html
index e69de29..79f5458 100644
--- a/_site/blog/tag/jekyll/index.html
+++ b/_site/blog/tag/jekyll/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, I’ve been using multiple different languages and frameworks (both at work and personally) and I’ve been thinking about why I prefer some over others. Ultimately, I think it comes...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/journal/index.html b/_site/blog/tag/journal/index.html
index e69de29..18a1d51 100644
--- a/_site/blog/tag/journal/index.html
+++ b/_site/blog/tag/journal/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ I’ve realised that going to the cinema makes me sad; a quiet, contemplative melancholy. Ennui. No matter the film, something about the cinema experience is meditative for me. I always...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/kindle/index.html b/_site/blog/tag/kindle/index.html
index e69de29..67da3f7 100644
--- a/_site/blog/tag/kindle/index.html
+++ b/_site/blog/tag/kindle/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/law/index.html b/_site/blog/tag/law/index.html
index e69de29..7e94be4 100644
--- a/_site/blog/tag/law/index.html
+++ b/_site/blog/tag/law/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ “For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/love/index.html b/_site/blog/tag/love/index.html
index e69de29..ac4d8f0 100644
--- a/_site/blog/tag/love/index.html
+++ b/_site/blog/tag/love/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ “Like everyone, I have my own, maybe obsessive futile, maybe in some way authentic, vision: all of a sudden, I will imagine the entire homogenous world as it is revealed...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/nextcloud/index.html b/_site/blog/tag/nextcloud/index.html
index e69de29..e011fae 100644
--- a/_site/blog/tag/nextcloud/index.html
+++ b/_site/blog/tag/nextcloud/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ I was trying to rescan the files in my Nextcloud server (running on Raspberry Pi 4 with DietPi), and kept running into some weird php errors. First error - “could...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/php/index.html b/_site/blog/tag/php/index.html
index e69de29..645d589 100644
--- a/_site/blog/tag/php/index.html
+++ b/_site/blog/tag/php/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ I was trying to rescan the files in my Nextcloud server (running on Raspberry Pi 4 with DietPi), and kept running into some weird php errors. First error - “could...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/pluralistic/index.html b/_site/blog/tag/pluralistic/index.html
index e69de29..b08b2a0 100644
--- a/_site/blog/tag/pluralistic/index.html
+++ b/_site/blog/tag/pluralistic/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ “For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/python/index.html b/_site/blog/tag/python/index.html
index e69de29..2dd3ead 100644
--- a/_site/blog/tag/python/index.html
+++ b/_site/blog/tag/python/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/webdev/index.html b/_site/blog/tag/webdev/index.html
index e69de29..1c9b4d4 100644
--- a/_site/blog/tag/webdev/index.html
+++ b/_site/blog/tag/webdev/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ Recently, I’ve been using multiple different languages and frameworks (both at work and personally) and I’ve been thinking about why I prefer some over others. Ultimately, I think it comes...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/blog/tag/yuri-felsen/index.html b/_site/blog/tag/yuri-felsen/index.html
index e69de29..972147a 100644
--- a/_site/blog/tag/yuri-felsen/index.html
+++ b/_site/blog/tag/yuri-felsen/index.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ andrew conlin
+
+
+
+
+
+
+
+
+
+
+ “Like everyone, I have my own, maybe obsessive futile, maybe in some way authentic, vision: all of a sudden, I will imagine the entire homogenous world as it is revealed...
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/feed.xml b/_site/feed.xml
index d5f7173..d8df1b2 100644
--- a/_site/feed.xml
+++ b/_site/feed.xml
@@ -1,8 +1,8 @@
-Jekyll2023-05-01T17:31:05+01:00http://localhost:4000/feed.xmlLinks aren’t performances2023-04-29T00:00:00+01:002023-04-29T00:00:00+01:00http://localhost:4000/blog/2023/04/29/links-arent-performances“For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had posted, he infringed on copyright.
+Jekyll2023-05-03T21:25:52+01:00http://localhost:4000/feed.xmlAndrew ConlinLinks aren’t performances2023-04-29T00:00:00+01:002023-04-29T00:00:00+01:00http://localhost:4000/blog/2023/04/29/links-arent-performances“For starters, it finds that publishing a link can be a “performance” of a copyrighted work, which meant that when Linkletter linked to the world-viewable Youtube files that Proctorio had posted, he infringed on copyright.
This is a perverse, even surreal take on copyright. The court rejects Linkletter’s argument that even Youtube’s terms of service warned Proctorio that publishing world-viewable material on its site constituted permission for people to link to and watch that material.”
]]>Running a Python script periodically in a Docker container using cron2023-04-19T00:00:00+01:002023-04-19T00:00:00+01:00http://localhost:4000/til/running-python-in-cron-in-dockerRecently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using “Send-to-Kindle” feature (a blog post about this project is in the works).
+
]]>Andrew ConlinRunning a Python script periodically in a Docker container using cron2023-04-19T00:00:00+01:002023-04-19T00:00:00+01:00http://localhost:4000/til/running-python-in-cron-in-dockerRecently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using “Send-to-Kindle” feature (a blog post about this project is in the works).
I loved this idea, and thought it would be no problem to get a Python script up and running periodically on my Raspberry Pi home server using cron. However, I ran into various issues along the way (some of which were not so easy to resolve), so I’m collating all the configuration changes I made in the hopes that it will be useful to someone one day. You can find the full repo for this project here, and I have also included my Dockerfile, docker-compose.yml and crontab at the end of this TIL.
@@ -34,7 +34,7 @@ which python3
You can then add this to the top of your Python script, as follows:
#!/usr/bin/local/python3
-
3. Still missing dependecencies
+
3. Still missing dependencies
Some modules will still run into errors even when the PYTHONPATH variable has been set. In particular, I ran into problems with reportlab and Pillow/PIL:
ImportError: cannot import name '_imaging' from 'PIL'
]]>A measure of how easily thoughts can be translated to action2023-03-10T00:00:00+00:002023-03-10T00:00:00+00:00http://localhost:4000/blog/2023/03/10/putting-thoughts-into-actionRecently, I’ve been using multiple different languages and frameworks (both at work and personally) and I’ve been thinking about why I prefer some over others. Ultimately, I think it comes down to this:
+
]]>Andrew ConlinA measure of how easily thoughts can be translated to action2023-03-10T00:00:00+00:002023-03-10T00:00:00+00:00http://localhost:4000/blog/2023/03/10/putting-thoughts-into-actionRecently, I’ve been using multiple different languages and frameworks (both at work and personally) and I’ve been thinking about why I prefer some over others. Ultimately, I think it comes down to this:
How easily can I translate what I am thinking about into a working setup?
These are usually a direct tradeoff, with ease typically preferred over options. This tends to frustrate me, as I want full control of all those little configurations.
-
The solution to this, at least for me, are frameworks such as Bootstrap and Jekyll. They put a layer between the user and the options; essentially translating and simplying all the little configurations into something much easier to work with. Columns in Bootstrap make page layouts simple; markdown-to-html parsing in Jekyll makes text formatting a breeze. But, most importantly of all, these frameworks don’t sacrifice on the possibilities. They make it easier to apply complex setups, but if you want to go in and tweak absolutely everything to your liking, go right ahead. By providing the user with simpler ways of doing the same things as before, they manage to bridge the gap between Can I do everything I want to? and How easy is it?. And I think that is beautiful.
]]>Yuri Felsen on love2023-03-05T00:00:00+00:002023-03-05T00:00:00+00:00http://localhost:4000/blog/2023/03/05/yuri-felsen-on-love“Like everyone, I have my own, maybe obsessive futile, maybe in some way authentic, vision: all of a sudden, I will imagine the entire homogenous world as it is revealed to us-the streets, the cities, the rooms, those intelligent beasts of a sad and predatory nature, who have learn to stand on their hind legs, who have built all this but are fated to disappear, who, despite this, still try to cling to something solid and lasting, still try to ward off the inevitability of death, who dreamt up fairy tales and, now that these stories have been disproved, are disconsolate - and for me the only means of defending myself from our terrible fate is love, my love - Lyolya. Without love we fall into a stupor or despair, it covers our naked animal essence; with the fear of death, with deliberate attempts to grab hold of some kind of eternity, one that is at once a mystery to us and yet devised by us, even the remains of love, even its very echo in music, imbues us with a semblance of fearlessness, dignity and the spiritual range to disregard death. Only by loving, by knowing about love, hoping for love, are we inspired and meaningfully engaged in life, able to banish the sovereignty of petty day-to-day cares, to stop waiting for the end to come”
+
The solution to this, at least for me, are frameworks such as Bootstrap and Jekyll. They put a layer between the user and the options; essentially translating and simplying all the little configurations into something much easier to work with. Columns in Bootstrap make page layouts simple; markdown-to-html parsing in Jekyll makes text formatting a breeze. But, most importantly of all, these frameworks don’t sacrifice on the possibilities. They make it easier to apply complex setups, but if you want to go in and tweak absolutely everything to your liking, go right ahead. By providing the user with simpler ways of doing the same things as before, they manage to bridge the gap between Can I do everything I want to? and How easy is it?. And I think that is beautiful.
]]>Andrew ConlinYuri Felsen on love2023-03-05T00:00:00+00:002023-03-05T00:00:00+00:00http://localhost:4000/blog/2023/03/05/yuri-felsen-on-love“Like everyone, I have my own, maybe obsessive futile, maybe in some way authentic, vision: all of a sudden, I will imagine the entire homogenous world as it is revealed to us-the streets, the cities, the rooms, those intelligent beasts of a sad and predatory nature, who have learn to stand on their hind legs, who have built all this but are fated to disappear, who, despite this, still try to cling to something solid and lasting, still try to ward off the inevitability of death, who dreamt up fairy tales and, now that these stories have been disproved, are disconsolate - and for me the only means of defending myself from our terrible fate is love, my love - Lyolya. Without love we fall into a stupor or despair, it covers our naked animal essence; with the fear of death, with deliberate attempts to grab hold of some kind of eternity, one that is at once a mystery to us and yet devised by us, even the remains of love, even its very echo in music, imbues us with a semblance of fearlessness, dignity and the spiritual range to disregard death. Only by loving, by knowing about love, hoping for love, are we inspired and meaningfully engaged in life, able to banish the sovereignty of petty day-to-day cares, to stop waiting for the end to come”
- Yuri Felsen (trans. Bryan Karetnyk)
-
From ‘Deceit’, first published in 1930 and translated to English in 2022.
]]>Fixing php errors in a Nextcloud docker-compose configuration2023-03-01T00:00:00+00:002023-03-01T00:00:00+00:00http://localhost:4000/til/nextcloud-php-errorsI was trying to rescan the files in my Nextcloud server (running on Raspberry Pi 4 with DietPi), and kept running into some weird php errors.
+
From ‘Deceit’, first published in 1930 and translated to English in 2022.
]]>Andrew ConlinFixing php errors in a Nextcloud docker-compose configuration2023-03-01T00:00:00+00:002023-03-01T00:00:00+00:00http://localhost:4000/til/nextcloud-php-errorsI was trying to rescan the files in my Nextcloud server (running on Raspberry Pi 4 with DietPi), and kept running into some weird php errors.
First error - “could not find driver”
@@ -164,4 +164,4 @@ This led me to running this command:
….aaaaaand, voila! The command runs, the files are scanned and everything is up to date.
-
]]>Musings on the power of cinema2023-01-14T00:00:00+00:002023-01-14T00:00:00+00:00http://localhost:4000/blog/2023/01/14/musings-on-the-cinemaI’ve realised that going to the cinema makes me sad; a quiet, contemplative melancholy. Ennui. No matter the film, something about the cinema experience is meditative for me. I always look at things differently in the aftermath; like my perception is temporarily knocked off balance. No, more like a fog is lifted for a while. I especially enjoy that time immediately after, the cycle home. I notice so many little details, scenes of beauty and of strange nostalgia. Like I’m finally seeing the world how it is, or rather, I begin to see rather than look, listen rather than hear. I feel as though these moments, however brief, are when I am truly in touch with myself. My soul, my inner essence. This is why I love the cinema. These moments of private melancholy, of temporary clarity. It is a feeling I cannot replicate anywhere else in my life.]]>
\ No newline at end of file
+
]]>Andrew ConlinMusings on the power of cinema2023-01-14T00:00:00+00:002023-01-14T00:00:00+00:00http://localhost:4000/blog/2023/01/14/musings-on-the-cinemaI’ve realised that going to the cinema makes me sad; a quiet, contemplative melancholy. Ennui. No matter the film, something about the cinema experience is meditative for me. I always look at things differently in the aftermath; like my perception is temporarily knocked off balance. No, more like a fog is lifted for a while. I especially enjoy that time immediately after, the cycle home. I notice so many little details, scenes of beauty and of strange nostalgia. Like I’m finally seeing the world how it is, or rather, I begin to see rather than look, listen rather than hear. I feel as though these moments, however brief, are when I am truly in touch with myself. My soul, my inner essence. This is why I love the cinema. These moments of private melancholy, of temporary clarity. It is a feeling I cannot replicate anywhere else in my life.]]>Andrew Conlin
\ No newline at end of file
diff --git a/_site/feed/til.xml b/_site/feed/til.xml
new file mode 100644
index 0000000..4ec36b0
--- /dev/null
+++ b/_site/feed/til.xml
@@ -0,0 +1,139 @@
+Jekyll2023-05-03T21:25:52+01:00http://localhost:4000/feed/til.xml | TilAndrew ConlinRunning a Python script periodically in a Docker container using cron2023-04-19T00:00:00+01:002023-04-19T00:00:00+01:00http://localhost:4000/til/running-python-in-cron-in-dockerRecently, my partner gave a great idea for utilising my old Kindle: generate a “newspaper” each morning from a bunch of RSS feeds, and email it to the Kindle using “Send-to-Kindle” feature (a blog post about this project is in the works).
+
+
I loved this idea, and thought it would be no problem to get a Python script up and running periodically on my Raspberry Pi home server using cron. However, I ran into various issues along the way (some of which were not so easy to resolve), so I’m collating all the configuration changes I made in the hopes that it will be useful to someone one day. You can find the full repo for this project here, and I have also included my Dockerfile, docker-compose.yml and crontab at the end of this TIL.
+
+
1. Double check the user
+
+
A lot of problems with cron come down to user privileges. Each user has their own crontab, and then there is the system-wide rootcrontab. The first issue I ran into with creating a cron job inside a container was that Docker created the crontab as a non-root user. This issue presented itself to me when I tried to run the following command, to list the current cronjobs in the Docker container:
+
docker-compose exec container-name crontab -l
+
+
This returned the following output:
+
no crontab for root
+
+
Now, it is not necessarily a problem to have non-root cron jobs, but just make absolutely certain that you are creating the jobs with the user you expect. For me, I wanted to run as root, so I added to following line to my docker-compose.yml:
+
user: root
+
+
Now, the root user will be used when building your Docker image and the created crontab will be where you expect.
+
+
2. Missing dependencies
+
When cron calls your Python script, you may run into issues with ModuleNotFoundError or ImportError, where Python cannot find your installed packages. This is because cron does not have access to your system environment variables, including the Python path. You can resolve most of these errors with imports by adding the PYTHONPATH environment variable to your crontab. This should be the path to your site-packages folder, something like this:
+
PYTHONPATH=/usr/bin/local/python3
+
+
You may also need to add a shebang (#!) to your Python script to direct cron to the correct version. You can find the Python location with one of the following commands:
+
which python
+which py
+which python3
+
+
NOTE: These commands must be performed in your Docker container when it is up and running. In docker-compose syntax this would be the following (with the name of your container instead of container-name):
+
docker-compose exec container-name which python3
+
+
You can then add this to the top of your Python script, as follows:
+
#!/usr/bin/local/python3
+
+
3. Still missing dependencies
+
Some modules will still run into errors even when the PYTHONPATH variable has been set. In particular, I ran into problems with reportlab and Pillow/PIL:
+
ImportError: cannot import name '_imaging' from 'PIL'
+
+
This was solved by adding the system PATH to the crontab as well. The system path is included in the default crontab that is created when you first run crontab -e:
Therefore, it is a good idea to include it if you are making a new crontab to make sure cron can find everything it needs to.
+
+
4. Check relative paths in Python
+
By default, cron runs from the default root path. Therefore, both your call to Python in your crontab and the filepaths within Python should either be relative to root (i.e /main.py rather than main.py) or just use full paths instead.
+
+
5. “Failed to build wheel” and related errors
+
This error is related to Python inside a Docker container rather than cron. However, someone might still find it useful. When you install your requirements.txt, you may encounter errors such as
+
legacy-install-failure
+error: command '/usr/bin/gcc' failed with exit code 1
+fatal error: Python.h: No such file or directory
+
+
I was able to resolve these by adding python3-dev, wheel and Cmake to my requirements.txt. These are sometimes required when packages include other binaries or need to compile other code when installed.
+
+
6. Other useful tips
+
+
crontab.guru is a great resource for checking cron syntax
+
Installing vim/nano in your Docker container to make the debugging stage easier. This is especially useful for changing your crontab to run much more frequently, or adding debugging messages etc., when the container is up.
+
+
+
I hope this helped you resolve some errors! I’ve included my Dockerfile, docker-compose.yml and crontab below if you want to set up a similar project or adjust your own files. The full repo is also available here.
]]>Andrew ConlinFixing php errors in a Nextcloud docker-compose configuration2023-03-01T00:00:00+00:002023-03-01T00:00:00+00:00http://localhost:4000/til/nextcloud-php-errorsI was trying to rescan the files in my Nextcloud server (running on Raspberry Pi 4 with DietPi), and kept running into some weird php errors.
+
+
First error - “could not find driver”
+
+
I was trying using the following syntax to call occ and scan the files:
but I kept running into a PHP error. Specifically this error:
+
+
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /path/to/nextcloud/lib/private/DB/Connection.php:139
+
+
+
followed by a long, verbose stack trace.
+
+
It took me a decent amount of time to diagnose the exact issue, but eventually I found this list of required PHP modules in the Nextcloud admin manual.
+
+
Running php -m will print out the list of currently installed PHP modules. I noticed I was missing quite a few of the required modules, but the one that was causing my issue was the missing pdo_mysql module.
+This can be installed by running:
+
+
sudo apt-get install php7.4-mysql
+
+
Note: This command will change based on your OS, PHP version and database type
+
+
This resolved the error! However (as is always the case), this only meant I got a shiny new error instead:
+
+
Second error - “Name or service not known”
+
+
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known in /path/to/nextcloud/lib/private/DB/Connection.php:139
+
+
+
From first glance, this looks like something wrong in the DNS name resolution. This sent me a long way down the wrong path, changing a whole bunch of things in my docker-compose.yml file.
+Eventually however, after a long and perilous journey over the high seas of Nextcloud forums and StackOverflow, I found this example of running php occ in a docker-compose configuration.
+This led me to running this command:
Note: replace nextcloud-app with the name of your Nextcloud container. Also, this command must be run from the directory of your Nextcloud docker-compose.yml
+
+
….aaaaaand, voila! The command runs, the files are scanned and everything is up to date.
+
+
]]>Andrew Conlin
\ No newline at end of file
diff --git a/_site/index.html b/_site/index.html
index 4af1a24..66215f9 100644
--- a/_site/index.html
+++ b/_site/index.html
@@ -5,6 +5,7 @@
+
andrew conlin
@@ -52,6 +53,12 @@
My main hobbies are film photography and running. I love watching movies, especially in the cinema. I love post-punk, dreampop and experimental hip hop. I love drinking good coffee, good beer and good whisky. I am also a passionate self-hoster, and like to think that I'm at least somewhat privacy conscious.
diff --git a/_site/til/index.html b/_site/til/index.html
index 7538751..1c140a3 100644
--- a/_site/til/index.html
+++ b/_site/til/index.html
@@ -5,6 +5,7 @@
+
andrew conlin
@@ -52,6 +53,12 @@
+ my collection of tils (today-i-learned). i use this mainly to collect solutions to weird errors i have faced, and detail the little projects that i work on. this has its own atom feed (above) as they are typically very different from my other posts. all tils are blog posts but not all blog posts are tils.
+
Running a Python script periodically in a Docker container using cron
+
+
+
@@ -174,7 +188,7 @@ which python3
You can then add this to the top of your Python script, as follows:
#!/usr/bin/local/python3
-
3. Still missing dependecencies
+
3. Still missing dependencies
Some modules will still run into errors even when the PYTHONPATH variable has been set. In particular, I ran into problems with reportlab and Pillow/PIL:
ImportError: cannot import name '_imaging' from 'PIL'
diff --git a/blog.html b/blog.html
index 2b887bb..2c9e508 100644
--- a/blog.html
+++ b/blog.html
@@ -1,6 +1,7 @@
---
layout: default
-title: latest posts
+title: latest posts
+subtitle: all the posts, in reverse chronological. there is an atom feed above.
permalink: /blog/
---
diff --git a/index.html b/index.html
index a0a75aa..388958f 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@ permalink: /
-Hi! My name is Andrew Conlin. I am a software engineer and photographer, currently based in Cambridge, England.
+Hi! My name is Andrew Conlin. I am a software engineer and photographer, currently based in Cambridge, England.
My main hobbies are film photography and running. I love watching movies, especially in the cinema. I love post-punk, dreampop and experimental hip hop. I love drinking good coffee, good beer and good whisky. I am also a passionate self-hoster, and like to think that I'm at least somewhat privacy conscious.
diff --git a/til.html b/til.html
index ad689aa..bd29107 100644
--- a/til.html
+++ b/til.html
@@ -1,6 +1,7 @@
---
layout: default
-title: latest tils
+title: latest tils
+subtitle: my collection of tils (today-i-learned). i use this mainly to collect solutions to weird errors i have faced, and detail the little projects that i work on. this has its own atom feed (above) as they are typically very different from my other posts. all tils are blog posts but not all blog posts are tils.
permalink: /til/
categories:
- til