Skip to content

Instantly share code, notes, and snippets.

View esolitos's full-sized avatar

Marlon (Esolitos) Saglia esolitos

View GitHub Profile
// This must be run in the "Bulk edit" _after_ the search for tests has been done.
// Step 1: Manually create _a lot_ of "SET OPTIONS" (just leave them empty)
// MANUAL
// Step 2: Run in JS console: Sets all options to "Test Locations"
jQuery('#options select[name^="o_option_"] option[value="RegionCodes"]').attr('selected', true);
jQuery('#options select[name^="o_option_"]').trigger('change');
// Step 3: Run in JS console: Sets all 1st level options to "Europe"
@esolitos
esolitos / gist:0c6e8d7a8658a48c1c6bd21210af07ca
Created August 12, 2019 12:57
kubectl force pod rotations
kubectl get po --all-namespaces --selector=name=varnish -o jsonpath='{range .items[*]}{@.metadata.namespace}{" "}{@.metadata.name}{"\n"}{end}' | xargs -n2 -- sh -c 'kubectl -n $1 delete po $2' sh
@esolitos
esolitos / reconfig-local-drupal.sh
Last active June 22, 2019 08:07
Fixes a drupal site after the migration to local development. | Now available in: https://github.com/esolitos/drupal-utility/blob/master/bin/reconfig-local-drupal
#!/bin/sh
#
# WARNING: The content of this script might be outdated!
#
# This was the initial developement, now the script can be found on github:
# https://github.com/esolitos/drupal-utility/blob/master/bin/reconfig-local-drupal
#
drush_cmd=`which drush`
@esolitos
esolitos / ramsaltmedia_setup_platform.sh
Last active June 22, 2019 08:07
Creates a new _Ramsalt Media_ platform and sets it up with Esolitos' default configuration.
#!/bin/sh
#
# Creates a new RamsaltMedia platform and sets it up with Esolitos' default configuration.
#
DRUSH=`which drush`
if [ -z $DRUSH ]; then
echo "ERROR: drush command not found!" 1>&2
exit -1
fi;
@esolitos
esolitos / 0. Wodby Upgrade README.md
Last active March 6, 2019 07:34
Upgrade all non Prod instances in Wodby for a given server UUID (Or _all_ if set to `None`)

Notes

Currently seems to work only on Python 2.7 due to swagger-codegen using the reserved keyword async.

It also needs a patch on six.py (info here). One must move the second parameter "unicode_escape" from the unicoide() call in six.py:L653 (see on github).

@esolitos
esolitos / SA-CORE-2019-003--8.5.x.patch
Last active February 20, 2019 19:56
SA-CORE-2019-003
diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index 84dd672a93..04fe4a7871 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -82,7 +82,7 @@ class Drupal {
/**
* The current system version.
*/
- const VERSION = '8.5.10';
+ const VERSION = '8.5.11';
@esolitos
esolitos / README.md
Last active December 7, 2018 19:20 — forked from magnetikonline/README.md
@esolitos
esolitos / wodby-s3-curate.py
Last active November 12, 2018 10:35
UNMAINTAINED - See `ramsalt/cron-scripts`
import os, sys, subprocess, re
from datetime import datetime, timedelta
if __name__ == '__main__':
now_date = datetime.today()
date_7days_ago = now_date - timedelta(days=7)
date_4weeks_ago = now_date - timedelta(weeks=4)
bucket_name = 'INSERT_AWS_S3_BUCKET_NAME_HERE'
@esolitos
esolitos / Drupal8Placeholders.md
Created August 30, 2018 19:42
Placeholder strategies in Drupal 8
@esolitos
esolitos / d7--twilio_poll--rule-export.json
Created August 3, 2018 11:27
Example: Drupal 7 Twilio Poll + Rules
{ "rules_sms_vote" : {
"LABEL" : "SMS Vote",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "twilio_poll", "twilio" ],
"ON" : { "twilio_sms_incoming" : [] },
"IF" : [ { "twilio_poll_rules_is_valid_sms_poll" : { "sms" : [ "sms" ] } } ],
"DO" : [
{ "twilio_poll_rules_load_poll_from_sms" : {
"USING" : { "string" : [ "sms" ] },