Bash: SSH with Tunnel

Syntax

ssh user@remoteHost.com -L 81:remoteHost:81

ssh user@192.168.0.112 -L 81:r192.168.0.112:81

Script

#!/bin/bash
function ssh-tunnel-112(){
        export $(grep -v '^#' .env | xargs)
        echo "ssh to .112:8081 to pi:3001"
        sudo ssh me@192.168.0.112 -L 8081:pi:3001
}
echo "creating tunnel on port 81"
ssh-tunnel-112

 

Tags

PHP: Passing Arguments from Bash To PHP

Resources:

Shell

echo "Testing destination dir -" $ytuDest

PHP Main

/*
 * Start of PHP CLI Script
 */
//require_once '/home/silosix/git/phpunitwebdriver/src/Shell/YtdlWrapper.php';
//require_once '../Shell/YtdlWrapper.php';
print "Downloading YT Videos: START"."\n";
print "parsing arguments"."\n";
parse_str($argv[2],$output);
var_dump($argv);
var_dump($output);
$ytuDest = $output['ytuDest'];
print "ytuDest=" .
Tags

Linux: Bash: Echo Commands

echo Options


 Options      Description
 -n      do not print the trailing newline.
 -e      enable interpretation of backslash escapes.
 \b      backspace
 \\      backslash
 \n      new line
 \r      carriage return
 \t      horizontal tab
 \v      vertical tab
Tags
Subscribe to