Last active
December 23, 2015 04:48
-
-
Save nordicdyno/6582314 to your computer and use it in GitHub Desktop.
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
| use strict; | |
| my $h_file = '/private/etc/hosts'; | |
| open my $fh_in, '<', $h_file or die "Can't read file $h_file: $!"; | |
| my @lines; | |
| while(<$fh_in>) { | |
| push @lines, $_; | |
| } | |
| close $fh_in; | |
| open my $fh_out, '>', $h_file or die "Can't write to $h_file: $!"; | |
| for (@lines) { | |
| next if /^[0-9.]+\s+ua\.tribuna\.com/; | |
| next if /^[0-9.]+\s+sports\.ru/; | |
| next if /^[0-9.]+\s+www\.sports\.ru/; | |
| print ${fh_out} $_; | |
| } | |
| close $fh_out; | |
| `killall -HUP mDNSResponder` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment