Skip to content

Instantly share code, notes, and snippets.

yusufhm / .envrc
Last active Sep 28, 2022
podman setup
View .envrc
# Allows for builds using `docker-compose build`.
yusufhm /
Last active Nov 9, 2022
kube commands - kubernetes | kubectl | lagoon
# Tail logs of running build of a Lagoon project's environment.
kubectl -n env-ns logs -f
# Run a busybox image.
kubectl run -i -t busybox --image=busybox --restart=Never
# Run a curl image.
kubectl run curl --image=curlimages/curl --restart=Never --

Add the following snippet to ~/.composer/config.json:

  "repositories": [
            "type": "path",
            "url": "/path/to/package",
            "options": {
                "versions": {
 "owner/repo": "3.1.10"
yusufhm /
Last active Mar 1, 2022
redis commands
# Get info.
redis-cli INFO
# DB size.
redis-cli DBSIZE
# Get real-time stats.
redis-cli --stat
# Monitor.

Set env variables in Gitlab when pushing:

git push origin feature/ci-test  -o ci.variable="GOVCMS_CI_IMAGE_VERSION=:edge"

Environment per project/directory

yusufhm / drupal.yml
Created Feb 28, 2021
caprover app for Drupal
View drupal.yml
captainVersion: 4
image: bitnami/$$cap_db_type:$$cap_database_version
- $$cap_appname-db-data:/var/lib/mysql
restart: always
MYSQL_ROOT_PASSWORD: $$cap_db_pass
yusufhm / anonymous_author.html
Last active Jan 15, 2021 module descriptions
View anonymous_author.html
Easily allow anonymous users to post content to your website by adding this field to any entity type. The most typical use-case of this module and the reason why it was initially created is for allowing the creation of forums by unauthenticated users, while requesting their name and email address, and whether they'd like to get notified.
Provides an Anonymous Author field type, containing the following values:
yusufhm / drupal-entity-updates.php
Last active Oct 2, 2020
Drupal entity updates
View drupal-entity-updates.php
* Update an entity type's storage definition.
* An example is when the cardinality of a field is updated in config; since
* `drush updatedb` no longer performs entity updates, this has to be done
* manually now.
function _MODULE_NAME_update_field_definition($entity_type_id, $field_name) {
yusufhm / backup-bucket.json
Created May 20, 2020
s3 bucket policy for uploads
View backup-bucket.json
"Version": "2012-10-17",
"Statement": [
"Effect": "Allow",
"Action": [
"Resource": "arn:aws:s3:::*"