Magento SQL Snippets
Clear Temporary Data Tables
TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
# Magento Connect 2 cache directories and files | |
downloader/pearlib/cache/ | |
downloader/*.cfg | |
# Magento runtime media files | |
media/catalog/product/cache/ | |
media/tmp/ | |
media/js/ | |
media/css/ | |
media/.thumbs/ |
# The MySQL database server configuration file. | |
# | |
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM | |
# | |
# Remember to edit /etc/mysql/debian.cnf when changing the socket location. | |
[client] | |
port = 3306 | |
socket = /var/run/mysqld/mysqld.sock | |
# This was formally known as [safe_mysqld]. Both versions are currently parsed. |
class KeyGenerator | |
require "digest/sha1" | |
def self.generate(length = 12) | |
Digest::SHA1.hexdigest(Time.now.to_s + rand(567891234).to_s)[1..length] | |
end | |
end |
# | |
# Customized VCL file for serving up a Drupal site with multiple back-ends. | |
# | |
# For more information on this VCL, visit the Lullabot article: | |
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal | |
# | |
# Define the internal network subnet. | |
# These are used below to allow internal access to certain files while not | |
# allowing access from the public internet. |
TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
Not only useful in programming, regular expressions can make complex tasks easy in many different scenarios. Here is a great site for testing your regex:
http://rubular.com
Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/
./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent
<VirtualHost *:80> | |
DocumentRoot "/path/to/web/files/" | |
ServerAdmin webmaster@localhost | |
ServerName localhost | |
#SetEnv MAGE_IS_DEVELOPER_MODE true | |
#SetEnv MAGE_RUN_CODE storecode | |
#SetEnv MAGE_RUN_TYPE website | |
<Directory "/path/to/web/files/"> |
GRANT USAGE ON *.* TO `user`@`localhost` IDENTIFIED BY 'password'; | |
GRANT CREATE ROUTINE, CREATE VIEW, ALTER, SHOW VIEW, CREATE, ALTER ROUTINE, INSERT, SELECT, DELETE, UPDATE, DROP, LOCK TABLES, CREATE TEMPORARY TABLES, INDEX ON `database`.* TO `user`@`localhost` IDENTIFIED BY 'password'; | |
FLUSH PRIVILEGES; |
#!/usr/bin/env bash | |
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq) | |
for author in ${authors}; do | |
echo "${author} = NAME <USER@DOMAIN>"; | |
done |