Monthly Archives: December 2014

need to list a directory contents as a text file in windows?

cmd

go to the desired dir, then

dir > print.txt

Advertisements

change table owner to dbo ms sql

http://stackoverflow.com/questions/1146599/how-do-i-change-db-schema-to-dbo

You can run the following, which will generate a set of ALTER sCHEMA statements for all your talbes:

SELECT 'ALTER SCHEMA dbo TRANSFER ' + TABLE_SCHEMA + '.' + TABLE_NAME 
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'jonathan'

You then have to copy and run the statements in query analyzer.

cpanel check disk space and make space

Delete cPanel File Manager temp files

rm -fv /home/*/tmp/Cpanel_*

 

Remove cPanel update archives

/usr/local/apache.backup*

 

Clean up Yum files

yum clean all

 

Remove pure-ftp partials

locate .pureftpd-upload | xargs rm -fv

 

find directories larger than ‘x’mb

du -sm * | awk ‘$1 > 1000’

 

find files larger than 100mb

find . -type f -size +100M -print0 | xargs -0 du -chs

 

tmpDSK removing all files from tmpdsk except the last 6 hours

tmpwatch –all -mf 6 /tmp

 

Type the following command at the shell prompt to find out top 10 largest file/directories:

du -a /var | sort -n -r | head -n 10