php artisan cache:clear
composer dump-autoload
sudo chmod -R 775 storage/
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Category: DevOps
-
SSH login using key flag
ssh -p 22 -i ~/.ssh/<name_of_key> <username>@<host>
-
“SSH Too Many Authentication Failures” Error
To fix this error, you need to add the
IdentitiesOnly
with a value ofyes
, which instructs ssh to only use the authentication identity files specified on the command line or the configured in the ssh_config file(s), even if ssh-agent offers additional identities.For example:
$ ssh -o IdentitiesOnly=yes vps2
More info in this article
On a side note, if FileZilla shoots an error at connecting, run the following command from the terminal:
$ SSH_AUTH_SOCK=null filezilla &
-
Install MySQL on Mac with Homebrew
Uninstall first if needed
brew remove mysql brew cleanup launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist sudo rm -rf /usr/local/var/mysql
Install
brew install mysql mysqld --initialize --explicit_defaults_for_timestamp mysql.server start # no sudo!
Another good guide here
Useful commands
brew services start mysql brew services stop mysql brew services restart mysql
-
Install Nginx, PHP, MySQL on Mac
A very good guide here
-
Remove WordPress users via WP CLI
Remove users with customer role:
# Delete user 123 and reassign posts to user 567 $ wp user delete 123 --reassign=567 --yes Success: Removed user 123 from http://example.com # Delete all contributors and reassign their posts to user 2 $ wp user delete $(wp user list --role=customer --field=ID) --reassign=2 --yes Success: Removed user 813 from http://example.com Success: Removed user 578 from http://example.com # Delete all contributors in batches of 100 (avoid error: argument list too long: wp) $ wp user delete $(wp user list --role=customer --field=ID | head -n 100) --reassign=567 --yes
Source: https://developer.wordpress.org/cli/commands/user/delete/
-
Error: ENOSPC: System limit for number of file watchers reached
The meaning of this error is that the number of files monitored by the system has reached the limit!!
Result: The command executed failed! Or throw a warning (such as executing a react-native start VSCode)
Solution:
Modify the number of system monitoring files
Ubuntu
sudo gedit /etc/sysctl.conf
Add a line at the bottom
fs.inotify.max_user_watches=524288
Then save and exit!
sudo sysctl -p
to check it
Then it is solved!