Skip to content

Instantly share code, notes, and snippets.

@bdone
bdone / sphp.sh
Created February 12, 2018 02:12 — forked from w00fz/sphp.sh
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
wget -qO- https://api.github.com/orgs/ORG/repos | jq ".[].ssh_url" | xargs -L 1 git clone

Configure Apache Path Environment Variable on Mac OSX

Problem: Apache2/PHP did not find a program to execute on its configured path

Solution: Add a new path of /usr/local/bin to Apache2's path where the program was installed

  1. Edit the Apache2 plist file with whatever editor you like (example using vim):

     $ sudo vim /System/Library/LaunchDaemons/org.apache.httpd.plist
    
#BEGIN CONFIG INFO
#DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries
#TYPE: SYSTEM
#END CONFIG INFO
#
# This is a MariaDB example config file for systems with 4GB of memory
# running mostly MariaDB using InnoDB only tables and performing complex
# queries with few connections.
#
@bdone
bdone / php.ini
Last active August 29, 2015 14:23
php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
# Remove existing database
drush sql-drop -y
# Remove existing install
sudo rm -rf sites/default
# Restore the sites/default/default.settings.php file
sudo git checkout -- sites/default
# Temporarily make the sites/default writable by anyone
<!-- THEME DEBUG -->
<!-- CALL: theme('html') -->
<!-- FILE NAME SUGGESTIONS:
* html--front.tpl.php
* html--node.tpl.php
x html.tpl.php
-->
@bdone
bdone / brewstack install
Last active December 18, 2015 19:48 — forked from shrop/brewStack.md
# brewstack install
### Install steps:
* Install Homebrew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install git
$ brew install homebrew/php/php56
$ brew install mariadb
<?php
// notify that settings-global is in use
// if (!drupal_is_cli()) {
// drupal_set_message(t('Additional configuration added via "%file".', array('%file' => str_replace('bdone', '...', __FILE__))), 'warning');
// }
// ************************************
// SYSTEM
// ************************************
#!/bin/sh
# Proper function of this script on Mac requires:
# install tiff 3.6.1 or newer http://www.libtiff.org/
# brew install ghostscript
# brew install imagemagick
timer()
{
if [[ $# -eq 0 ]]; then