Skip to content

Instantly share code, notes, and snippets.

View davebeach's full-sized avatar

David Beach davebeach

View GitHub Profile
@davebeach
davebeach / NewUserRegisterForm.php
Created June 1, 2017 07:52 — forked from davidDuymelinck/NewUserRegisterForm.php
Extend drupal 8 user register form
<?php
namespace Drupal\my_module\Form;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Entity\EntityFormBuilderInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
@davebeach
davebeach / .bash_profile
Last active January 4, 2018 15:43 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@davebeach
davebeach / install_apps_LAMP.md
Created April 11, 2017 04:21
Installation of Drupal on LAMP

Install Options

Move Installation Up One Directory

sudo mv drupal-/* drupal-/.htaccess ./
@davebeach
davebeach / .bash_alias
Last active April 11, 2017 02:27
.bash_alias
## For Linux Debian Jessie Distro ##
## Colorize the ls output ##
alias ls='ls --color=auto'
## Use a long listing format ##
alias ll='ls -la'
## Show hidden files ##
alias l.='ls -d .* --color=auto'

Drupal Memory Management

Adjust Max Memory in ini.php file:

Locate the php ini configuration file by running the drupal status report and clicking on more information:

loaded configuration file value: /opt/bitnami/php/etc

Modify file

Parameter: memory_limit Value: 64M, 128M, 256M Note the larger the parametr value the less concurrent processes that will run on the drupal instance.

Command Line - MV Tips and Tricks

To Move Contents of Directory Up One Level

(shopt -s dotglob; mv -- * ..)

Procedure to Recover Instance

Moving Persistent Disk to Another Instance To Regain Access

Procedure for Google Cloud

  • Create a snapshot of your instance’s persistent disk. Using the Google cloud console, create a snapshot of the instance. Console Instructions for Snapshot Example: Instance name is disk-bitnami-drupal-dm-3d36. Name the snapshot - snapshot-1

  • Create a new persistent disk from this snapshot. From the gcloud console for the project execute command:

@davebeach
davebeach / twig.md
Last active November 8, 2016 06:18

Various Twig Tips and Tricks

Content

Content Without Title Field

It is possible to pass the content without the title printing. Without title:``` {{ content|without('field_title') }}

With title:```
{{ content| }}

ImageMagick Workflow via Command Line

Install - Global

Mac OS X

brew install imagemagick

For LiNUX Cloud Server Command Line

apt-get install imagemagick
@davebeach
davebeach / drupal-8-security-permissions.md
Last active March 24, 2021 17:25
Drupal 8.0 Security Settings

Drupal 8 Securing Production Environment

Permissions

sudo chown -R MYUSER:www-data *
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 640 {} \;
sudo find sites/default/files/config* -type f -exec chmod 664 {} \;