Skip to content

Instantly share code, notes, and snippets.

@ianlintner-wf
ianlintner-wf / fix_blue_tooth_audio.sh
Created September 29, 2016 17:04
Fix Mac OS Bluetooth Audio
#Fixes issues with Bluetooth audio stuttering/quality.
sudo defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 53
@ianlintner-wf
ianlintner-wf / phpcs_ci.task.sh
Last active February 23, 2017 21:12
PHP Code Sniffer / CI / Bamboo / Jenkins / Drupal / Check Style script
#!/bin/bash
# PHP CodeSniffer CI Task
#
# Based off of git pre-commit hook
# https://github.com/s0enke/git-hooks/tree/master/phpcs-pre-commit
#
# Export Variables to be set by CI Agent / Bot
# PHPCS_BIN=/usr/bin/phpcs
# PHPCS_CODING_STANDARD=PEAR
# PHPCS_IGNORE=
@ianlintner-wf
ianlintner-wf / _Drupal_Cheat.md
Last active September 13, 2016 16:10
Drupal Local Development Tools/Scripts/Notes

This is a collection of files, scripts and tips to get local development up and running.

Import a database via drush.

drush sql-drop
drush sql-cli < /mnt/db/backup.sql

Export a database via drush

git checkout master
if ! git diff-files --quiet --ignore-submodules
then
echo "there are changes in the working tree exiting..."
exit 1
fi
git pull origin
git pull origin --tags
git tag -a "$tag" -m "deploy tag $tag"
@ianlintner-wf
ianlintner-wf / git_clean_list.sh
Created June 29, 2016 15:38
Bash script to cleanup git branches on remote repo from a source file.
#!/usr/bin/env bash
remote_alias=origin
while read b; do
echo $b
#commented for dry run
#git branch -d $b
#git push origin
done <git_remote_branches.txt
@ianlintner-wf
ianlintner-wf / dinghy_docker_performance.sh
Last active May 18, 2016 15:00
Example configuration for create a larger performant VM with Dinghy for Docker
dinghy create --provider virtualbox --virtualbox-memory 4096 --virtualbox-cpu-count 4 --virtualbox-disk-size 40000
<?php
function delete_node_revisions_before_timestamp($nid, $timestamp) {
$node = node_load($nid);
$revisions = node_revision_list($node);
dpm($revisions);
foreach($revisions as $revision) {
if($revision->timestamp < $timestamp) {
dpm($revision->vid);
node_revision_delete($revision->vid);
@ianlintner-wf
ianlintner-wf / acquia-cloud-last-task.sh
Created January 5, 2016 04:02
Acquia Get Last Task Information via Drush
drush @site.env ac-task-info $(drush @site.env ac-task-list | awk '{x=$1}END{print x}')
@ianlintner-wf
ianlintner-wf / exports
Last active January 4, 2016 19:50
Docker-Machine NFS /etc/exports map for permissions problems with shared directories in containers using non-root users for services e.g. apache, ngnix. www-data:www-data
"/Users" 192.168.99.100 -alldirs -mapall=502:20
@ianlintner-wf
ianlintner-wf / docker-drupal-drush.sh
Last active October 6, 2016 14:54
Local Drush to Drupal Docker Client no SSH. Scripts for making a special Drush prompt that will run drush commands in the specified docker container.
export CONTAINER=drupal
export DRUSHROOT=/var/www/docroot
export SITEHOST=drupal.loc
alias drush="docker exec -it $CONTAINER drush --root=$DRUSHROOT -l $SITEHOST"