-
-
Save Pandiora/378aab070ea7eb21a3945401b5a23fa5 to your computer and use it in GitHub Desktop.
Revisions
-
tsabat revised this gist
Aug 6, 2013 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,11 @@ We hide the services behind an AWS Security Group. But, we can use some trusty SSH action to forward localhost ports to those on the Solr server. After you've added this to your `~/.zshrc` or `~/.bash_profile` and sourced (`source ~/.bash_profile`) it, you can forward these ports from localhost to your server like so: ```bash portforward <hostname> ``` zsh and bash handle string splitting differently, so be sure to choose correctly for your shell. For zsh: -
tsabat revised this gist
Aug 6, 2013 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,14 +17,12 @@ SOLR_PORTS="8080 9292 2812" for both shells ```bash function portforward() { SERVER=$1 for port in $SOLR_PORTS do echo "forwarding $port" ssh -l ubuntu $SERVER -p 22 -N -f -C -L $port":localhost:"$port done } -
tsabat revised this gist
May 15, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ We hide the services behind an AWS Security Group. But, we can use some trusty SSH action to forward localhost ports to those on the Solr server. zsh and bash handle string splitting differently, so be sure to choose correctly for your shell. For zsh: -
tsabat created this gist
May 15, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ combine the two scripts below. For zsh: ```bash SOLR_PORTS=(8080 9292 2812) ``` for bash: ```bash SOLR_PORTS="8080 9292 2812" ``` for both shells ```bash SOLR_SERVER=<your_server_here> function portforward() { for port in $SOLR_PORTS do echo "forwarding $port" ssh -l ubuntu $SOLR_SERVER -p 22 -N -f -C -L $port":localhost:"$port done } function portforwardend() { for port in $SOLR_PORTS do spec="\-L $port"":localhost:"$port echo "unforwarding $spec" ps aux | grep $spec | grep -v grep | awk '{print $2}' | xargs kill done } ```