This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# who is listening on port xxxx | |
listening() { | |
if [ $# -eq 0 ]; then | |
sudo lsof -iTCP -sTCP:LISTEN -n -P | |
elif [ $# -eq 1 ]; then | |
sudo lsof -iTCP -sTCP:LISTEN -n -P | grep -i --color $1 | |
else | |
echo "Usage: listening [pattern]" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable logging to file | |
SET GLOBAL log_output = "FILE"; | |
SET GLOBAL general_log_file = "/tmp/q_logfile.log"; | |
SET GLOBAL general_log = 'ON'; | |
# dump database | |
mysqldump --routines --single-transaction -q --add-drop-table --create-options --add-drop-database --disable-keys --extended-insert --set-charset {database_name} | gzip > {database_name}.sql.gz | |
# remove definer | |
perl -p -i.bak -e "s/DEFINER=[^ |\s]*//g" dbdumpfile.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# master reset cache, index and statics | |
sudo php ./bin/magento maintenance:enable && \ | |
sudo php ./bin/magento setup:upgrade && \ | |
sudo php ./bin/magento indexer:reindex && \ | |
sudo php ./bin/magento setup:static-content:deploy -j 1 && \ | |
sudo php ./bin/magento cache:clean && \ | |
sudo php ./bin/magento setup:di:compile && \ | |
sudo php ./bin/magento maintenance:disable | |
# reset admin pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Load Magento API | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
//First we load the model | |
$model = Mage::getModel('module_identifier'); | |
//Then execute the task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
VENDOR_LOCATION='' | |
for i in "$@" | |
do | |
case $i in | |
-l=*|--location=*) | |
VENDOR_LOCATION="${i#*=}" | |
shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zend_extension=/usr/lib/php5/20121212/xdebug.so | |
xdebug.max_nesting_level="1000" | |
xdebug.remote_host=35.35.35.1 | |
xdebug.remote_enable=1 | |
xdebug.remote_port=9001 | |
xdebug.remote_log="/tmp/xdebug.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# xDebug | |
sudo apt-get install php-xdebug | |
# enable / disable | |
sudo phpdismod xdebug | |
sudo phpenmod xdebug | |
# xDebug CLI | |
# in PhpStorm set debugger port to 9001 if nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to ~/.bashrc | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\[\033[01;32m\]\u@\h\[\033[01;36m\] \w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = emailhere | |
name = namehere | |
[color] | |
ui = auto | |
interactive = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green |