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/bash | |
if [ $# -lt 5 ]; then | |
echo "Exports data from mysql database in tables matching a like pattern e.g. 'table_%'" | |
echo "Usage: $0 dbname dbuser dbpass pattern outputfile" | |
exit 1 | |
fi | |
DBNAME=$1 | |
DBUSER=$2 |
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
#!/usr/bin/env ruby | |
require 'image_size' | |
pwd = File.dirname(__FILE__) | |
Dir.glob(pwd+'/*') do |file| | |
if (File.extname(file) == '.jpg') | |
fh = File.open(file, 'rb') | |
size = ImageSize.new(fh.read) |
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 | |
$mail = new Zend_Mail(); | |
$mail->setFrom('[email protected]', 'Me') | |
->addTo($to) | |
->setSubject($subject) | |
->setBodyText($message); | |
$file = '/path/to/a/file'; |
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
SELECT count(*) tables, | |
concat(round(sum(table_rows)/1000000,2),'M') rows, | |
concat(round(sum(data_length)/(1024*1024*1024),2),'G') data, | |
concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx, | |
concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G') total_size, | |
round(sum(index_length)/sum(data_length),2) idxfrac | |
FROM information_schema.TABLES | |
WHERE table_schema = 'database-name' | |
ORDER BY data_length+index_length DESC LIMIT 10; |
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
DROP TABLE IF EXISTS core_file_storage; | |
CREATE TABLE IF NOT EXISTS core_file_storage ( | |
`file_id` int(10) unsigned NOT NULL AUTO_INCREMENT, | |
`content` LONGBLOB NOT NULL, | |
`upload_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | |
`filename` varchar(255) NOT NULL DEFAULT '', | |
`directory_id` int(10) unsigned DEFAULT NULL, | |
`directory` varchar(255) DEFAULT NULL, | |
PRIMARY KEY (`file_id`), | |
UNIQUE KEY `IDX_FILENAME` (`filename`, `directory`), |
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
<?xml version="1.0"?> | |
<!-- Disable Catalog Price Rules Menu Entry --> | |
<config> | |
<menu> | |
<promo translate="title" module="catalogrule"> | |
<children> | |
<catalog translate="title" module="catalogrule"> | |
<depends> | |
<module>Disable_This_Module</module> |
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
#!/usr/bin/env bash | |
wget --no-check-certificate -O chef.tgz https://github.com/opscode/chef/tarball/10-stable | |
mkdir chef-stable | |
tar zxf chef.tgz --strip-components=1 -C chef-stable | |
cd chef-stable/chef | |
gem build chef.gemspec | |
/opt/ruby/bin/gem install chef --no-ri --no-rdoc | |
cd ../../ | |
rm -rf chef-stable |
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
/** | |
* Prepare layout | |
* | |
* @return Mage_CatalogSearch_Block_Result | |
*/ | |
protected function _prepareLayout() | |
{ | |
// add Home breadcrumb | |
$breadcrumbs = $this->getLayout()->getBlock('breadcrumbs'); | |
if ($breadcrumbs) { |
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
<config> | |
... | |
<global> | |
... | |
<frontend> | |
<events> | |
<controller_action_predispatch> | |
<observers><log><type>disabled</type></log></observers> | |
</controller_action_predispatch> | |
<controller_action_postdispatch> |
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
class ApplicationController < ActionController::Base | |
# Catch all exceptions at a stretch | |
rescue_from Exception, :with => :handle_exceptions | |
private | |
# Handle exceptions | |
def handle_exceptions(e) | |
case e |
OlderNewer