I'm new to bash scripting. I want to call a function from my script which will ssh into a remote computer (on my LAN) and run a command.  So far I have:   function run_ssh_command {     target_ip=$1     username=$2     password=$3     cmd=$4      ssh -l ${username} ${target_ip} ${password} }   I invoke the function from the terminal as follows:  (Note: I give script_name, username and password "real" values when executing the function on my machine. 'ifconfig' is the command I want to run on the remote machine.)  source script_name.sh; run_ssh_command 192.168.X.Y username password ifconfig   Result: Running the above command will get me to the password prompt part of the login process (e.g. same as ssh username@192.168.X.Y)   Question: I want to handle the password entry automatically using the script. What is the "best" way to go about this, in general?
I tried writing a shell script which can do automatic login into a ssh server using password which is mentioned in the script. I have written the following code:  set timeout 30 /usr/bin/ssh -p 8484 root@172.31.72.103 expect  {    "root@172.31.72.103's password"     {       send "password\r"     } }   This code is not running properly, still it is asking for the password. Can somebody please help me in solving this
Reference for general-topology Can I paste plain text by default? I regularly copy and paste text between spreadsheets, emails, browser windows, etc. I can't think of a single time when I've wanted to keep the formatting from the source text.  I already know about the following workarounds:   Use “Edit” → “Paste Special” → “Unformatted text” Paste to Notepad and copy from there Install a program that takes over the clipboard   What I want is to tell Windows to just do this by default.  Is this possible? Let $z \in\Bbb{C}^{\times}$ such that $|z^3+\frac{1}{z^3}|\leq 2$. Prove that $|z+\frac{1}{z}|\leq 2$. Problem :  Let $z \in\Bbb{C}^{\times}$ such that $|z^3+\frac{1}{z^3}|\leq 2$. Prove that $|z+\frac{1}{z}|\leq 2$.  My approach : Since : $(a^3+b^3)=(a+b)^3-3ab(a+b)$ $\Rightarrow z^3+\frac{1}{z^3}=(z+\frac{1}{z})^3-3(z+\frac{1}{z})$ Now I don't know further about this problem whether or not this will help here. Please guide to solve this problem will be of great help, thanks. Question:  Show that $n^2 + 3n + 5$ is not divisible by $121$, where $n$ is an integer. Can someone give me an example of a function $f: I\to \mathbb R$ which is uniform continuous but not Hölder continuous (for any $\alpha$)? Here $I$ is an interval. If $I$ is closed and bounded then we are essentially assuming that $f$ is merely continuous.   By saying that $f$ is not Hölder continuous for any $\alpha$, I mean for all $\alpha &gt;0$,   $$\sup_{x,y\in I, x\neq y} \frac{|f(x) - f(y)|}{|x-y|^\alpha} = \infty.$$  That is, I need to find a function $f$ so that for all $\alpha$ and $M&gt;0$, there are $x, y\in I$ so that   $$ \frac{|f(x) - f(y)|}{|x-y|^\alpha} \ge M.$$  I know that $f(x) = x^\alpha$ are $\alpha$-Hölder continuous. Thus, in some sense, I am looking for $f$ which are worst than the functions $x^\alpha$ for all $\alpha &gt;0$. If a car hits a wall at a speed of $v$, and an identical car hits a wall at a speed of $2\,v$, with the kinetic energy equation $E_K = \frac{1}{2}mv^2$ (the speed goes from $v$ to $0$) the second car will lose 4 times the energy, and therefore cause 4 times the damage, but with the force equation $F = ma$ (the car hits the wall and decelerates), it will hit with 2 times the force, and cause 2 times the damage.  How can this be explained? How can I make a hexagonal grill? How can I break on an unhandled exception in ASP.NET? When debugging an application in Visual Studio, there are 2 options for breaking on exceptions. Break as soon as an exception is thrown, and breaking only when an exception isn't caught. This works fine when developing desktop applications. However, when developing ASP.NET applications, all exceptions are eventually caught by the code in IIS.  Is it possible to disable this behavior, so that the debugger breaks when my ASP.Net application code fails to catch an exception?  Edit: Just to be clear, I don't want to break whenever an exception is thrown, as many times they are handled just fine by my code, and I don't want to stop on every exception. I only want to stop on the exceptions that aren't handled by my code.  Edit: This seems to not be an issue in Visual Studio 2008. In Visual Studio 2003, all exceptions were treated as user handled, because the ASP.NET runtime caught all the exceptions so as not to bring down the web server process. It seems that in Visual Studio 2008, this type of exception catching is not counted when checking for user-unhandled exceptions. I am looking to prove the following statement false:  Let $k$ be a positive integer, then $k\mid n$ if and only if $k\mid n^2$.  So I am trying to find a $k$ where this does not hold but after aimlessly trying numbers I was curious if there is a methodical way to find $k$. Is there a number whose absolute value is negative? Ignore Pulses Less than a Given Width in a Pulse Train Let's say I have a 5V pulse train that varies between 0 and 75000 pulses per second. Pulse width, let's say, is 5 microseconds. How could I calculate or determine the best way to filter out all pulses less than 4 microseconds in width? In (non-relativistic) classical physics, if the temperature of an object is proportional to the average kinetic energy ${1 \over 2} m\overline {v^{2}}$of its particles (or molecules), then shouldn't that temperature depend on the frame of reference - since $\overline {v^{2}}$ will be different in different frames?  (I.e. In the lab frame  $K_l = {1 \over 2} m\overline {v^{2}} $, but in a frame moving with velocity $u$ relative to the lab frame, $K_u =  {1 \over 2} m \overline {(v+u)^{2}}$). Find the ratio of $\frac{\int_{0}^{1} \left(1-x^{50}\right)^{100} dx}{\int_{0}^{1} \left(1-x^{50}\right)^{101} dx}$ $$I_1=\int_{0}^{1} \left(1-x^{50}\right)^{100} dx$$ and $$I_2=\int_{0}^{1} \left(1-x^{50}\right)^{101} dx$$ Then find $\frac{I_1}{I_2}$  I tried by subtracting $I_1$ and $I_2$   $$I_1-I_2=\int_{0}^{1}\left(1-x^{50}\right)^{100}\left(1-(1-x^{50}\right))dx$$ so  $$I_1-I_2=\int_{0}^{1} \left(1-x^{50}\right)^{100} x^{50} dx$$ Now using Integration by Parts we get  $$I_1-I_2= \left(1-x^{50}\right)^{100} \times \frac{x^{51}}{51}\bigg|_{0}^{1} -\int_{0}^{1} 100 \left(1-x^{50}\right)^{99} \times -50 x^{49} \times \frac{x^{51}}{51} dx$$  So $$I_1-I_2=\frac{5050}{51} \times \int_{0}^{1}\left(1-x^{50}\right)^{99} x^{100} dx$$  Now $x^{100}=\left(1-x^{50}\right)^2-(1-x^{50}-x^{50})$ so  $$\frac{51}{5050}(I_1-I_2)=\int_{0}^{1} \left(1-x^{50}\right)^{99} \times \left(\left(1-x^{50}\right)^2-(1-x^{50})+x^{50}\right)dx=I_2-I_1+\int_{0}^{1} \left(1-x^{50}\right)^{99} x^{50} dx$$  Need a hint to proceed further. How do I change the default file manager back to Nautilus? Is it possible to group several objects and then manipulate them (scale, rotate, translate) as one? Windows 10 - disable reopening programs after restart/startup Occasionally, a forced restart is happening on my Windows 10 computer. When the OS is restarted every program that I've had prior to the restart is reopened at startup. The programs are reopened like I would just double-click them.  I usually hold 5-6 windows of Visual Studio and few more programs all together. When the above happens, I have to wait several minutes until I can start working, as everything takes ages to load.  Is there a setting to disable these programs from automatically opening at startup? Eclipse Optimize Imports to Include Static Imports Is there anyway to get Eclipse to automatically look for static imports? For example, now that I've finally upgraded to Junit 4, I'd like to be able to write:  assertEquals(expectedValue, actualValue);   hit Ctrl + Shift + O and have Eclipse add:  import static org.junit.Assert.assertEquals;   Maybe I'm asking too much. Double booked - User bookmarking question recorded twice Edit answer draft is broken The Edit Answer Draft button is broken.    Press Back with text in an answer box. The Edit answer draft bar does not appear.     Seems like an onBackPressed() issue.  Also:   Press ← with text in the answer box The bar appears. Click the bar The answer box is blank.   Seems like the answer isn't properly carried between the Fragments.  Either way, you lost everything you wrote.  Can somebody test this? And especially without a confirm dialog, it is a brush of the finger to lose a long post of code or something.   I hope this report will help because I like the app (I'd say 4/5 stars) but the bugs are preventing a solid 5 stars.   Stack Exchange 1.0.73 Samsung Galaxy S II Skyrocket I727 Android 4.1.2 Evaluate: $$\int_{-\pi/4}^{\pi/4}(\cos(t)+\sqrt{1+t^2}\cos(t)^3\sin(t)^3)dt$$  I have tried substituting $t=\tan(\theta)$ and breaking up the $\cos(t)^3$ using $\cos(t)^2=1-\sin(t)^2$, but I can't figure it out.  This question is #21 from the Math subject GRE form GR1268.