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
# Recursively change permissions on directories only: | |
$ find . -type d -exec chmod 777 {} \; | |
# Breaking it down: | |
# Uses the find command on the current directory . | |
# -type d tells find to only look for files of type directory | |
# -exec tells find to perform the following action on each matching file. In this case it was to chmod each directory to 777. | |
# This same technique can be used to chown directories and/or perform the same actions on only files. |
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
# For reference; | |
# Install: https://github.com/OzzyCzech/dotfiles/blob/master/how-to-install-mac.md | |
# Brew: https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/FAQ.md | |
# Start LEMP stack: | |
$ sudo nginx && launchctl load -w /usr/local/opt/php71/homebrew.mxcl.php71.plist && launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.blackfire-agent.plist && mysql.server start | |
# Stop LEMP stack: | |
$ sudo nginx -s stop && launchctl unload -w /usr/local/opt/php71/homebrew.mxcl.php71.plist && launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.blackfire-agent.plist && mysql.server stop |
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
# (must sometimes become root first) | |
$ su <username> |
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
# show branch history | |
$ tig <branch_name> | |
# compare two branches | |
$ tig <branch_name>..<branch_name> |
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
$ mysqldbcompare --server1=<username>:<password>@localhost --server2=<username>:<password>@localhost --difftype=sql --run-all-tests --changes-for=server2 db_name_1:db_name_2 |
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
$ git commit --amend -c <COMMIT HASH> |
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
# vim git-author-rewrite.sh | |
# Copy and paste the script, replacing the following variables based on the information you gathered: | |
``` | |
#!/bin/sh | |
git filter-branch --env-filter ' | |
OLD_EMAIL="<old email address>" | |
CORRECT_NAME="<name>" | |
CORRECT_EMAIL="<new email address>" |
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
# To copy a file from B to A while logged into B: | |
$ scp /path/to/file username@a:/path/to/destination | |
# To copy a file from B to A while logged into A: | |
$ scp username@b:/path/to/file /path/to/destination |
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
# how to retrieve the hash for the current commit in Git? | |
$ git rev-parse HEAD | |
# how do I delete a tag from a Git repo? | |
$ git tag -d release01 | |
$ git push origin :refs/tags/release01 |