I would like to execute remote Bash script using Python script on local computer. Bash script on remote computer # script.sh     #!/bin/bash  echo &quot;... Options ...&quot; echo &quot;  1) Option 1&quot; echo &quot;  2) Option 2&quot;  read -p &quot;Enter [1/2] : &quot; n  case $n in   1) echo &quot;Option 1 selected&quot;;;   2) echo &quot;Option 2 selected&quot;;;   *) echo &quot;Invalid option&quot;;; esac  Python script on local computer # script.py import sys from paramiko import SSHClient  hostname = '10.0.0.1' username = 'u' password = 'p'  client = SSHClient() client.load_system_host_keys() client.connect(hostname, username=username, password=password)  stdin, stdout, stderr = client.exec_command('./script.sh')  for line in stdout:     sys.stdout.write(line)  I've no issue executing script.sh on remote computer. remote@computer:~$ ./script.sh  ... Options ...   1) Option 1   2) Option 2 Enter [1/2] : 1 Option 1 selected remote@computer:~$   The problem is when I try with Python script on local computer, the script seems to be hang. I don't even see Enter [1/2] :  line been executed. local@computer:~$ python script.py  ... Options ...   1) Option 1   2) Option 2  What's wrong in this code? Desired Output local@computer:~$ python script.py  ... Options ...   1) Option 1   2) Option 2 Enter [1/2] : 1 Option 1 selected local@computer:~$
I'm trying to run an interactive command through paramiko.  The cmd execution tries to prompt for a password but I do not know how to supply the password through paramiko's exec_command and the execution hangs.  Is there a way to send values to the terminal if a cmd execution expects input interactively?  ssh = paramiko.SSHClient() ssh.connect(server, username=username, password=password) ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command("psql -U factory -d factory -f /tmp/data.sql")   Does anyone know how this can addressed? Thank you.
What are the eigenvalues of $\operatorname{ad}x$? Let $x\in \operatorname{gl}(n,F)$ have $n$ distinct eigenvalues $a_1,\ldots,a_n$ in $F$. Prove that the eigenvalues of $\text{ad }x$ are precisely the $n^2$ scalars $a_i-a_j$ ($1\leq i,j\leq n$), which of course need not be distinct.   So we can represent $x$ by an $n\times n$ matrix $X$. We have $Xv_1=a_1v_1,\ldots, Xv_n=a_nv_n$ for eigenvectors $v_1,\ldots,v_n$.   Now, $\operatorname{ad}x$ takes $y\in \operatorname{gl}(n,F)$ to $xy-yx$. I need to show that some $y$ is taken to a scalar multiple of itself, where that scalar is $a_i-a_j$. What could be that $y$? I want to change my thesis topic (to the extent that the ethos is still in tact) but my advisor does not agree. What can I do? I am doing a phd where my aim is to solve a problem A which is very interesting. My supervisor has got a lot of connections in a technology B and he claims to be an expert in B. I came to this group because of these accomplishments. But soon I realized that B is not really a great technology for A.   So in my phd proposal I proposed a method which encompasses B but is more general (say R). Now I realize that I do not want to use B at all because my preliminary results are not encouraging. In fact, I am inclined to use E as a base technique which does not have any impact on R.  But my supervisor, who is interested in only publishing in B  and frowns upon everything else (it was a nightmare to convince him to let me work on R) is dead against it. He says that he is an expert in B and his vision of the group is not inclined with me trying other things.  There are other professors in my university who have worked in E and could collaborate but my supervisor won't collaborate with people from outside his kingdom. I also know professors from outside my university who could help me if needed. I could knock the doors of school committee in order to  help me but that would create a lot of problems as my supervisor wields a lot of power and influence everywhere.    Another query is, is it ethical to collaborate with people outside the university (of course after letting my supervisor know) for my PhD work. My Masters supervisor would be happy to help me out.  Edit: After looking at comments, I am thinking that after all, it is MY PhD. Yes, I have spent 1.5 years, but 1.5 years is left. Why should I spend any moment of my life on something I find to be not exciting, particularly less exciting because it is forced on me. And in those 1.5 years I learnt to write well and also learnt 'A' which is important. Its not total waste. My supervisor has his agenda, and why should I give up mine to make him happy? His vision is fine, but he does not have the right to force his vision on me. Schwarz's Lemma and functions with positive real part Problem:     Let $D = \{ z \in \mathbb C : |z| &lt; 1 \}$. Suppose $f : D \to \mathbb C$ is a non-constant analytic function such that $\mathrm{Re} f(z) \geq 0$ for all $z \in D$.      (a) Show that $\mathrm{Re} f(z) \neq 0$ for all $z \in D$.      (b) Using a Möbius transformation and Schwarz's lemma, prove that if   $f(0) = 1$, then $$ |f(z)| \leq {1+|z| \over 1-|z|}. $$   What can be said if $f(0) \neq 1$?      (c) Show that if $f(0) = 1$, then $f$ also satisfies $$ |f(z)| \geq {1-|z| \over 1+|z|}. $$   Progress:  (a) We can use the open mapping theorem.  (b) We can compose a Möbius transformation $m$ that sends the right-half plane to $D$ with $f$. Then $h = m \circ f$ satisfies the hypotheses of Schwarz's lemma by construction. Simple manipulations of the inequality from Schwarz's lemma give the result.  (c) Looking at part (a), we know that $\mathrm{Re} f(z) \neq 0$, and so $f(z) \neq 0$. Thus, we can use the function $g = 1/f$ in the statement of part (b).  Question:  What about when $f(0) \neq 1$? I don't think you can get anything from $f(z)-f(0)+1$ unless $\mathrm{Re} f(0) &lt; 1$. And you can't in general rearrange the inputs of $f$ because $1$ isn't necessarily in the image of $f$. Also, I don't think you can get anything from $f(z)/f(0)$ unless $f(0)$ is real, because otherwise the range of $f(z)/f(0)$ could extend into the left-half plane. Do community and moderator deletes penalize in the same way that self-deletes do? The symmetric cryptosystem one-time pad (OTP) seems to be very beautiful since it is perfectly secret according to Shannon. Many books, however, point out the main drawback: one must create a secret key the same length as the plaintext. For this reason, the concept of perfect secrecy has these days been abandoned, and we prefer other cryptosystems.   Now, for example, suppose I want to encode my text message with the ASCII scheme, and moreover suppose that this plaintext is 10 gigabytes long, therefore (using an OTP) the key must be the same length, 10 gigabytes. I think, however, this is a ''sustainable price'' because I'm sure that the ciphertext can't be attacked.  Practically, I don't understand why having such long keys with an OTP is a big disadvantage if we reach "the dream"-- namely, perfect secrecy. Nowadays the storage of information is very easy, so what is the real problem? I can, for example, share the "long key" in person. This problem is from Romanian G.M. and although it is very short, it is also (I think) very hard. Let $x, y, z$ real non-negative numbers such that $x+y+z=3$. Prove that   $$27 \leq (x^2+2)(y^2+2)(z^2+2) \leq 44 $$  I didn't succeed in any of the inequalities, I only managed to find the equality cases ($x=y=z=1$ for the first one and one of them $3$ and the others $0$). Any hint/idea/solution is welcome. My office is a converted garage about 30 feet from my house.   I have a coaxial cable already running from my house to the office.   I want to attach a Ethernet cable from my DSL modem, in my office, to a computer in my house.   Since I already have the coaxial cable installed, I bought two coax to Ethernet converters (NVA-P-860-BP78 Video Balun), but when I hooked them up I am getting no signal. It was my understanding that an Ethernet signal could travel over a coaxial cable.   Is that wrong? Any ideas why this isn't working? Comparing two byte arrays in .NET Where can I find a list of Magic Items by rarity? I am currently looking for a list of Magic Items (non-homebrew and preferably Armor/Weapons) arranged in Common, Uncommon, Rare, Very Rare, and Legendary. There is not one in the Players Handbook or Dungeon Masters Guide that is appropriate.  Does such a list exist and if so, where can I find it? First chapter appearing before first line in table of contents reduce Screen brightness in battery mode automatically KDE and XFCE4 has a program to adjust the screen brightness automatically in battery mode to a preset value. How can i set the same with Unity ( or Gnome3 )? Finding the closure of some subsets of the ordered square I need to find the closure of these sets on the ordered square: $$A = \{(1/n)\times 0 | n\in \mathbb{Z}_+\}$$ $$B = \{(1-1/n)\times \frac{1}{2}| n\in \mathbb{Z}_+\}$$ $$C = \{x\times 0 | 0&lt;x&lt;1\}$$ $$D = \{x\times \frac{1}{2}| 0&lt;x&lt;1\}$$ $$E = \{\frac{1}{2}\times y | 0&lt;y&lt;1\}$$ I know that the closure is just the set itself united with its limit points. For $A$, the set of limit points, I imagine, are $\{&lt;1,0&gt;\}$, that is, the $x$ coordinate is $1$ and the $y$ is $0$. But  is says the reverse. What am I getting wrong? Following the same reasoning, $B' = \{&lt;1,\frac{1}{2}&gt;\}$ $C' = \{&lt;0,0&gt;,&lt;0,1&gt;\}$ What am I doing wrong? NewForm.aspx disappeared `du -b` shows different size than `ls` How do I download with youtube-dl to get video title as filename? How many days a year is a U.S. citizen allowed to stay in Morocco? I arrived in Morocco in October of 2014 and renewed my visa by traveling to Spain by ship for a day and getting my passport stamped again in January of 2015. My question is, am I allowed to leave the country and repeat this process this year by traveling again to another country, other than my own in order to return to Morocco for another 90 days? And if so, how many times a year is this allowed? I have read 180 days on some websites but there is not any clear answers anywhere about this that I can find. How to Install Ubuntu on separate hard drive in a dual boot? I have already installed Windows 7 on C: drive. Now I want to install Ubuntu on E: drive which is a free partition. How do I proceed? Hiding some slides in student handouts in Beamer I am preparing lecture slides for a class. I would like to hide some of the slides from the students. As an example, I would like to be able to compile students.pdf which has only student slides 1 and 2 (i.e., "teacher slide" is hidden); but teacher.pdf which has all three slides.  \documentclass{beamer}  \begin{document}  \begin{frame}{Student slide 1} blah blah blah \end{frame}  \begin{frame}{Teacher slide} secret stuff not to be shared with students \end{frame}  \begin{frame}{Student slide 2} blah blah blah \end{frame}  \end{document}   How would I do this in beamer? In a regular document, e.g., article, I would use the comment environment.  I feel that the approach in  is overkill for my needs. why Booleans slow my computer more than expected Why does $PSL(2,\mathbb C)\cong PGL(2,\mathbb C)$ but $PSL(2,\mathbb R) \not\cong PGL(2,\mathbb R)$? Why does $PSL(2,\mathbb C)\cong PGL(2,\mathbb C)$ but $PSL(2,\mathbb R) \not\cong PGL(2,\mathbb R)$?