This file contains 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
import os | |
def split(filehandler, delimiter=',', row_limit=10000, | |
output_name_template='output_%s.csv', output_path='.', keep_headers=True): | |
""" | |
Splits a CSV file into multiple pieces. | |
A quick bastardization of the Python CSV library. | |
Arguments: |
This file contains 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 | |
# | |
# Whitelist Pingdom probe-servers in iptables. | |
# | |
# Create a chain called "PINGDOM" and jump to it somewhere before | |
# the final REJECT/DROP, e.g. | |
# | |
# # New chain for Pingdom rules | |
# :PINGDOM - [0:0] | |
# |
This file contains 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 | |
DATE_FORMAT( | |
sales_flat_order.created_at, | |
'%Y-%m-%d' | |
) AS DAY, | |
CONCAT( | |
'$', | |
FORMAT( | |
SUM(sales_flat_order.`grand_total`), | |
2 |
This file contains 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 | |
mysql -NBe "SHOW DATABASES;" | grep -v 'lost+found' \ | |
| while read database ; do | |
#skip system-db | |
if [ "$database" = "mysql" ] ; then | |
continue | |
fi | |
mysql -NBe "SHOW TABLE STATUS;" $database \ | |
| while read name engine version rowformat rows avgrowlength \ |
This file contains 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
aws rds reset-db-parameter-group --db-parameter-group-name=etl --reset-all-parameters | |
aws rds modify-db-parameter-group --db-parameter-group-name=etl \ | |
--parameters="ParameterName=character_set_server, ParameterValue=utf8, ApplyMethod=immediate" \ | |
--parameters="ParameterName=collation_server, ParameterValue=utf8_general_ci, ApplyMethod=immediate" \ | |
--parameters="ParameterName=slow_query_log, ParameterValue=1, ApplyMethod=immediate" \ | |
--parameters="ParameterName=log_queries_not_using_indexes, ParameterValue=1, ApplyMethod=immediate" \ | |
--parameters="ParameterName=max_allowed_packet, ParameterValue=67108864, ApplyMethod=immediate" \ | |
--parameters="ParameterName=log_bin_trust_function_creators, ParameterValue=1, ApplyMethod=immediate" \ | |
--parameters="ParameterName=tmp_table_size, ParameterValue={DBInstanceClassMemory/16}, ApplyMethod=immediate" \ | |
--parameters="ParameterName=max_heap_table_size, ParameterValue={DBInstanceClassMemory/16}, ApplyMethod=immediate" \ |
This file contains 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 | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); | |
$products = Mage::getModel('catalog/product')->getCollection(); | |
//->addAttributeToFilter('entity_id', array('gt' => 14000)); | |
$mediaApi = Mage::getModel("catalog/product_attribute_media_api"); |
NewerOlder