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 COUNT(*) FROM information_schema.tables WHERE table_schema = '<database_name>'; |
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
-- SET GLOBAL event_scheduler = ON; | |
-- create table growth_history(tbl_name varchar(64), row_count bigint, time_stamp datetime); | |
DELIMITER $$ | |
CREATE | |
EVENT `document_growth_history` | |
ON SCHEDULE EVERY 1 DAY | |
DO BEGIN |
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
-- SET GLOBAL event_scheduler = ON; | |
-- create table db_growth_history(db_name varchar(64), tbl_name varchar(64), avg_row_length int, row_count bigint, time_stamp datetime); | |
DELIMITER $$ | |
CREATE | |
EVENT `document_db_growth_history` | |
ON SCHEDULE EVERY 1 DAY | |
DO BEGIN | |
-- Grab db name, table name, avg row length, row count, add timestamp = growth_history |
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
git submodule foreach --recursive git checkout master |
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 | |
find $1 -size $2c -delete |
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
# How to assemble raid device | |
mdadm --create --verbose /dev/md128 --level=1 --raid-devices=2 /dev/xvdm /dev/xvdn | |
# Make file system | |
mkfs -t xfs /dev/md128 | |
# How to re-assemble | |
mdadm --assemble --verbose /dev/md128 /dev/xvdm /dev/xvdn | |
# Get UUID |
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 | |
# http://stackoverflow.com/questions/424071/list-all-the-files-for-a-commit-in-git | |
git diff-tree --no-commit-id --name-only -r $1 |
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
# Colors | |
DARK_PURPLE="\[\033[1;34m\]" | |
GREEN="\[\033[0;32m\]" | |
GREY="\[\033[1;30m\]" | |
NORMAL="\[\033[0m\]" | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
# Git shortcuts | |
alias gci='git commit' |
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 | |
// Javascript/HTML hex encode | |
function encode($input) | |
{ | |
$temp = ''; | |
$length = strlen($input); | |
for($i = 0; $i < $length; $i++) | |
$temp .= '%' . bin2hex($input[$i]); | |
return $temp; | |
} |
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 | |
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/3.2.3/lib/pkgconfig |