Skip to content

Instantly share code, notes, and snippets.

View ferdnyc's full-sized avatar

Frank Dana ferdnyc

View GitHub Profile
@ferdnyc
ferdnyc / gist:22d10303bb5df398434f
Created May 22, 2015 03:59
Code snippets for a comment at dpedu.io
# I realize this post is a year old, and I'm not sure whether you even use this script anymore,
# but I thought I'd mention a couple of optimizations that might help out anyone else using it.
# Sed accepts multiple commands in a single invocation, so you can eliminate one tempfile by
# combining the two sed commands into one call:
sed -e '/^INSERT_INTO `drupal_cache/d;/^INSERT_INTO `drupal_watchdog`/d;' < dump_raw.sql > dump.sql
# However, thanks to the power of regular expressions, this could even be combined into a single regexp
# that matches both lines of interest: