Skip to content

Instantly share code, notes, and snippets.

@honzajavorek
Created February 15, 2013 10:30
Show Gist options
  • Save honzajavorek/4959575 to your computer and use it in GitHub Desktop.
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
#!/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