Skip to content

Instantly share code, notes, and snippets.

View ivanproskuryakov's full-sized avatar
🏢
https://github.com/communa

Ivan ivanproskuryakov

🏢
https://github.com/communa
View GitHub Profile
#Servers
set :application, "internetsms"
set :domain, "internetsms.org"
set :deploy_to, "/home/karser/internetsms"
set :app_path, "app"
role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Symfony2 migrations will run
set :keep_releases, 3
logger.level = Logger::INFO
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
@ivanproskuryakov
ivanproskuryakov / gist:9861246
Last active August 29, 2015 13:57
symfony2 cache
sudo chmod +a "_www allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
php app/console assets:install web --symlink
1. apt-get install varnish
2. http://www.magentocommerce.com/magento-connect/turpentine-varnish-cache.html
3. insert key nano /etc/varnish/secret +"\n"
varnishlog
DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
-f ${VARNISH_VCL_CONF} \
-T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
-t ${VARNISH_TTL} \
php indexer.php --status
php indexer.php --reindex catalog_product_price
Here catalog_product_price is the index type that you want to rebuild. You can use next arguments for different types of indexes:
catalog_product_attribute Product Attributes
catalog_product_price Product Prices
catalog_url Catalog Url Rewrites
catalog_product_flat Product Flat Data
catalog_category_flat Category Flat Data
catalog_category_product Category Products
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html
MyEntity:
type: entity
repositoryClass: MyRepositoryClass
table: my_entity
namedQueries:
all: "SELECT u FROM __CLASS__ u"
# Class-Table-Inheritance
@ivanproskuryakov
ivanproskuryakov / orderexport.php
Last active September 8, 2016 07:58
Magento orders export
$file = __DIR__.’/orders/orders.xml’;
if (file_exists($file)) {
exit();
}
set_time_limit(0);
ini_set(‘memory_limit’, ’1024M’);
include_once “../app/Mage.php”;
umask (0);
//Mage::app(‘default’);
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Acme\DemoBundle\Entity\Book;
@ivanproskuryakov
ivanproskuryakov / hosts
Last active August 29, 2015 14:14 — forked from amitaibu/hosts
# /etc/ hosts
# For local developement
127.0.0.1 app.local
127.0.0.1 api.app.local
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.