Some additional commands for the excellent N98-magerun Magento command-line tool.
Master | |
---|---|
Staging |
There are a few options. You can check out the different options in the Magerun docs.
Here's the easiest:
-
Create ~/.n98-magerun/modules/ if it doesn't already exist.
mkdir -p ~/.n98-magerun/modules/ mkdir -p ~/.n98-magerun2/modules/
-
Clone the hypernode-magerun repository in there
git clone https://github.com/Hypernode/hypernode-magerun.git ~/.n98-magerun/modules/hypernode-magerun
-
Link the repository for n98-magerun2
ln -s ~/.n98-magerun/modules/hypernode-magerun ~/.n98-magerun2/modules/hypernode-magerun
-
It should be installed. To see that it was installed, run magerun without any arguments to see if one of the new commands is in there.
n98-magerun.phar
Example usage:
n98-magerun hypernode:modules:list-updates
See if newer versions exist for your currently installed Magento 1 modules (local & community). I hear you say, Magento Connect already does this? Not really, as Magento Connect only contains Magento-registered modules. As it appears, about 20% of modules-in-the-wild are not registered with Magento.
This tool is a crowdsourced initiative: it will report the latest version of any module as seen in the wild. This does not necessarily mean a newer version is publicly available, just that it exists.
As of Feb 2016, it contains version information of over 500 installations.
n98-magerun hypernode:patches:list
John Knowles maintains an excellent spreadsheet which links Magento versions with required patches.
Running this command will show you which patches you need for the current Magento version and which are already installed. Note that if a patch is installed and not listed in the app/etc/applied.patches.list
a false positive may be the result.
n98-magerun hypernode:log-analyses
Quickly reference the most common lines in the log file ordered by frequency.
n98-magerun hypernode:maps-generate
Outputs or saves a http.magerunmaps boilerplate containing your store setup for Nginx. Refer to the Hypernode Nginx documentation.
n98-magerun hypernode:varnish:config-save
Fetches the VCL configuration from turpentine and applies it. Make sure turpentine is installed and configured correctly.
n98-magerun hypernode:varnish:flush
Flush all URL's that were cached by varnish.
n98-magerun hypernode:performance
By default this command loads Magento's sitemap collection from which you can choose what sitemaps you want to crawl. If the store URL does not match the URL's in the sitemap you will be prompted several options (compare, replace, continue). For instance the old and new URL can be compared in a performance report. Additionally a sitemap can be loaded by specifying a path or URL.
n98-magerun hypernode:crack:admin-passwords -r best64 vendors
Check your site for weak admin credentials by attempting to brute force the password with popular password / variations.
n98-magerun hypernode:crack:api-keys -r best64 vendors
This command words exactly the same as the hypernode:crack:admin-passwords
except it attempts to crack the api_key of SOAP / XML-RPC users. All arguments are the same, check the commands --help
for details.
For development/testing (build package of your feature branch):
gbp buildpackage --git-pbuilder --git-dist=precise --git-arch=amd64
Building a .deb for release:
./build.sh
Then if everything is alright, upload the new version to your repository with something like dput
Currently, only the command hypernode:perfomance
is partially compatible with n98-magerun2.
Please contribute to make more commands available for n98-magerun2!
Thanks to Netz98 for creating the awesome Swiss army knife for Magento, magerun.