Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / docker-compose.yml
Last active August 29, 2015 14:21
Docker vufind 2
lamp:
image: useltmann/vufind2
ports:
- "81:80"
- "8081:8080"
- "3307:3306"
volumes:
- /home/{USER}/workspace/vufind-clean:/app
@aschmoe
aschmoe / 1instructions.sh
Last active August 29, 2015 14:21
Openvpn only works the first time...
# Create up script
sudo vi /etc/openvpn/up.sh
# Create down script
sudo vi /etc/openvpn/down.sh
# Ubuntu Gnome
## Arc Theme
sudo rm -rf /usr/share/themes/{Arc,Arc-Darker,Arc-Dark}
rm -rf ~/.local/share/themes/{Arc,Arc-Darker,Arc-Dark}
rm -rf ~/.themes/{Arc,Arc-Darker,Arc-Dark}
cd ~/.themes
git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme
./autogen.sh --prefix=/usr --with-gnome=3.16
@aschmoe
aschmoe / registry-rebuild
Created April 28, 2015 17:37
Registry rebuild on platform.sh
ssh {ID}@ssh.us.platform.sh << EOF
cd ~/tmp
php registry_rebuild/registry_rebuild.php
bash -l
EOF