This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Cleanup docker files: untagged containers and images. | |
# | |
# Use `docker-cleanup -n` for a dry run to see what would be deleted. | |
untagged_containers() { | |
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1. | |
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6). | |
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470 | |
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Base-name | |
$name = 'foobar'; | |
// Init Magento | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
// Create the root catalog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install as superuser | |
wget http://files.magerun.net/n98-magerun-latest.phar -O magerun && chmod +x magerun && mv magerun /usr/local/bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php -d apc.enable_cli=0 magerun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete FROM `catalog_product_entity_datetime` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_decimal` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_gallery` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_group_price` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_int` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_media_gallery` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_text` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_tier_price` where entity_id not in (select entity_id from catalog_product_entity); | |
delete FROM `catalog_product_entity_varchar` where entity_id not in (select entity_id fro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLastLine($file, $bufferSize){ | |
$fp = fopen($file, 'r'); | |
$size = filesize($file); | |
$buffer = ''; | |
for ($pos = $size - $bufferSize; ; $pos -= $bufferSize) { | |
$pos = max(0, $pos); | |
fseek($fp, $pos); | |
$b = rtrim(fread($fp, $bufferSize)); | |
$nlPos = strrpos($b, "\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://blog.chapagain.com.np/magento-adding-attribute-from-mysql-setup-file/ | |
<?php | |
$installer = $this; | |
$setup = new Mage_Eav_Model_Entity_Setup('core_setup'); | |
$installer->startSetup(); | |
/** | |
* Adding Different Attributes | |
*/ |