Skip to content

Instantly share code, notes, and snippets.

@aschmoe
aschmoe / remove-makefile
Last active August 29, 2015 14:17
Drupal helper script: If you are using some of a profile's modules in your own install profile, but don't want their makefiles to override your versioning, this will just create patches for those modules to delete them
#!/bin/sh
echo "List your modules with seperated by spaces (ex: panopoly_core panopoly_widgets)"
read -a modules
echo "Current branch for the set of modules you'd like (ex: 7.x-1.x)"
read branch
echo "The tag for the latest drupal project version (ex: 7.x-1.19)"
read tag
echo "Drupal issue number you'll be posting to (ex: 2453509)"
read issue
@aschmoe
aschmoe / gist:0b7c841d991b2eef4b4e
Created February 5, 2015 22:54
Installing Docker + Fig properly
##############
# Install Docker
# Complex (USE SIMPLE):
# sudo sh -c "echo deb https://get.docker.com/ubuntu docker main\
# > /etc/apt/sources.list.d/docker.list"
# sudo apt-get update
# sudo apt-get install lxc-docker
# SIMPLE:
@aschmoe
aschmoe / vbo-update
Created January 28, 2015 20:02
Drupal: Views bulk operation to move a file without affecting node update date
<?php
// Dont include the php tag in the VBO interface
if(!empty($entity->field_picture) && empty($entity->field_pictures_multiple)) {
$entity->field_pictures_multiple['und'] = array($entity->field_picture['und'][0]);
field_attach_update('node', $entity);
}
@aschmoe
aschmoe / build-soar-docker
Last active August 29, 2015 14:13
Installing drupal docker image
# build from https://github.com/albatrossdigital/aws-docker-drupal-deployment
git clone
cd FOLDER
sudo docker build -t aschmoe/soar-drops-v1 .
# run a container on the image
sudo docker run -p 49160:80 -d --name soar_drupal aschmoe/soar-drops-v1
# run a container on the image with a mounted shared folder
sudo docker run -p 49160:80 -d --name soar_drupal -v /var/docker-temp:/var/docker-temp aschmoe/soar-drops-v1
@aschmoe
aschmoe / install-jenkins-on-ec2
Created January 10, 2015 01:39
Installing jenkins on ec2
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
Goto IP:8080
Set up security:
IP:8080/configureSecurity/
@aschmoe
aschmoe / secure_pdfs.sh
Last active August 29, 2015 13:59
Secure pdfs with pdftk
for file in Dropbox/Taxes/{,**/,**/**/}*.pdf
do
protected=0
passwordworks=1
pdftk "$file" dump_data output /dev/null dont_ask || protected=1
# not protected so just encrypt
if [ $protected -eq 0 ]
then
@aschmoe
aschmoe / Gruntfile.js
Created September 16, 2013 19:08
Gruntfile for Drupal subtheme creation. Use as "grunt subtheme:mynewsubtheme:scss" Made for the theme associated with the flight install profile. https://drupal.org/project/flight
'use strict';
var path = require('path');
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
copy: {
main: {
files: [
{