Skip to content

Instantly share code, notes, and snippets.

@wh13371
wh13371 / perl_template.pl
Last active August 29, 2015 14:14
perl - rough template thats outputs to screen & log file
#! /usr/bin/perl
use strict;
use warnings;
use 5.010;
use Time::HiRes qw/time gettimeofday/;
use POSIX 'strftime';
use FileHandle ('autoflush');
use Getopt::Std;
@wh13371
wh13371 / now.pl
Last active August 29, 2015 14:14
perl - a half decent datetime ("yyyy_mm_dd_HH_mm_ss.ffffff") method
#! /usr/bin/perl
# a Perl script with a "now" method to return a (yyyy_mm_dd_HH_mm_ss.ffffff) timestamp - Linux & Windows filename valid
use strict;
use warnings;
use POSIX; # for "strftime"
use Time::HiRes; # for "Time::HiRes::gettimeofday"
use 5.010;
@wh13371
wh13371 / grep58.py
Last active August 29, 2015 14:14
python - mini grep with text highlight
#! /usr/bin/python
"""
Usage:
grep58.py <pattern> <file>...
grep58.py <pattern>
Examples:
# from file(s)