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
-- Let’s start by making a new user within the MySQL shell: | |
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
-- Sadly, at this point newuser has no permissions to do anything with the databases. In fact, if newuser even tries to login (with the password, password), they will not be able to reach the MySQL shell. | |
-- Therefore, the first thing to do is to provide the user with access to the information they will need. | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
--The asterisks in this command refer to the database and table (respectively) that they can access—this specific command allows to the user to read, edit, execute and perform all tasks across all the databases and tables. | |
-- Once you have finalized the permissions that you want to set up for your new users, always be sure to reload all the privileges. | |
FLUSH PRIVILEGES; |
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
########### | |
# DRY-RUN # | |
########### | |
# make sure you are on develop; one cannot ever delete the current branch | |
$ git checkout develop | |
# get references | |
$ git fetch |