Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created March 1, 2009 10:58
Show Gist options
  • Save miyagawa/72301 to your computer and use it in GitHub Desktop.
Save miyagawa/72301 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use URI;
my $mms = shift @ARGV or die "Usage: mms-ssh-proxy-open.pl MMSURL [time]\n";
my $time = shift @ARGV || 3600;
my $uri = URI->new($mms);
my $ssh_host = $ENV{SSH_HOST} || shift @ARGV or die "SSH_HOST not defined\n";
my $mms_host = $uri->host;
$uri->host("localhost");
system "ssh -f -L 1755:$mms_host:1755 $ssh_host 'sleep $time'";
system "open $uri";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment