Skip to content

Instantly share code, notes, and snippets.

View mrpatrick's full-sized avatar

Patrick Tully mrpatrick

View GitHub Profile
@mrpatrick
mrpatrick / bootstrap-salt.sh
Created March 10, 2016 15:30 — forked from rmohr/bootstrap-salt.sh
fixed salt boostrap file because of moved corp repositories
#!/bin/sh -
#======================================================================================================================
# vim: softtabstop=4 shiftwidth=4 expandtab fenc=utf-8 spell spelllang=en cc=120
#======================================================================================================================
#
# FILE: bootstrap-salt.sh
#
# DESCRIPTION: Bootstrap salt installation for various systems/distributions
#
# BUGS: https://github.com/saltstack/salt-bootstrap/issues
@mrpatrick
mrpatrick / auto-rsync.el
Created June 29, 2016 18:57 — forked from mtmtcode/auto-rsync.el
auto-rsync.el - Emacs minor mode to execute rsync automaticlly
;;; auto-rsync-mode -- minor mode for auto rsync
;;
;; Author: @l3msh0
;;
;;; Example
;;
;; (require 'auto-rsync)
;; (auto-rsync-mode t)
;; (setq auto-rsync-dir-alist
@mrpatrick
mrpatrick / wp-cli-new-admin.sh
Created August 2, 2016 16:31
Create new wordpress admin user using wp-cli / docker
docker run -e --user=apache -i -t -w /var/www/ --volumes-from PROJECTNAME_PROJECTNAME_1 --link channelone_db_1:db_1 docker.io/avatarnewyork/dockerenv-apache:php56 docker-umask-wrapper.sh /.composer/vendor/wp-cli/wp-cli/bin/wp --allow-root --path=/var/www/html user create admin [email protected] --role=administrator
@mrpatrick
mrpatrick / branch_diff_rever_single_file.sh
Created August 9, 2016 20:59
Check the diff between branches and revert single file from specific commit
# Check the diff between branches
git diff release-v2.0.0..Develop public/wp-content/themes/mytheme/my-page.php
# revert single file from specific commit
git checkout 26608ec4a393b0086e02851b6d6f6b72af265a67 public/wp-content/themes/mytheme/my-page.php
# commit (the diff won't show until it's commited)
git commit
# re-diff file (will show no diff)
@mrpatrick
mrpatrick / mysqldump_regex_tables.sh
Created October 28, 2016 15:15
mysqldump tabels with regex. This is useful if you want to ONLY dump wp_* tables within a larger database. From: http://stackoverflow.com/questions/5268936/mysqldump-only-tables-with-certain-prefix-mysqldump-wildcards
mysql -N -uroot -e 'show tables like "wp\_%"' mydb | xargs mysqldump -uroot mydb > /tmp/wp_tables_prod.20161028.sql