Skip to content

Instantly share code, notes, and snippets.

(MySQLDUMP_DATABASE=$(sed -n 's/^.*<dbname><!\[CDATA\[\(.*\)\]\]><\/dbname>.*/\1/p' app/etc/local.xml | head -n1) \
&& \
mysqldump -h$(sed -n 's/^.*<host><!\[CDATA\[\(.*\)\]\]><\/host>.*/\1/p' app/etc/local.xml | head -n1) \
-u$(sed -n 's/^.*<username><!\[CDATA\[\(.*\)\]\]><\/username>.*/\1/p' app/etc/local.xml | head -n1) \
-p$(sed -n 's/^.*<password><!\[CDATA\[\(.*\)\]\]><\/password>.*/\1/p' app/etc/local.xml | head -n1) \
$MySQLDUMP_DATABASE \
--ignore-table=${MySQLDUMP_DATABASE}.core_cache \
--ignore-table=${MySQLDUMP_DATABASE}.core_cache_tag \
--ignore-table=${MySQLDUMP_DATABASE}.log_url \
--ignore-table=${MySQLDUMP_DATABASE}.log_url_info \
@7ochem
7ochem / git_mass_file_commands.sh
Last active December 11, 2015 17:18
Different shell command to mass add files to your git commit
# This is the base of the commands below. This adds all files appearing in git status:
git status -s |grep -E "^.[^D] " |sed "s/^.. //" |xargs git add
git status -s |grep -E "^.D " |sed "s/^.. //" |xargs git rm | wc -l
# For a simple add all (no deletions) you probably want to use this
# (add all files * and all dot files .[!.]*, asterix won't match dot files):
git add * .[!.]*
# These commands rely on the short GIT status output "git status -s"
# Short status line syntax is "XY myfile"
# X (first char) displays the status for a file in the staging area
@7ochem
7ochem / .bashrc
Last active October 13, 2015 07:27 — forked from Rud5G/gist:3496231
.bashrc
## here is the original ~/.bashrc
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
@7ochem
7ochem / .vimrc
Last active October 13, 2015 02:18 — forked from Rud5G/vimrc.vim
.vimrc
" Vim RC
" Based upon Rud5G .vimrc
" @link https://gist.github.com/Rud5G
" @link https://gist.github.com/2316255
"
" Below some links that could help understand and edit this file
" @link http://vimdoc.sourceforge.net/htmldoc/options.html
" @link http://www.eng.hawaii.edu/Tutor/vi.html [BROKEN!]
" -> {@link http://www.linuxfocus.org/English/May2000/article153.shtml}
"