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 DB_NAME(us.[database_id]) as [db], OBJECT_NAME(us.[object_id], us.[database_id]) as [object], | |
| MAX(us.[last_user_lookup]) as [last_user_lookup], MAX(us.[last_user_scan]) as [last_user_scan], MAX(us.[last_user_seek]) as [last_user_seek] | |
| from sys.dm_db_index_usage_stats as us | |
| where us.[database_id] = DB_ID() AND us.[object_id] = OBJECT_ID('TABLENAME') | |
| group by us.[database_id], us.[object_id]; |
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 | |
| $config['components']['assetManager']['hashCallback'] = function($path){ | |
| $mostRecentFileMTime = 0; | |
| if (is_dir($path)){ | |
| $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST); | |
| foreach ($iterator as $fileinfo) { | |
| if ($fileinfo->isFile() && $fileinfo->getMTime() > $mostRecentFileMTime) { | |
| $mostRecentFileMTime = $fileinfo->getMTime(); | |
| } | |
| } |
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 | |
| # use on develop servers only | |
| DAYSSTORING=14 | |
| GZIP="$(which gzip)" | |
| BACKUPDIR=/home/patricy/backup/database | |
| BACKUPPREFIX="all-databases" | |
| MYSQLDUMP="$(which mysqldump)" |
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 | |
| echo | |
| echo "============ Migration control v1.0 (by Patricy) 21-10-2015 ===============" | |
| RED='\033[1;31m' | |
| GREEN='\033[1;32m' | |
| NC='\033[0m' | |
| LOG_CHECK_PERIOD="1 month ago" | |
| SECONDS_CHECK=10 | |
| modelsPulled="$(git log --since="$LOG_CHECK_PERIOD" --pretty=format:"%h %ai" --name-only|grep yaml|while read line; do if [ -f $line ]; then DATE_LAST_MOD=`date -r $line +%s`; else DATE_LAST_MOD=0; fi;DATE_LAST_PULL=`date -r ./.git/FETCH_HEAD +%s`;COUNT=$(($DATE_LAST_PULL-$DATE_LAST_MOD));if [ $COUNT -lt $SECONDS_CHECK ]; then echo $line;fi;done|wc -l)" |