All Articles
Handle configuration settings in custom Drupal modules and example of using the configuration API in Drupal
Handling configuration settings in custom modules involves using the Configuration API provided by Drupal. This API allows you to define, manage, and access configuration settings in a structured and consistent way. Here’s how I approach it and an example of using the Configuration API in Drupal 10/11:
Using the Configuration API
Keycloak: How to override the password reset emails
In order to override the text of the password reset emails in Keycloak, you want to do the following.
Make your own copy of the default themes. These can currently be found at: https://github.com/Halazv2/keycloak-theme/tree/master/themes/base/email
Then, make changes to the theme as appropriate. There are several themes: the login theme stores the styling of the login pages. But the email theme contains the wording of the emails.
Default Drupal file attachment types
I have the following list of extensions that I usually permit in drupal attachments:
txt pdf doc docx html csv xlsx xlsm sh json
cer pem pub key
png jpg jpeg gif
mkv sfv avi mp3 mp4 webm mov
zip tar gzConverting mbox to maildir
From Mellowhost blog.
mbox and maildir both are popularly used techniques to store mails. The simple way to understand the difference is, mbox uses a single directory to store all mails while maildir would utilize a directory structure to store mails. Most of the cases, advance mail receiving techniques IMAP over POP3 uses these sort of folder based concept to provide enhancement in mail organizing.
[FIXED]: drush The specified database connection is not defined: default
Fixing this took me years... I can't believe how long it took. The answers on stack overflow did not help.
The error was due to a mismatching php configuration for running in the shell ( /etc/php/8.1/cli/php.ini ) and in apache (/etc/php/8.1/apache2/php.ini ).
Specifically, I had to enable short tags for the shell:
20250424 Scrum: Switch from consumption to production
...then, the current idea, from completely lacking motivation to work, is as follows. Instead of reading news, etc, and being generally unuseful, I will spend time *writing* news, or scrum updates, or 2d sketches, or whatever else that can be generated, rather than consumed.
[FIXED]: java.io.IOException: Cannot run program "/bin/bash"
Just restart jenkins:
service jenkins restart[FIXED] ruby on rails :: LoadError: cannot load such file -- distribution
Specifically for the wco stack, gem 'iron_warbler' had to be included in that particular instance's (micros_*) Gemfile. Which is a bit disappointing since I wanted libraries to be decoupled - but hey, I'm not going to fix this right now. But please be aware: it may seem that there is a separation between libraries and some libraries (namely models and content) can be installed without the rest of the stack - but that's not the case. The whole stack must be installed.
[FIXED] prosody: usermod: UID '0' already exists
That happens because the${CONTAINER_VOLUME} path must belong to a user other than root, or prosody fails to start.
HTML class naming conventions, and id naming conventions
In HTML, classes should be lower-case with dashes:
<div class="class-name-1 another-class-name"> </div>
There are exceptions:
<div class="BookChapter" ></div>
However, ids should be camelCase or PascalCase (capitalized first letter):
<div id="thisDiv"></div><div id="anotherArray"></div>
What's a better name: tag1 or tag_1 ? Should it be tag-1 or tag_1 ?
Or the same question can be asked as: what's a better name: tag1 or tag-1? Depending on if underscores are disallowed, or dashes are disallowed.
While we are on the topic of dashes vs underscores, check out when to capitalize HTML classes, and when to keep ids in Pascal Case.
[FIXED]: An external drive not mounting on mac (fsck, not fdisk)
This happened to me recently... I may have unplugged an external 5Tb harddrive without ejecting it from mac os x 13, and it could not be mounted again. I plugged the harddrive into a windows machine, run "repair" there (whatever that means) and the data was perfectly readable. It's just that the disk would not mount on mac.
Stackoverflow to the rescue! The solution is:
sudo pkill -f fsck
Or actually
ps aux | grep fsck
How to reset admin password in Fat Free CRM
It appears that you can just re-run the setup in order to do that:
bundle exec rails ffcrm:setup
.
[FIXED]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' when running mysql database in docker, for a ruby on rails application
Change
host: localhost
to
host: 127.0.0.1
in config/database.yml, to make the connection over TCP/IP rather than local socket.
How to run cron from docker
tl;dr: bind the cron definition file as a volume, and wire running it, as part of the image (in your Dockerfile).
Here is frmo a Stackoverflow answer:
Let's say you have a file hello-cron:
A Comparison of Free and Open CRM Clients
ToC
EspoCRM- SuiteCRM
SugarCRM- FatFree CRM
Odoo- Redmine
tl;dr My current recommendation is: Fat Free CRM, Suite CRM, or a custom (other) solution, in that order.
A simple script to login to a docker container
I have two versions: one for linux, and one for mac. If anyone knows how to combine them into one, please post in comments below!
Should Openstack be used as self-hosted s3 service, in 2025? (Answer: no)
Hello everyone, very quickly, I have spent several days looking into self-hosting s3 solutions, because I am in the process of moving out of AWS cloud for security reasons.
One of the alternative options that I have considered for S3, the object storage solution, is OpenStack. Some 10 years ago, I have actively developed in the openstack ecosystem, and I remember they provide one or several s3-compatible solutions. In particular, the OpenStack Swift supposedly provides an option for self-hosted s3. You can install it as part of the devstack, which can run on a single machine.
Google Fi: Suggested APN Settings
APN Name Google Fi
APN h2g2
Proxy
Port
Username
Password
Server
MMSC http://m.fi.goog/mms/wapenc
MMS Proxy
MMS Port
MCC 310
MNC 260
Authentication Type
APN Type
APN Protocol IPv4/IPv6
APN Roaming Protocol IPv4/IPv6
Bearer
MVNO Type
MVNO Type.
Android: How do you create a local keystore?
keytool -genkey -v -keystore ~/.android/debug.keystore \
-alias debug_keystore -keyalg RSA -keysize 2048 -validity 10000.
