This file contains hidden or 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
# from -> to | |
# Copy to home directory as if web root isn't owned by the "ubuntu" user will get permission denied | |
scp -r -i ~/.ssh/adapt_framework_test.pem /home/carlton/Desktop/work [email protected]:/home/ubuntu/ | |
# Move files from home to web root | |
mv /home/ubuntu/ /var/www/html | |
# May have to set permissions on relocated files so the web server can serve them |
This file contains hidden or 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
# Use public IP as per EC2 dashboard | |
ssh [email protected] -i ~/.ssh/some_key.pem |
This file contains hidden or 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
Handlebars.registerHelper("debug", function(optionalValue) { | |
console.log("Current Context"); | |
console.log("===================="); | |
console.log(this); | |
if (optionalValue) { | |
console.log("Value"); | |
console.log("===================="); | |
console.log(optionalValue); | |
} |
This file contains hidden or 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
# DROP INDEX | |
SELECT IF ( | |
EXISTS( | |
SELECT * FROM INFORMATION_SCHEMA.statistics | |
WHERE table_schema = DATABASE() AND TABLE_NAME = '<table_name>' AND index_name LIKE '<index_name>' | |
) | |
,'ALTER TABLE `<table_name>` DROP INDEX `<index_name>`' | |
,'select "index <index_name> does not exist";') INTO @a; | |
PREPARE stmt1 FROM @a; | |
EXECUTE stmt1; |
This file contains hidden or 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
# http://stackoverflow.com/questions/4649356/how-do-i-run-git-log-to-see-changes-only-for-a-specific-branch | |
git cherry -v master | |
# or | |
git log master.. |
This file contains hidden or 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
# Assuming the following xdebug.ini is used | |
zend_extension=xdebug.so | |
xdebug.default_enable=0 | |
xdebug.idekey="PHPSTORM" | |
xdebug.remote_enable=1 | |
xdebug.remote_connect_back=1 | |
xdebug.remote_autostart=0 | |
xdebug.remote_port=9000 |
This file contains hidden or 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=xdebug.so | |
xdebug.default_enable=0 | |
xdebug.idekey="PHPSTORM" | |
xdebug.remote_enable=1 | |
xdebug.remote_connect_back=1 | |
xdebug.remote_autostart=0 | |
xdebug.remote_port=9000 | |
xdebug.remote_handler=dbgp | |
xdebug.remote_host=localhost |
This file contains hidden or 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
# Credit to http://www.iarp.ca/hobby/computing/36-git-committed-and-pushed-to-the-incorrect-branch | |
# Ensure you're in the branch that you commited to by accident. | |
git checkout master | |
# Reset the branch back one commit. | |
git reset --soft HEAD^ | |
# Stash the changes | |
git stash |
This file contains hidden or 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
# ALIASES | |
## APACHE | |
alias apache-restart='sudo service apache2 restart' | |
alias apache-reload='sudo service apache2 reload' | |
## PHP | |
alias cdd-command='/usr/bin/php /var/www/commands/app/app.php' | |
## GIT |
This file contains hidden or 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
# http://stackoverflow.com/a/20485975/682754 | |
# Log to file | |
#### Turn on and configure | |
SET global log_output = 'FILE'; | |
SET global general_log_file='/tmp/mysql_general.log'; | |
SET global general_log = 1; | |
#### Turn off |