Skip to content

Instantly share code, notes, and snippets.

View hanoii's full-sized avatar

Ariel Barreiro hanoii

  • Capital Federal, Argentina
View GitHub Profile
@hanoii
hanoii / wp-config-local.php
Last active April 24, 2020 20:11
Logging out all wordpress actions to a temporary file
<?php
add_action('all', function ($tag) {
if (preg_match('/woocommerce_/', $tag)) {
file_put_contents ('/tmp/wordpress.txt', $_SERVER['REQUEST_URI'] . '-' . $_SERVER['REQUEST_TIME'] . ': '. $tag . "\n", FILE_APPEND);
}
});
@hanoii
hanoii / .platform.app.yaml
Created May 29, 2018 16:02
Platform app yaml for the wordpress example allowing to update database on sync/branch through wp-cli
# Only the necessary entries are on this file.
# IT IS NOT A COMPLETE .platform.app.yaml FILE.
# The mounts that will be performed when the package is deployed.
mounts:
"/deploy": "shared:files/deploy"
hooks:
deploy: |
DEPLOY_FILE=/app/deploy/deploy.url
@hanoii
hanoii / self-signed-widlcard-san.sh
Created November 21, 2017 13:23
Bash script to create a self-signed wildcard certificate with SAN extension
#!/bin/bash
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout localhost.key \
-new \
-out localhost.crt \
-subj /CN=dev.localhost \
Afganistán
Albania
Alemania
Andorra
Angola
Antigua y Barbuda
Arabia Saudita
Argelia
Argentina
Armenia
@hanoii
hanoii / platformsh-migration-drupal7.txt
Last active April 25, 2017 16:22
Possible commands to run on platform.sh after a migration
# Once
# https://docs.platform.sh/frameworks/drupal7/faq.html
drush dl registry_rebuild-7.x-2.3 --destination=/app/tmp
sed -i 's/, define_drupal_root()/, '"'"'\/app\/public'"'"'/' /app/tmp/registry_rebuild/registry_rebuild.php
# Afterwards
cd /app/public
php ../tmp/registry_rebuild/registry_rebuild.php
drush updb -y
drush dis -y securepages