remote-server

Paramiko: ssh.exec_command to collect output says open channel in response

一世执手 提交于 2019-12-05 18:48:43
I have python script with paramiko and ssh somewhat as below import paramiko # setup ssh connection this works. no problem. ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) conn = ssh.connect(MACHINEIP, username=ROOTUSER, password=ROOTUSER_PASSWORD, port=22) # This first ssh exec works perfect. (sshin1, sshout1, ssherr1) = ssh.exec_command(cmd1) # When I print the output of 2nd and 3rd ssh exec, I get output saying of channel open (sshin2, sshout2, ssherr2) = ssh.exec_command(cmd2) print sshout2 (sshin3, sshout3, ssherr3) = ssh.exec_command(cmd3) print

Connect to a remote MySQL database using Android

你离开我真会死。 提交于 2019-12-04 19:54:20
I have a MySQL database sitting in a server. I would like to know how I could connect to my remote DB and show the data into my android app. I know that is a way with WebService or direct but i don't know more then that. I have a script write in Php that sitting in the server that letting connect to the db $db = mysql_connect("localhost", "UserName", "Password") or die (mysql_error()); mysql_select_db("NameofDB",$db) or die (mysql_error()); Thanks for helping!!! Android app side: private ArrayList<String> receiveData(String file, ArrayList<NameValuePair> data) { InputStream is = null;

PyCharm remote processes finish when connection breaks

半世苍凉 提交于 2019-12-04 18:18:48
问题 I am running a project using a remote interpreter using an SSH connection (PyCharm professional 2016.3.3). When I have a connection everything works fine, but if my connection gets interrupted (either I accidentally close the laptop lid, enter sleep mode, or the wifi connection breaks momentarily for some unknown reason) then when I reconnect, my console session is terminated with Process finished with exit code -1 . The output from the interactive console reads: ssh://username@remote_server

Unable to push to remote GIT repository — “[…] does not appear to be a git repository”

懵懂的女人 提交于 2019-12-04 11:44:36
I've set up my GIT repository on my server using the following in the appropriate folder (the root of my subdomain, git.mydomain.com ): mkdir foo.git cd foo.git git init --bare --shared This would make the repository available by the URL git.mydomain.com/foo.git . On my client, trying to push the commited files to the server using the following: mkdir foo cd foo git init git remote add foo myUser@git.mydomain.com:foo.git git add readme.txt git commit -m "foo" git push foo master .. entering user password .. Only results in: fatal: 'foo.git' does not appear to be a git repository fatal: The

Can't get remote filename to file_get_contents() and then store file

雨燕双飞 提交于 2019-12-04 07:20:47
I want to download a remote file and put it in my server directory with the same name the original has. I tried to use file_get_contents($url) . Problem is that the filename isn't included in $url , it is like: www.domain.com?download=1726 . This URL give me, e.g.: myfile.exe , so I want to use file_put_contents('mydir/myfile.exe'); . How could I retrieve the filename? I tried get_headers() before downloading, but I only have file size, modification date and other information, the filename is missing. I solved it another way. I found that if there is no content-disposition in url headers, then

Powershell Script Running Slowly

别来无恙 提交于 2019-12-04 06:10:15
问题 I'm writing a script to check the version on about 15 remote servers and the script is taking much longer to execute than I would expect. $listServers = @("compName1", "compName2", "compName3", ... "compName15") "" | Out-File C:\temp\javaVersion.txt "" | Out-File C:\temp\javaVersionLog.txt $cred = Get-Credential ForEach ($server in $listServers) { Measure-Command {$javaVersion = Invoke-Command -ComputerName $server -Credential $cred -Authentication Kerberos -ScriptBlock {Get-WmiObject -Class

Failed to remotely execute R script which loads library “rhdfs”

南笙酒味 提交于 2019-12-04 05:11:01
问题 I'm working on a project using R-Hadoop, and got this problem. I'm using JSch in JAVA to ssh to remote hadoop pseudo-cluster, and here are part of Java code to create connection. /* Create a connection instance */ Connection conn = new Connection(hostname); /* Now connect */ conn.connect(); /* Authenticate */ boolean isAuthenticated = conn.authenticateWithPassword(username, password); if (isAuthenticated == false) throw new IOException("Authentication failed."); /* Create a session */ Session

Persistent use of Jupyter Notebook from remote server

我是研究僧i 提交于 2019-12-03 18:49:56
问题 I connect to a remote server using ssh -L but if I close the laptop lid or the connection is lost, the jupyter notebook is disconnected. After I reconnect to the remote server, the "last" session is lost. What can be done to make it persistent? Could screen help with it? 回答1: On the remote server, you should open your jupyter in a screen session, it will make it persistent if you lose the connection to the server and resume it. On your computer: ssh -L xxxx:localhost:yyyy server . screen .

Get service status from remote server using powershell

女生的网名这么多〃 提交于 2019-12-03 06:45:31
How to get the service status for a remote computer that needs a user name and password to log in? I am trying to find a solution using the following code: $serviceStatus = get-service -ComputerName $machineName -Name $service The default syntax for the get-service command is: Parameter Set: Default Get-Service [[-Name] <String[]> ] [-ComputerName <String[]> ] [-DependentServices] [-Exclude <String[]> ] [-Include <String[]> ] [-RequiredServices] [ <CommonParameters>] Parameter Set: DisplayName Get-Service -DisplayName <String[]> [-ComputerName <String[]> ] [-DependentServices] [-Exclude

Retrieving files from remote IPython notebook server?

ぃ、小莉子 提交于 2019-12-03 05:00:35
问题 If I don't want to give out SSH access to users of my remote IPython notebook server. Is there a way to let users browse non .ipynb files and download them? 回答1: You can use FileLink and FileLinks that are built-in: from IPython.display import FileLink, FileLinks FileLinks('.') #lists all downloadable files on server The code above generates: ./ some_python_file.py some_xml_file.xml some_ipynb_file.ipynb The three items above are links that you can click to download. Click here for an example