-
-
Save EMFS/a371404c2f5d6790eee70f6de538a2a0 to your computer and use it in GitHub Desktop.
Revisions
-
EMFS revised this gist
Mar 19, 2019 . 1 changed file with 1 addition 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 @@ -57,7 +57,7 @@ Edita o arquivo de configuração criado: nano ~/.jupyter/jupyter_notebook_config.py ``` Adicione no arquivo acima de configuração, com o editor nano (ou outro de sua preferência) as seguintes linhas, para habilitar acesso remoto: ``` c.NotebookApp.ip = '*' c.NotebookApp.token = '' -
EMFS revised this gist
Mar 18, 2019 . 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 @@ -80,6 +80,8 @@ http://IP_instância:8080 Substituir, acima, o "IP_instância" pelo número IP anotado anteriormente, como, por exemplo: 35.235.115.21 ficaria http://35.235.115.21:8080 Ao acessar o endereço acima, você estará se conectando ao servidor Jupyter que solicitará uma senha, aquela mesmo que você definiu em passo anterior na configuração de seu Jupyter (~/.jupyter/jupyter_notebook_config.py). E voilá! :wq! -
EMFS revised this gist
Mar 15, 2019 . 1 changed file with 0 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 @@ -61,7 +61,6 @@ Adicione no editor nano (ou outro de sua preferência) as seguintes linhas, para ``` c.NotebookApp.ip = '*' c.NotebookApp.token = '' c.NotebookApp.open_browser = False c.NotebookApp.port = 8080 c.NotebookApp.allow_remote_access = True -
EMFS revised this gist
Mar 15, 2019 . 1 changed file with 3 additions and 3 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,8 +1,8 @@ # Acesso ao GCP e servidor Jupyter pela rede ISC Solução para contornar o problema de tunelamento usando ssh para acessar o Jupyter notebook que é bloqueado pelo firewall da rede wifi do ISC, onde ocorrem os encontros presenciais do grupo de estudo em Deep Learning de Brasília. A ideia é tornar o servidor jupyter executando no Google Cloud Platform (GCP) acessível para rede externa, diretamente por seu IP, sem a necessidade de tunelamento via ssh. ## Alterando as configurações da instância na console GCP https://console.cloud.google.com/networking/addresses/ -
EMFS revised this gist
Mar 15, 2019 . 2 changed files with 86 additions and 86 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 @@ -0,0 +1,86 @@ # Acesso ao Google Cloud (GCP) e servidor Jupyter pela rede ISC Para contornar o problema de tunelamento usando ssh para acessar o Jupyter notebook que é bloqueado pelo firewall da rede wifi do ISC, onde ocorrem os encontros presenciais do grupo de estudo em Deep Learning de Brasília. A ideia é tornar o servidor jupyter executando no GCP acessível para rede externa, diretamente por seu IP, sem a necessidade de tunelamento via ssh. ## Alterando as configurações da instância na console GCP https://console.cloud.google.com/networking/addresses/ Logado na console GCP, acessar o endereço acima e reservar um endereço IP estático: "Reserve Static Address". Anotar esse endereço "IP_instância" que será algo no formato: 35.235.115.21 https://console.cloud.google.com/networking/firewalls/ Criar nova regra para o firewall da sua instância, nos seguintes moldes:  ## Abrindo o Google Cloud Shell https://console.cloud.google.com/compute/instances Inicie a instância e abra o shell:  ## Mudando permissões na pasta do usuario jupyter Execute os comandos abaixo para permitir que o usuario do shell possa modificar o conteudo dos notebooks ``` sudo chmod -R 777 /home/jupyter/ ``` ## Configurando Jupyter Vamos configurar o Jupyter para usarmos senha para acessar, ao invés de token e também para permitir acesso remoto. O passo de definição de senha não é obrigatório, mas daí será preciso usar o token criado na inicialização do Jupyter. Creio que seja mais prático acessá-lo usando senha. Criando o arquivo de configuração do Jupyter, execute os comandos abaixo. Cria arquivo de configuração: ``` jupyter notebook --generate-config ``` Define sua própria senha de acesso: ``` jupyter notebook password ``` Edita o arquivo de configuração criado: ``` nano ~/.jupyter/jupyter_notebook_config.py ``` Adicione no editor nano (ou outro de sua preferência) as seguintes linhas, para habilitar acesso remoto: ``` c.NotebookApp.ip = '*' c.NotebookApp.token = '' c.NotebookApp.password = 'hash_do_password' c.NotebookApp.open_browser = False c.NotebookApp.port = 8080 c.NotebookApp.allow_remote_access = True ``` Finalmente, lança a execução do servidor jupyter na pasta em que tem acesso aos cadernos da fastai ``` jupyter notebook /home/jupyter & ``` ## Acessando Jupyter pelo IP fixo Acesse o servidor jupyter pelo IP fixo de sua instância, no seu navegador local: http://IP_instância:8080 Substituir, acima, o "IP_instância" pelo número IP anotado anteriormente, como, por exemplo: 35.235.115.21 ficaria http://35.235.115.21:8080 Insira a senha que você definiu em passo anterior na configuração de seu Jupyter e voilá! :wq! 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,86 +0,0 @@ -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 8 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 @@ -11,6 +11,14 @@ Inicie a instância e abra o shell:  ## Mudando permissões na pasta do usuario jupyter Execute os comandos abaixo para permitir que o usuario do shell possa modificar o conteudo dos notebooks ``` sudo chmod -R 777 /home/jupyter/ ``` ## Instalação do [ngrok](https://ngrok.com/) no shell Download -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 0 additions and 10 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 @@ -11,16 +11,6 @@ Inicie a instância e abra o shell:  ## Instalação do [ngrok](https://ngrok.com/) no shell Download -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 1 addition 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 @@ -13,7 +13,7 @@ Inicie a instância e abra o shell: ## Mudando usuario para jupyter Execute os comandos abaixo para mudarmos o usuário em que o fastai está instalado e configurado ``` sudo su -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 10 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 @@ -11,6 +11,16 @@ Inicie a instância e abra o shell:  ## Mudando usuario para jupyter Execute os comandos abaixo para mudarmos para o usuário em que o fastai está instalado e configurado ``` sudo su su jupyter cd ~ ``` ## Instalação do [ngrok](https://ngrok.com/) no shell Download -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 2 additions and 2 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 @@ -69,9 +69,9 @@ cd ~ ## Acessando Jupyter via ngrok Acesse o link gerado pelo ngrok, http ou https  Coloque a senha definida para seu Jupyter e voilá! -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 1 addition 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 @@ -11,7 +11,7 @@ Inicie a instância e abra o shell:  ## Instalação do [ngrok](https://ngrok.com/) no shell Download -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 1 addition 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,6 +1,6 @@ # Instalando ngrok no Google Cloud Shell Para contornar o problema de tunelamento usando ssh para acessar o Jupyter notebook. A ideia é usar o ngrok para acessar o jupyter sem a necessidade de tunelamento via ssh. ## Abrindo o Google Cloud Shell -
tcvieira revised this gist
Mar 14, 2019 . 1 changed file with 2 additions and 2 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 @@ -9,7 +9,7 @@ https://console.cloud.google.com/compute/instances Inicie a instância e abra o shell:  ## Instalação do ngrok no shell @@ -71,7 +71,7 @@ cd ~ Acesse o link gerado pelo ngrok  Coloque a senha definida para seu Jupyter e voilá! -
tcvieira created this gist
Mar 14, 2019 .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,78 @@ # Instalando ngrok no Google Cloud Shell Para contornar o problema de tunelamento usando ssh para acessar o Jupyter notebook no localhost. A ideia é usar o ngrok para acessar o jupyter sem a necessidade de tunelamento via ssh. ## Abrindo o Google Cloud Shell https://console.cloud.google.com/compute/instances Inicie a instância e abra o shell:  ## Instalação do ngrok no shell Download ``` wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ``` Unzip ``` unzip ngrok-stable-linux-amd64.zip ``` Aqui teremos o binario do ngrok na home ## Configurando Jupyter Vamos configurar o Jupyter para usarmos senha para acessar, ao invés de token e também para permitir acesso remoto. O passo de definição de senha não é obrigatório, mas daí será preciso usar o token criado na inicialização do Jupyter. Creio que seja mais prático acessá-lo usando senha. Criando o arquivo de configuração do Jupyter, execute os comandos abaixo. Cria arquivo de configuração: ``` jupyter notebook --generate-config ``` Define senha de acesso: ``` jupyter notebook password ``` Habilita acesso remoto: ``` echo "c.NotebookApp.allow_remote_access = True" >> ~/.jupyter/jupyter_notebook_config.py ``` ## Executando o Jupyter Neste passo, podemos abrir um novo shell do gcp para deixar executando o jupyter e outro para o ngrok, porém vou usar somente um para isso. ``` jupyter notebook /home/jupyter & ``` o "`&`" serve para colocar o jupyter para rodar em background. ## Executando o ngrok ``` cd ~ ./ngrok http 8888 ``` ## Acessando Jupyter via ngrok Acesse o link gerado pelo ngrok  Coloque a senha definida para seu Jupyter e voilá! :wq!