I want to use rsync to copy all files from subfolders with a specific file ending, keeping the folder structure at the destination. Given a folder structure, for example foo  | bar     | file1.txt     | file2.gz     | file3.py  | baz     | file4.txt  I then want to copy all files with the endings *.txt and *.py which would give me at the destination foo  | bar     | file1.txt     | file3.py  | baz     | file4.txt  I have tried using find as input to the rsync command, but this doesn't retain the folder structure. Is there some input to rsync that can do this?
I am trying to create a directory that will house all and only my PDFs compiled from LaTeX. I like keeping each project in a separate folder, all housed in a big folder called LaTeX. So I tried running:  rsync -avn *.pdf ~/LaTeX/ ~/Output/   which should find all the pdfs in ~/LaTeX/ and transfer them to the output folder. This doesn't work. It tells me it's found no matches for "*.pdf". If I leave out this filter, the command lists all the files in all the project folders under LaTeX. So it's a problem with the *.pdf filter. I tried replacing ~/ with the full path to my home directory, but that didn't have an effect.  I'm, using zsh. I tried doing the same thing in bash and even with the filter that listed every single file in every subdirectory... What's going on here?  Why isn't rsync understanding my pdf only filter?    OK. So update: No I'm trying  rsync -avn --include="*/" --include="*.pdf" LaTeX/ Output/   And this gives me the whole file list. I guess because everything matches the first pattern...
I wonder  whether there is a function $f\colon\Bbb R\to\Bbb R$ with the folowing characteristic?   for every two real numbers $\alpha,\beta,\alpha\lt\beta$,  $$\{f(x):x\in(\alpha,\beta)\}=\Bbb R$$   I can't  say such a function does not exist, neither can I construct a example  Thanks a lot! Stack Exchange API too many requests from this IP address I am using the Stack Exchange API to get Stack&nbsp;Overflow data, but I am getting "too many request from this ip" after making only five requests. I got JSON content like this:  {u'error_id': 502, u'error_message': u'too many requests from this IP, more requests available in 68492 seconds', u'error_name': u'throttle_violation'}   I made the following requests to Stack&nbsp;Exchange without an access token:   "" ---> 2 times called this API "" --> 3 times called this API and on the 4th call I got an exception LaTeX errors in Formatting I want to print this text :  make -j 5 KDEB_PKGVERSION=1.yourcustomname deb-pkg  But I feel because of the underscore , LaTeX generates an error missing $ inserted and it doesn't print it as well.  Secondly, In the \fbox{} , I wanted to print the two texts on the next line(i.e) one text per line , so I used \ and even \par but it doesn't seem to work and I would like to align the (or) as well.   \fbox{\texttt{uname -a}\\(or) \texttt{cat /proc/version}}   Here is my full source code:  \documentclass[12pt]{article} \author{Subham Soni S.} \date{\today} \title{Compiling and Installing a Kernel 3.13.3 On Ubuntu, Debian and its Derivatives} \begin{document} \maketitle To replace the existing \textsl{kernel} with a new one, do the following: \begin{enumerate} \item Create a folder named \emph{kernel} in the home directory. \item Download the latest kernel to the folder from  \texttt{www.kernel.org}. \item Extract the file. \item In the terminal, type the following command to \textbf{install the neccesary tools to compile the kernel}:   \begin{center}     \fbox{\texttt{sudo apt-get install gcc libncurses5-dev dpkg-dev}}   \end{center} \item Enter the directory of the extracted kernel source   \begin{center}     \fbox{\texttt{cd kernel} \par \texttt{cd linux-3.13.3}}   \end{center} \item Configure the kernel   \begin{center}     \fbox{\texttt{make menuconfig}}   \end{center}   In this menu you can customize your kernel \item Save and exit \item Compile the kernel   \begin{center}     \fbox{\texttt{make -j 5 KDEB_PKGVERSION=1.yourcustomname deb-pkg}}   \end{center}   \emph{This process might take a while...} \item Install the kernel   \begin{center}     \fbox{\texttt{sudo dpkg -i ../linux*.deb}}   \end{center} \item Reboot   \begin{center}     \fbox{\texttt{sudo reboot}}   \end{center} \item Run the following commands to check the kernel version   \begin{center}     \fbox{\texttt{uname -a}\\(or) \texttt{cat /proc/version}}   \end{center} \item You can easily uninstall the kernel with the command:   \begin{center}     \fbox{\texttt{sudo apt-get purge linux-image-3.13.3 linux-image-3.13.3-dbg}}   \end{center} \end{enumerate} \end{document} I was wanting to initialize some strings at the top of my script with variables that have no yet been set, such as:  str1='I went to ${PLACE} and saw ${EVENT}' str2='If you do ${ACTION} you will ${RESULT}'   and then later on PLACE, EVENT, ACTION, and RESULT will be set. I want to then be able to print my strings out with the variables expanded. Is my only option eval? This seems to work:  eval "echo ${str1}"   is this standard? is there a better way to do this? It would be nice to not run eval considering the variables could be anything. In the following setup, does method B run in a (new) transaction?  An EJB, having two methods, method A and method B  public class MyEJB implements SessionBean     public void methodA() {        doImportantStuff();        methodB();        doMoreImportantStuff();     }      public void methodB() {        doDatabaseThing();     } }   The EJB is container managed, with methodB in requires_new transaction, and method A in required transaction. thus:  &lt;container-transaction id="MethodTransaction_1178709616940"&gt;   &lt;method id="MethodElement_1178709616955"&gt;     &lt;ejb-name&gt;MyName&lt;/ejb-name&gt;     &lt;method-name&gt;*&lt;/method-name&gt;   &lt;trans-attribute&gt;Required&lt;/trans-attribute&gt;   &lt;/method&gt;   &lt;method id="MethodElement_1178709616971"&gt;     &lt;ejb-name&gt;MyName&lt;/ejb-name&gt;     &lt;method-name&gt;methodB&lt;/method-name&gt;   &lt;/method&gt;   &lt;trans-attribute&gt;RequiresNew&lt;/trans-attribute&gt; &lt;/container-transaction&gt;   Now let another EJB call methodA with an EJB method call. methodA now runs in an transaction. Will the subsequent call to methodB from methodA run in the same transaction, or does it run in a new transaction? (mind, it's the actual code here. There is no explicit ejb-call to method B) Precise back-reference target with hyperref and backref A skydiver jumps out of a plane from a height of $2200$m. The skydiver's height, $h$ meters above the ground, can be modeled by the function $$s = 2200 - 4.9t^2$$ How fast is the skydiver falling at $t = 4$s?  If the skydiver is approaching a height of $2200$m, I reasoned that I could use the following definition to find the solution $${f(x+h)-f(x)\over h}$$ I entered the function into this definition and got stuck when I got to this$$f'(x) = \lim_{x\to 0} {2200-4.9t^2-9.8th-4.9h^2\over h}$$ Where can I go from here? Can I continue with this method or did I make a mistake a few steps back? New Solution  How does this look? Will my software work on the next version of Windows Why does "ls -all" show time for some files but only year for others? If you issue ls -all command some files or directories have the year and some have the time? Why do some show the year while others show the time? Is the time representative of the time the file was created? A problem about wave equation How to configure splash screen after plymouth I have configured my splash screen for plymouth - and it works perfectly. I've also configured the display manager (I'm using gdm). In between these two I get a very brief splash screen - a kind of swirl of multi-coloured ubuntu like colours. Where does this splash screen get set, and how do I change it?  Edit: Here is a video of my boot sequence, showing the screen in question: Verify proof that sequence converges Below is experimental data for the ratio $$R=\frac{\sigma(e^+e^-\rightarrow hadrons)}{\sigma(e^+e^-\rightarrow\mu^+\mu^-)}$$ as a function of the centre of mass energy $\sqrt s$. I am interested in the peak at around $100GeV$ which corresponds to the resonance of the $Z^0$ boson. There are two ways of looking at this that I have in mind:  We can effectively ignore the electromagnetic process around this energy, and so each process should have it's own Breit-Wigner peak centred on the mass energy of the $Z^0$. The ratio of these is just a constant. Thinking in terms of Feynman rules and again ignoring the electromagnetic process around this region, each process has the same propagator and vertex factors (roughly - ignore quark mixing) and there are some extra factors due to different quarks being possible and colour degeneracy, but still the ratio should be a constant (one possible issue here is interference between Feynman diagrams which I have neglected?).  So my question is why does the peak exist in the data? How fast would someone have to run to run over water? I was thinking about Flash, the superhero, or the little boy in the Incredibles.   There is  that doesn't answer a lot. Especially, I don't think surface tension would help a lot for a human to run over water, I think one would have to build on the inertial effect of the water.  There is one empirical approach based on figuring out the speed at which bare-footed water skiing is done, but I wasn't able to find a decent number. Still the difference may be that a hypothetical runner would have to propulse herself over the water, which may or may not make the thing more difficult.  Hence, I raise the question here. How to delete a row by reference in data.table? I need a way to determine the type of an HTML element in JavaScript. It has the ID, but the element itself could be a &lt;div&gt;, a &lt;form&gt; field, a &lt;fieldset&gt;, etc. How can I achieve this? How do I integrate the following $$\int \frac{dx}{\sin^3 x + \cos^3 x}$$ ?  It appears that I am supposed to break this up into $(\sin x + \cos x)(1-\cos x \sin x)$, but the next thing to do is not apparent to me. How can I chroot sftp-only SSH users into their homes? I want to give a client access to my server, but I want to limit those users to their home directories. I will bind-mount in any files I want them to be able to see.  I've created a user called bob and added him to a new group called sftponly. They have a home directory at /home/bob. I've changed their shell to /bin/false to stop SSH logins. Here is their /etc/passwd line:  bob:x:1001:1002::/home/bob:/bin/false   I've also changed the /etc/ssh/sshd_config to include the following:  Match Group sftponly         ChrootDirectory /home/%u         ForceCommand internal-sftp         AllowTcpForwarding no   When I try to log in as them, here's what I see   $ sftp bob@server bob@server's password:  Write failed: Broken pipe Couldn't read packet: Connection reset by peer   If I comment out the ChrootDirectory line I can SFTP in but then they have free rein over the server. I have found that ChrootDirectory /home works, but it still gives them access to any home directory. I have explicitly tried ChrootDirectory /home/bob but that doesn't work either.  What am I doing wrong? How can I limit bob to /home/bob/?  ----EDIT-----  Okay so I just had a look at /var/log/auth.log and saw this:  May  9 14:45:48 nj sshd[5074]: pam_unix(sshd:session): session opened for user bob by (uid=0) May  9 14:45:48 nj sshd[5091]: fatal: bad ownership or modes for chroot directory component "/home/bob/" May  9 14:45:48 nj sshd[5074]: pam_unix(sshd:session): session closed for user bob   I'm not entirely sure what's going on there,  but it suggests something is wrong with the user directory. Here is the ls -h /home output:  drwxr-xr-x 26 oli      oli      4096 2012-01-19 17:19 oli drwxr-xr-x  3 bob      bob      4096 2012-05-09 14:11 bob My network icon is always a question mark but I have acces to internet Since there are  complex numbers (2 dimensions) and quaternions (4 dimensions), it follows intuitively that there ought to be something in between for 3 dimensions ("triernions").   Yet no one uses these. Why is this?