Skip to content

Instantly share code, notes, and snippets.

View kyleskrinak's full-sized avatar

Kyle Skrinak kyleskrinak

  • Gilead Sciences
  • Raleigh, NC
  • 23:34 (UTC -04:00)
View GitHub Profile
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=$1 # <-- wordpress owner
WP_GROUP=$2 # <-- wordpress group
/**
* Implementation of hook_entity_info_alter().
*
* Redirect any links to groups taxonomy terms to their corresponding node
* page.
*/
function term_redirect_entity_info_alter(&$entity_info) {
$entity_info['taxonomy_term']['uri callback'] = 'term_redirect_taxonomy_term_uri';
}
#!/usr/bin/env bash
echo "what is your root domain name, something like 'colab-sbx-110.oit.unicorn.edu'"
read rootdomain
echo "update apt-get"
sudo apt-get update
echo "install git"
sudo apt-get -y install git
echo "install vim"
sudo apt-get -y install vim
@kyleskrinak
kyleskrinak / gist:1384d1419793ac310acb
Last active August 29, 2015 14:05
Create all drush site aliases
#! /bin/bash
# determine location of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# load server list that these functions loop through
source $DIR/aliasservers.sh
# identify all drupal sites
listAllSites () {
@kyleskrinak
kyleskrinak / url-crawler.sh
Last active August 29, 2015 14:04
A very simple and quick way to visit a list of pages. Each line in the list to crawl must not include the root domain.
#!/bin/bash
while read line
do
URL=http://example.dev/$line
# echo $URL `curl -s --head $URL | head -n 1` | grep -v 200 # use to find any non-200 results
echo $URL `curl -s --head $URL | head -n 1`
done < $1
function vhost {
sudo ~/.dotfiles/osx/mamp_vh.sh $1
}
settings.php
.git
.gitignore
private/backup_migrate/
@kyleskrinak
kyleskrinak / gist:9021709
Created February 15, 2014 16:35
Perl script to check a dynamically-generated web site
#!/usr/bin/perl -w
use constant SITEMAP => "http://v.box:10144/sitemap.xml";
use constant MAX_PAGES => 10;
$npages = 0;
for (qx{curl --silent @{[SITEMAP]}}) {
m{<loc>(.*?)</loc>} or next;
$page = $1;
++$npages > MAX_PAGES and last;
@kyleskrinak
kyleskrinak / fix-perms.sh
Created February 11, 2014 02:34
A brutishly simple shell script that fixes drupal shared permissions (if you have shell access)
if [ -d "$1/sites" ]; then
cur_dir=`pwd`
echo $cur_dir
cd $1
echo `pwd`
echo "chmod directories"
find . -type d -exec chmod u=rwx,g=rx,o=rx {} \;
echo "chmod files"
find . -type f -exec chmod u=rw,g=r,o=r {} \;
echo "chmod sites/default/files"
<?php
/**
* @file
* local.settings.php
*
* This settings file is intended to contain settings specific to a local
* development environment, by overriding options set in settings.php.
*
* Include this file from your regular settings.php by including this at the
* bottom: