david/scripts-archive
david
/
scripts-archive
Archived
1
0
Fork 0
This repository has been archived on 2022-04-16. You can view files and clone it, but cannot push or open issues or pull requests.
scripts-archive/lifesaver.pl

10 lines
260 B
Perl
Executable File

#!/usr/bin/perl
#source: http://www.etherealbits.com/2012/06/the-perl-script-that-may-save-your-life/
open(DEV, '/dev/sda1') or die "Can't open: $!\n";
while (read(DEV, $buf, 4096)) {
print tell(DEV), "\n", $buf, "\n"
if $buf =~ /stringtosearchfor/;
}