To clear the DNS cache in Windows start the command prompt (as a admin) and use the following
ipconfig /flushdns |
To clear the DNS cache in Windows start the command prompt (as a admin) and use the following
ipconfig /flushdns |
If you have the problem that you have moved a magento database (and perhaps files to) from one server to another, you have update
web/unsecure/base_url & web/secure/base_url in the database to point at the new address, but the admin panel login is still redirecting to the old address, then the solution is fairly simple.
Make the var folder writable to the web server and clear out the var/session and var/cache folders.
Here is how to quickly create a database and add a user to a mysql database (the mysql console).
(Yes some values need to be changed)
Update: This approch will not work when using MySQL server under Windows.
If you run into the error “No shorewall compiler installed” (for instance using shorewall check) then there is a quick fix for this.
The fix is to install shorewall-perl (using “apt-get install shorewall-perl”).
Then you should be set.
Using a .htaccess file it is not hard to limit access to a directory to only certain ips.
order deny,allow deny from all allow from 10.8.0 allow from 81.257.140.212 |
Using only a partial ip (like 10.8.0) means a wildcard so all of the 10.8.0.0/24 rage is allowed.
# default behavior for the release upgrader # [DEFAULT] # default prompting behavior, valid options: # never - never prompt for a new distribution version # normal - prompt if a new version of the distribution is available # lts - prompt only if a LTS version of the distribution is available Prompt=normal |
If you would like to turn on Template hits and block names in the admin panel this can be quickly done via the database.
INSERT INTO core_config_data (scope, scope_id, path, VALUE) VALUES ('default', 0, 'dev/debug/template_hints', 1), ('default', 0, 'dev/debug/template_hints_blocks', 1); |
Note, don’t forget to add your prefix if you are using one.
To turn this off once you are done, either delete these rows from the database, or set the values to 0. (If you set them to 0 you can later reactivate this by just swapping it back to 1, but the insert statement won’t work any more.
Just ran into the case that I needed to clear the order history of a magento installation (basically we had made fake orders when we were testing and wanted the statistics to be correct when we started for real).
Executing the following in the database solved this issue (warning if you are using a database prefix, don’t forget to update this script before executing)
SET FOREIGN_KEY_CHECKS=0; -- reset orders TRUNCATE `sales_order`; TRUNCATE `sales_order_datetime`; TRUNCATE `sales_order_decimal`; TRUNCATE `sales_order_entity`; TRUNCATE `sales_order_entity_datetime`; TRUNCATE `sales_order_entity_decimal`; TRUNCATE `sales_order_entity_int`; TRUNCATE `sales_order_entity_text`; TRUNCATE `sales_order_entity_varchar`; TRUNCATE `sales_order_int`; TRUNCATE `sales_order_text`; TRUNCATE `sales_order_varchar`; TRUNCATE `sales_flat_quote`; TRUNCATE `sales_flat_quote_address`; TRUNCATE `sales_flat_quote_address_item`; TRUNCATE `sales_flat_quote_item`; TRUNCATE `sales_flat_quote_item_option`; TRUNCATE `sales_flat_order_item`; TRUNCATE `sendfriend_log`; TRUNCATE `tag`; TRUNCATE `tag_relation`; TRUNCATE `tag_summary`; TRUNCATE `wishlist`; TRUNCATE `log_quote`; TRUNCATE `report_event`; TRUNCATE `sales_order_tax`; TRUNCATE `sales_flat_quote_shipping_rate`; TRUNCATE `sales_flat_quote_payment`; ALTER TABLE `sales_order` AUTO_INCREMENT=1; ALTER TABLE `sales_order_datetime` AUTO_INCREMENT=1; ALTER TABLE `sales_order_decimal` AUTO_INCREMENT=1; ALTER TABLE `sales_order_entity` AUTO_INCREMENT=1; ALTER TABLE `sales_order_entity_datetime` AUTO_INCREMENT=1; ALTER TABLE `sales_order_entity_decimal` AUTO_INCREMENT=1; ALTER TABLE `sales_order_entity_int` AUTO_INCREMENT=1; ALTER TABLE `sales_order_entity_text` AUTO_INCREMENT=1; ALTER TABLE `sales_order_entity_varchar` AUTO_INCREMENT=1; ALTER TABLE `sales_order_int` AUTO_INCREMENT=1; ALTER TABLE `sales_order_text` AUTO_INCREMENT=1; ALTER TABLE `sales_order_varchar` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1; ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1; ALTER TABLE `tag` AUTO_INCREMENT=1; ALTER TABLE `tag_relation` AUTO_INCREMENT=1; ALTER TABLE `tag_summary` AUTO_INCREMENT=1; ALTER TABLE `wishlist` AUTO_INCREMENT=1; ALTER TABLE `log_quote` AUTO_INCREMENT=1; ALTER TABLE `report_event` AUTO_INCREMENT=1; ALTER TABLE `sales_order_tax` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1; ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1; -- reset customers TRUNCATE `customer_address_entity`; TRUNCATE `customer_address_entity_datetime`; TRUNCATE `customer_address_entity_decimal`; TRUNCATE `customer_address_entity_int`; TRUNCATE `customer_address_entity_text`; TRUNCATE `customer_address_entity_varchar`; TRUNCATE `customer_entity`; TRUNCATE `customer_entity_datetime`; TRUNCATE `customer_entity_decimal`; TRUNCATE `customer_entity_int`; TRUNCATE `customer_entity_text`; TRUNCATE `customer_entity_varchar`; TRUNCATE `log_customer`; TRUNCATE `log_visitor`; TRUNCATE `log_visitor_info`; ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1; ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1; ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1; ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1; ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1; ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1; ALTER TABLE `customer_entity` AUTO_INCREMENT=1; ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1; ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1; ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1; ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1; ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1; ALTER TABLE `log_customer` AUTO_INCREMENT=1; ALTER TABLE `log_visitor` AUTO_INCREMENT=1; ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1; -- Reset all ID counters TRUNCATE `eav_entity_store`; ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1; -- Clear logs TRUNCATE `log_url_info`; TRUNCATE `log_url`; ALTER TABLE `log_url_info` AUTO_INCREMENT=1; ALTER TABLE `log_url` AUTO_INCREMENT=1; SET FOREIGN_KEY_CHECKS=1; |
This is mostly based on a very nice post by the guys at inchoo
And it should go without saying, make a backup before trying this out.
(was tested on 1.3.2.4)
To delete one message from the exim queue
exim -Mrm message-id |
To find the ids of all qued mails
mailq |
If you wish to delete all the messages to a specific email recipient.
exiqgrep -i -r '<mail@example.com>' | xargs exim -Mrm |
Of if you wish to delete all messages that were sent from a specific email address.
exiqgrep -i -f '<mail@example.com>' | xargs exim -Mrm |
If you have a form that you do not wish to use autocompletion for (either you want to disable password auto completion “for real”, or perhaps you have a form where the saved credentials are filled in where they shouldn’t be) then a quick tip to achieve this is to set ‘ autocomplete=”off” ‘ on the form.
<form id="loginForm" action="login.php" method="post" autocomplete="off"> |