Skip to content

Instantly share code, notes, and snippets.

View kyleskrinak's full-sized avatar

Kyle Skrinak kyleskrinak

  • Gilead Sciences
  • Raleigh, NC
  • 06:08 (UTC -04:00)
View GitHub Profile
@kyleskrinak
kyleskrinak / drupal-quick-dump.sh
Last active March 22, 2016 12:12 — forked from timmillwood/drupal-quick-dump.sh
Adding hours/mins to the date variable, as I may run this many times during theme development
#!/bin/bash
# usage: drupal-quick-dump user host database D8 ("D8" is optional)
# remember to chmod u+x drupal-quick-dump.sh
BOLD="$(tput bold)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
MAG="$(tput setaf 5)"
RESET="$(tput sgr0)"
USER="$1"
<?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:
@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"
@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;
settings.php
.git
.gitignore
private/backup_migrate/
function vhost {
sudo ~/.dotfiles/osx/mamp_vh.sh $1
}
@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
@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 () {
#!/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
/**
* 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';
}