Skip to content

Instantly share code, notes, and snippets.

:octocat:
contributing

Christopher Hopper christopher-hopper

:octocat:
contributing
Block or report user

Report or block christopher-hopper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@christopher-hopper
christopher-hopper / drush-site-alias-make.sh
Created Aug 6, 2015
Generate a drush site-alias record for the current Drupal site.
View drush-site-alias-make.sh
#!/bin/sh
drush --uri="http://$(hostname -f)" site-alias @self --alias-name="local" --show-passwords --with-db --with-optional
@christopher-hopper
christopher-hopper / gist:5368555
Created Apr 12, 2013
JetBrains PhpStorm Exeption in plugin Ini4Idea v 1.0.6
View gist:5368555
JetBrains PhpStorm Exeption in plugin Ini4Idea
PhpStorm version 6.0
Ini4Idea version 1.0.6
What was I doing when it occurred:
I have configured *.info to be treated as an INI file. I have a file named filename.info open for editing.
I don't know when the exception error message first appeared, but as soon as I noticed it I sent this debug information. As a result, I'm not sure what I was doing when the exception happened.
@christopher-hopper
christopher-hopper / gist:6052008
Last active Dec 20, 2015
Generate a `.gitattributes` file
View gist:6052008
#
# Find text files with this command
#
grep -r -m 1 "^" . \
| grep -v "^Binary file" \
| gawk 'BEGIN { FS=":" } { print $1 }' \
| sed -re 's:.+\.([^\.]+)$:*.\1 text eol=lf:g' -e '/\//d' \
| sort -u
@christopher-hopper
christopher-hopper / gist:6118414
Last active Dec 20, 2015
Kill the processes and back-up accounts before removing
View gist:6118414

Remove Linux user accounts

I killed the processes and backed-up old accounts on the Peregrine UAT server 10.3.28.44. You can find tarballs for the home folders of all removed accounts on Peregrine UAT at:

10.3.28.44:/root/bak/deleted/users

To remove accounts safely I did the following:

  1. Lock the account.
@christopher-hopper
christopher-hopper / usrgrp-reset.sh
Last active Dec 28, 2015
Reset the groups for all users matching "user.name" to be primary group "developers", supplementary group "user.name"
View usrgrp-reset.sh
#!/bin/bash
function usage() {
echo -e "Usage: " 1>&2;
echo -e "\t${0} [-h|-f|-i]" 1>&2;
echo -e "Description: " 1>&2;
echo -e "\tReset all users to have \`developer' as their primary group" 1>&2;
}
while getopts ":hfi" FLAG; do
case "${FLAG}" in
@christopher-hopper
christopher-hopper / xdebug-enable.sh
Last active Aug 25, 2016
Enable PHP xdebug by moving the /etc/php.d/*.ini
View xdebug-enable.sh
#!/usr/bin/env bash
# vim:sw=3 ts=6 ft=sh
# Uses BASH3 Boilerplate
# More info:
# - https://github.com/kvz/bash3boilerplate
# - http://kvz.io/blog/2013/02/26/introducing-bash3boilerplate/
#
# Version 1.0.0
#
# Usage:
@christopher-hopper
christopher-hopper / persist-file-perms.md
Last active Oct 12, 2016
How to persist file system permissions for web applications.
View persist-file-perms.md

Persist Filesystem Permissions

The writable files and folders for web applications often require specific user, group and permission masks to persist, even when new files and sub-folders are added by users or the application itself.

For example, permissions might need to be:

File mode

u:rw,g:rw
View fatal_error_on_8.2.x-2903942-3.patch
diff --git a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
index 87465ca06f..377d36f84e 100644
--- a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
+++ b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
@@ -4,6 +4,7 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableMetadata;
+use Drupal\Core\Entity\EntityInterface;
use Drupal\views\Plugin\views\PluginBase;
View keybase.md

Keybase proof

I hereby claim:

  • I am christopher-hopper on github.
  • I am chop (https://keybase.io/chop) on keybase.
  • I have a public key ASBUM3iCrJK9V9U_hmodhM-GRmWCGilGwpyN2KpEOWyjnQo

To claim this, I am signing this object:

@christopher-hopper
christopher-hopper / PHP-Interactive-CLI-Install-from-Source.md
Last active Mar 20, 2018
Install PHP from a source download to enable its interactive command-line shell interface on Linux.
View PHP-Interactive-CLI-Install-from-Source.md

PHP Interactive CLI Install

The following commands can be used to install PHP from source with an interactive command-line shell interface on Linux.

This interactive shell, (command: php -a) was the main reason I built from source to begin with. Now though I am able to play with the latest PHP versions as soon as they are available.

The commands below were written for and tested on the following system.

  • OS: Ubuntu 14.04.4 LTS (trusty)
You can’t perform that action at this time.