Posts

Showing posts with the label ssh

How to open a link on browser using ubuntu connected via sssh

How to open a link on browser using ubuntu connected via sssh I have an application which has to open a link on a browser in order to collect information from it [disclaimer: I don't want to use any headless browser]. When I run it on my local machine, everything works good; It opens the link on my default browser and does the work. now, I have deployed the application on my remote ubuntu machine (which I connect to via putty) but the xdg-open command won't work there. It has its problems like not having GUI server or echo $DISPLAY gives nothing (even tried the DISPLAY=:0 method). I want to be able to launch a browser at the end of the day and do my work. Then I was thinking it it is possible to open a browser on my local system via a command in my script on the server? What operating system are you running on the local system? Are you running an X server on the local system? Are you running putty with the option to forward X? – K...

How to dynamically update parameters of an existing Airflow (1.9 version)Connection within code?

How to dynamically update parameters of an existing Airflow (1.9 version)Connection within code? I have defined a SSH connection via Airflow Admin UI. However I am only defining a service account , host and port in the UI. I am retrieving the password in the first task instance and I need to update the SSH connection with the password in the second task instance and use it in the third task instance. Currently t1 and t2 work as expected ,however t3 fails since the password is not getting updated and it is looking for .ssh key file based authentication. Can someone please suggest how this can be implemented ? .ssh Here is my code snippet : from airflow import models from airflow.contrib.operators.ssh_operator import SSHOperator from airflow.operators.python_operator import PythonOperator from airflow.operators.bash_operator import BashOperator from datetime import datetime, timedelta from airflow.contrib.hooks.ssh_hook import SSHHook from airflow.models impo...