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
<?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
#!/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
#!/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 |
NewerOlder