Skip to content

Instantly share code, notes, and snippets.

View deepakaryan1988's full-sized avatar
🏠
Working from home

Deepak Kumar deepakaryan1988

🏠
Working from home
View GitHub Profile
{
"bold_folder_labels": true,
"caret_style": "wide",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"fallback_encoding": "UTF-8",
"find_selected_text": true,
"font_options":
# Ignore emacs backup files...
*~
# Ignore configuration files that may contain sensitive information.
sites/*/settings.php
# Ignore paths that contain user-generated content.
.sass-cache/*
sites/*/files
sites/*/private
cd /var/www
drush dl drupal --drupal-project-rename=d7
cd d7
drush si -y --db-url=mysql://root:personofinterest@localhost/d7
drush upwd admin --password="admin"
//Maybe you need this
cd sites/default

How To Install Memcache on MAMP 2

  1. Install memcached. I'd suggest using homebrew. brew install memcached
  2. Select your desired version of PHP that you'd like to use in MAMP. This dropdown is located in the PHP tab in MAMP PRO.
  3. Visit the Downloads Page on php.net and download the source code. If your release isn't listed, visit the Releases page.
  4. Extract the source into /Applications/MAMP/bin/php/[php version folder]/include/php.
  5. /Applications/MAMP/bin/php/[php version folder]/include/php/configure
  6. /Applications/MAMP/bin/php/[php version folder]/bin/pecl i memcache.
  7. Add extension=memcache.so to your php.ini
    • MAMP Pro: /Applications/MAMP\ Pro/MAMP\ PRO.app/Contents/Resources/php[your php version].ini

sign up for a new relic account first and you'd get the license key on your account page.

sudo sh -c 'echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list'

sudo wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -

sudo apt-get update

sudo apt-get install newrelic-sysmond

sign up for a new relic account first and you'd get the license key on your account page.

sudo sh -c 'echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list'

sudo wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -

sudo apt-get update

sudo apt-get install newrelic-sysmond

Install MongoDB with Homebrew

brew install mongodb
mkdir -p /data/db

Set permissions for the data directory

Ensure that user account running mongod has correct permissions for the directory:

@deepakaryan1988
deepakaryan1988 / Running a drush command on all sites in multisite aegir installation
Created April 27, 2016 13:05
Bash script to loop through all the different platforms/sites on an aegir deployment, and performs drush commands against them.
#!/bin/bash
for dir in /var/aegir/platforms/*
do
cd "$dir/sites"
drush @sites -y ev "variable_set('smtp_host', 'your_host');"
drush @sites -y ev "variable_set('smtp_username', 'your_user');"
drush @sites -y ev "variable_set('smtp_password', 'your_pass');"
drush @sites -y ev "variable_set('smtp_port', 'your_port');"
done
@deepakaryan1988
deepakaryan1988 / drupal-7-example-local-settings.php
Created November 24, 2016 18:23 — forked from delphian/drupal-7-example-local-settings.php
Example of drupal 7 local settings.php file.
<?php
// To set up a local environment, make a duplicate of this file and name it
// local-settings.inc in the site directory that contains the settings.php file.
// Ignore sites/*/local-settings.php in the .gitignore file. Change the settings.php
// file to include local-settings.php if the file exists.
// Point database to local service.
$databases['default']['default'] = array(
'database' => 'local_db_name',
@deepakaryan1988
deepakaryan1988 / drupal_phpcs_install.sh
Created November 10, 2017 11:07
Install PHPCS and use the Drupal Coding Standard from the coder module.
; cd into the directory you store code resources.
cd ~
; Clone PHP_CodeSniffer directly from the github repo.
; You could also install via pear.
git clone git@github.com:squizlabs/PHP_CodeSniffer.git
; Clone the coder branch you want.