View gist:10518179
update core_config_data set value = 'http://domainname/' where path = 'web/unsecure/base_url'; | |
update core_config_data set value = 'http://domainname/' where path = 'web/secure/base_url'; |
View gist:10514380
1) Install Varnish first | |
https://gist.github.com/nghuuphuoc/7819928 | |
2) Install Nexcessnet_Turpentine | |
$ cd <Magento directory> | |
$ chmod 755 mage | |
$ ./mage install connect20.magentocommerce.com/community Nexcessnet_Turpentine | |
Checking dependencies of packages | |
Starting to download Nexcessnet_Turpentine-0.6.0.tgz ... | |
...done: 59,467 bytes |
View gist:9948331
// $value is the original string | |
// $keyword is the searching keyword | |
function highlight($value, $keyword) { | |
try { | |
$dom = new DomDocument(); | |
@$dom->loadHtml($value); | |
$xpath = new DomXpath($dom); | |
$upper = strtoupper(addslashes($keyword)); | |
$lower = strtolower(addslashes($keyword)); | |
// Support i-case sensitive using translate method provided by XPath 1.0 |
View gist:8331575
$ find . -type d -print0 | xargs -0 chmod 0775 | |
$ find . -type f -print0 | xargs -0 chmod 0664 |
View gist:8311022
$ find . -name .svn -exec rm -rf {} \; |
View gist:8282411
$ wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2 | |
$ tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2 | |
$ mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf | |
// In case you got the issue | |
// wkhtmltopdf: error while loading shared libraries: | |
// libfontconfig.so.1: cannot open shared object file: No such file or directory | |
// | |
// run the command below: | |
$ yum install urw-fonts libXext libXrender fontconfig libfontconfig.so.1 |
View gist:8144617
server { | |
listen 80; | |
server_name domain.com; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; |
View Add swap
// Check swap | |
$ sudo swapon -s | |
Filename Type Size Used Priority --> empty | |
// Create and enable swap file | |
$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k | |
$ sudo mkswap /swapfile | |
Setting up swapspace version 1, size = 262140 KiB | |
no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb |
View gist:7904221
// Add the following line to wp-config.php | |
define('FS_METHOD','direct'); | |
// Set wp-content permission | |
$ chmod -R 775 wp-content/ | |
$ chown -R nginx:nginx wp-content/ |
View gist:7886804
server { | |
set $supercache_file ''; | |
set $supercache_uri $request_uri; | |
if ($request_method = POST) { | |
set $supercache_uri ''; | |
} | |
# Using pretty permalinks, so bypass the cache for any query string | |
if ($query_string) { |