Created
February 15, 2013 10:30
-
-
Save honzajavorek/4959575 to your computer and use it in GitHub Desktop.
PHP/shell script to fill a disk by zeros, useful when you want to completely clear a disk without any option of restoring original data
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 | |
echo "<?php \$i = 0; while(true) if (false === @file_put_contents('zerofile' . \$i, str_repeat('0', 134217728), FILE_APPEND)) \$i++;" | php | |
rm zerofile* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment