Skip to content

Instantly share code, notes, and snippets.

View jbickar's full-sized avatar

John Bickar jbickar

  • Stanford University
View GitHub Profile
@jbickar
jbickar / sort-hostnames-by-count.txt
Created February 14, 2020 23:04
Hostnames in watchdog, sorted by count
select hostname,COUNT(*) from watchdog group by hostname order by COUNT(*) asc
@jbickar
jbickar / check-for-db-updates.txt
Last active April 21, 2020 17:41
Check for DB updates
# First, check out the latest tag, or HEAD of the main branch.
# "git describe --abbrev=0 --tags" grabs the most recent lightweight tag
# The first command creates a variable out of that, "$tag"
# That's passed to "git diff", and we're doing a git diff from the current HEAD
# compared with that tag, and targeting the "docroot/" directory.
# Then we're passing that to grep, and searching for a line that starts with
# a plus sign, followed by "function" and "_update".
tag=$(git describe --abbrev=0 --tags); git diff ${tag} docroot/ | grep -E "^\+.*function.*_update"
@jbickar
jbickar / su-clone-lando.sh
Last active September 11, 2018 19:49 — forked from sherakama/sites-lando-clone.sh
su-clone-lando.sh
#!/bin/bash
##################
# Variables
##################
# Path to a place to store your sites.
WEBSERVERROOT=/Users/jbickar/Sites #no trailing slash
# Path to your lando configuration file for Drupal 7
LANDOCONFIG=/Users/jbickar/Sites/d7.lando.yml
@jbickar
jbickar / socorro-behat-failures.txt
Created June 11, 2018 22:29
Socorro Behat Failures
--- Failed scenarios:
/app/vendor/su-sws/linky_clicky/products/jsv/features/editor.feature:7
/app/vendor/su-sws/linky_clicky/products/jsv/features/editor.feature:17
/app/vendor/su-sws/linky_clicky/products/jsv/features/editor.feature:31
/app/vendor/su-sws/linky_clicky/products/jsv/features/editor.feature:38
/app/vendor/su-sws/linky_clicky/products/jsv/features/editor.feature:47
/app/vendor/su-sws/linky_clicky/products/jsv/features/page_not_found.feature:7
/app/vendor/su-sws/linky_clicky/products/jsv/features/site_owner.feature:8
/app/vendor/su-sws/linky_clicky/products/jsv/features/site_owner.feature:15
@jbickar
jbickar / behat-features-and-scenarios.txt
Created March 10, 2017 00:04
Count of Features and Scenarios
TTS-MBP2011: ~/Documents/working/linky_clicky$ find . -name *.feature | grep -E "\./(includes|products|sites)" | wc -l
393
TTS-MBP2011: ~/Documents/working/linky_clicky$ find . -name *.feature | grep -E "\./(includes|products|sites)" | xargs grep Scenario | wc -l
1229
@jbickar
jbickar / boom.sh
Created March 7, 2017 18:12
Make ALL THE THINGS
#!/bin/bash
drush make --concurrency=4 development/product/drupalcamp/drupalcamp.make /tmp/drupalcamp-dev
drush make --concurrency=4 development/product/jumpstart-academic/jumpstart-academic.make /tmp/academic-dev
drush make --concurrency=4 development/product/jumpstart-engineering/jumpstart-engineering.make /tmp/engineering-dev
drush make --concurrency=4 development/product/jumpstart-lab/jumpstart-lab.make /tmp/lab-dev
drush make --concurrency=4 development/product/jumpstart-plus/jumpstart-plus.make /tmp/plus-dev
drush make --concurrency=4 development/product/jumpstart-vpsa/jumpstart-vpsa.make /tmp/vpsa-dev
drush make --concurrency=4 development/product/jumpstart/jumpstart.make /tmp/jumpstart-dev
drush make --concurrency=4 production/product/jumpstart-academic/jumpstart-academic.make /tmp/academic-prod
@jbickar
jbickar / vbo-diff.patch
Last active February 22, 2017 00:38
Diff of views_bulk_operations between 7.x-3.3 and 7.x-3.4
diff --git a/actions/archive.action.inc b/actions/archive.action.inc
index f005527..ef36acd 100644
--- a/actions/archive.action.inc
+++ b/actions/archive.action.inc
@@ -3,10 +3,14 @@
/**
* @file
* Provides an action for creating a zip archive of selected files.
+ *
* An entry in the {file_managed} table is created for the newly created archive,
@jbickar
jbickar / pull-request-template.md
Last active June 2, 2017 14:47
Pull Request Template

READY FOR REVIEW/NOT READY

  • (Edit the above to reflect status)

Summary

  • TL;DR - what's this PR for?

Needed By (Date)

  • When does this need to be merged by?

Criticality

find . -name "*.make" -exec sed -i '' 's/features\]\[version\] \= \"2.6\"/features\]\[version\] \= \"2.10\"/g' "{}" \;
SELECT TABLE_NAME AS "Table", round(((data_length + index_length) / 1024 / 1024), 2) AS Size_in_MB FROM information_schema.TABLES WHERE table_schema = "<db_name>" ORDER BY Size_in_MB ASC;