Skip to content

Instantly share code, notes, and snippets.

use strict;
use warnings;
use Benchmark qw(cmpthese);
my $String = "ATGC" x 1000;
my @Genes = qw(A T G C);
my %Count;
my %dispatch = map { $_ => eval "sub { \$_[0] =~ tr/$_// }" } @Genes;
my $edit = sub {
my ($line, $eof) = @_;
if ($. %2){ chomp($line) } else { $line =~ s/^/ = / }
print $line;
};
perl -F, -lane'
BEGIN {
$x = pop;
## Create array of arrays from start and end ranges
## $range = ( [0,0] , [1,10] ... )
(undef, @range)= map { chomp; [split /,/] } <>;
@ARGV = $x;
}
## Skip the first line
next if $. ==1;
@mpapec
mpapec / tcpdump.log
Created June 17, 2014 07:16
tcpdump -vv -x -X -s 1500 -i eth0 'port 23'
10:11:17.778693 IP (tos 0x0, ttl 64, id 63881, offset 0, flags [DF], proto TCP (6), length 60)
10.1.6.118.45371 > 10.1.6.127.telnet: Flags [S], cksum 0x2125 (incorrect -> 0x9178), seq 2950613336, win 14600, options [mss 1460,sackOK,TS val 20066513 ecr 0,nop,wscale 3], length 0
0x0000: 4500 003c f989 4000 4006 203c 0a01 0676 E..<..@.@..<...v
0x0010: 0a01 067f b13b 0017 afde c958 0000 0000 .....;.....X....
0x0020: a002 3908 2125 0000 0204 05b4 0402 080a ..9.!%..........
0x0030: 0132 30d1 0000 0000 0103 0303 .20.........
10:11:17.779132 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
10.1.6.127.telnet > 10.1.6.118.45371: Flags [S.], cksum 0x5a67 (correct), seq 3752203257, ack 2950613337, win 5792, options [mss 1460,sackOK,TS val 41444178 ecr 20066513,nop,wscale 1], length 0
0x0000: 4500 003c 0000 4000 4006 19c6 0a01 067f E..<..@.@.......
0x0010: 0a01 0676 0017 b13b dfa6 13f9 afde c959 ...v...;.......Y