This file contains 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
#!/usr/bin/perl | |
dbmopen(%db, "calllog", 0777); | |
print "START-OF-LOG: 3.0\n"; | |
@keys = keys %db; | |
for $k (sort @keys) { | |
$rec = $db{$k}; | |
($freq, $mode, $date, $time, $exch1, $call, $exch2) = split(",", $rec); | |
write; |
This file contains 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
#!/usr/bin/perl | |
sub chomp { | |
$_[0] =~ s/[\r\n]+//; | |
} | |
sub get_time { | |
$label = shift; | |
local(@now); @now = localtime; | |
$now[5] += 1900; |
This file contains 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
#!/usr/bin/perl | |
use strict; | |
no warnings; | |
${} = 5; | |
$} = 10; | |
print "${}\n"; |
This file contains 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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
mkdir ram | |
sudo mount -t tmpfs -osize=4k tmpfs ram | |
perl -le 'open $f, ">", "ram/f"; $i = 0; while (print $f "x") { $i++ }; print "ran out of room after $i bytes"' |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am cowens on github. | |
* I am cowens (https://keybase.io/cowens) on keybase. | |
* I have a public key whose fingerprint is 55A3 0C7F 506A F8C1 667B 94B9 E39B D92B 39CB 08BA | |
To claim this, I am signing this object: |
This file contains 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; | |
use warnings; | |
use Benchmark; | |
my $s = "aaaa 192.168.0.1 sdf"; | |
my %subs = ( | |
norm => sub { | |
return scalar $s =~ /(a)(a)(a)(a)/; |
This file contains 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
@ARGV = map { | |
/((?:[^@]+@)?[^:]+):(.*)/ ? "ssh $1 cat $2 |" : $_ | |
} @ARGV; | |
while (<>) { |
This file contains 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $filename = shift; | |
if (my ($target, $path) = $filename =~ /((?:[^@]+@)?[^:]+):(.*)/) { | |
open my $fh, "-|", "ssh", $target, "cat", $path or die "$!"; | |
while (<$fh>) { |
This file contains 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
#!/bin/bash | |
SCP=/usr/bin/scp | |
declare -a hosts=( | |
host1 | |
host2 | |
host3 | |
) |