Skip to content

Instantly share code, notes, and snippets.


keopx keopx

View GitHub Profile
keopx / settings.local.php
Last active May 27, 2021
Drupal 8 Redis settings.local.php
View settings.local.php
* Set redis configuration.
/** @see: */
if (extension_loaded('redis')) {
// Set Redis as the default backend for any cache bin not otherwise specified.
// $settings['cache']['default'] = 'cache.backend.redis';
keopx /
Created Jul 16, 2015
Import gzipped sql using Drush
gunzip -c database.sql.gz | drush sqlc
keopx / import.php
Last active Nov 26, 2020 — forked from mikecrittenden/import.php
Importing Drupal 8 config programmatically
View import.php
// Import arbitrary config from a variable.
// Assumes $data has the data you want to import for this config.
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html');
// Or, re-import the default config for a module or profile, etc.
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module');
keopx / create_docker_hub_images
Created Apr 3, 2020
Create docker hub images using docker push
View create_docker_hub_images
docker tag 105_mariadb
docker push keopx/mariadb:10.5
keopx /
Created Jan 15, 2019 — forked from chrisroos/
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
keopx / gist:c059cf76ec46799c90a7cf29d43eb0d4
Created Dec 4, 2018 — forked from mrconnerton/gist:1979037
node form in ctools modal drupal 7
View gist:c059cf76ec46799c90a7cf29d43eb0d4
Make Sure you include:
On the pages you put your link.
keopx / phpcs.xml.dist
Created Sep 13, 2018
drupal: /core/phpcs.xml.dist
View phpcs.xml.dist
Reworked the script to use XML instead. This works a lot better. I do have to edit the XML file to remove some invalid characters such as EOL characters which end up in the XML file.
If you install PHP CodeSniffer and the ruleset using the instructions from #10, you can then generate the coding standards report with:
$ ./modules/coder/vendor/bin/phpcs --standard=phpcs.xml --extensions=css,inc,info,install,js,module,php,profile,test,theme --ignore=core/vendor,core/assets/vendor --report=xml core/ > report.xml
You'll need to edit the XML to remove a couple of illegal characters, then finally generate the phpcs.xml file:
$ ./phpcs-generate.php report.xml > phpcs.xml
keopx / script.pipeline
Created Oct 11, 2017 — forked from juampynr/script.pipeline
Jenkins job to sync Production into Develoment
View script.pipeline
String pro_domain = ''
String dev_domain = ''
String drush_pro = "drush -l ${pro_domain} -r /var/www/${pro_domain}/current/web"
String drush_dev = "drush -l ${dev_domain} -r /var/www/${dev_domain}/current/web"
String files_pro = "/var/www/${pro_domain}/shared/web/sites/default/files/"
String files_dev = "/var/www/${dev_domain}/shared/web/sites/default/files/"
String rsyncOpts = '-azv --delete --exclude .php --exclude php --exclude styles'
String deploySshKeyId = 'some-key-id'
lock(resource: "") {
keopx /
Created Nov 7, 2017 — forked from GreenSkunk/
Drupal - Bash shell script to fix Drupal 8 permissions where the PHP Handler is FastCGI.
help="\nHelp: This script is used to fix permissions of a Drupal 8 installation in which the PHP Handler is FastCGI\nYou need to provide the following arguments:\n\t 1) Path to your drupal installation\n\t 2) Username of the user that you want to give files/directories ownership\n\nNote: This script assumes that the group is the same as the username if your PHP is compiled to run as FastCGI. If this is different you need to modify it manually by editing this script or checking out forks on GitHub.\nUsage: bash ${0##*/} drupal_path user_name\n"
echo "Refer to"
keopx / XPS-15 9560 Getting Nvidia To Work on KDE Neon [XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
View XPS-15 9560 Getting Nvidia To Work on KDE Neon
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev