I want to implement a script to execute any command with root privileges, but without having to put any password.  At the terminal I would like to see it like this:  ./newsudo "comand with root privileges"    I think, the way to go would be to use the "comand with root privileges" as an argument inside the script with and exec or similar, to execute it.   The truth is, I'm very noob in all this area and I don't know where to start.   Thanks!!
... but still be required for applications that need admin privilegies?  In order to allow the following:  $ apache2ctl restart httpd not running, trying to start (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs  $ sudo !! sudo apache2ctl restart             #no password asked $                                   #works!   For reference I've seen this setup on amazon's e3 instances  Any idea?
Are recommendation questions an acceptable kind of list-type question or should they be closed? Recommendations are a recurring topic on multiple Stack Exchange (SE) sites. Some sites allow recommendations (ex: ), some do not (ex: ). There are many reasons for that and I can still remember animated discussions on this subject on the Gaming meta. Then there is that existential problem with Sci-Fi SE, &quot;What problems does answering a question on this site solve?&quot;  The only common problem I can think of is What to read/watch next?, which obviously led to a big number of recommendation questions, later slightly disguised as list question. And the main trouble with these questions isn't objectivity at all, some of them aren't even subjective. It's the fact that they don't have an answer - they are open ended. -  Those questions are monstrously popular because:  There's an actual problem to be solved,  or  This problem is quite common.  In view of the  blog post, a recommendation question fails the &quot;real questions have answers, not items or ideas or opinions.&quot; criteria. But it's still a &quot;practical, answerable questions based on actual problems that you face. &quot; and it requires expertise to answer. The problem is that there are multiple acceptable answers, and the asker is not the best person to evaluate the best answer because he doesn't know which one is the best compared to the others, and he cannot test it in short term. Even the need to accept an answer is questionable. So, is a recommendation question an acceptable kind of list-type question or should it be closed just like any other list-type questions? How do I get a list of all files (and directories) in a given directory in Python? I have an Ubuntu 12.04 machine on which I have installed VirtualBox with Ubuntu 12.04 as the guest OS.  How can I share files between the host and guest?   I have installed the guest additions also but still it’s not able to mount the sf_shared folders if even it’s mounted. This means I'm unable to retrieve the file from the host. Let $X \sim Bin(n,p)$ show that $X/n \nsim Bin()$ Let $X \sim Bin(n,p)$   Part A.  Show that the argument      "Then $X/n \sim Bin()$ with $E[X/n]=p$and $Var[X/n]=pq/n$"    is false.   My book says we can prove this result using a moment generating function. But to me it makes no intuitive sense: We have Bin-distributed RV $X$ and if we rescale it with $1/n$ of course it will be Bin-distributed.  And we know from standard formulas that $E[aX]=aE[X]$ and $Var[aX] = a^2Var[X]$ so I think the argument is correct.   (For full disclosure, the argument we should falsify according to the book is "Let X be a binomial random variable with mean np and variance np(1−p). Show that the ratio X/n also has a binomial distribution with mean p and variance p(1−p)/n." But I think the argument is correct. )    Ok, now I get part A. Here is Part B. Prove it using the moment generating function of $X/n$.   Attempt: I get $$m_X(t)=E[\exp(tX/n)]=(m_X(t))^{1/n}$$ Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not. NSdate Assuming wrong time zone Compare given date with today Is there an international taxonomy of academic titles/ranks? Looking at the  on Wikipedia shows that the same academic rank/title can mean quite different things in different countries. For instant, a "research assistant" in the US can stand for an undergrad student doing an internship, while in the UK it can stand for a postdoc. Similarly, the term "lecturer" might stand for a permanent position (e.g. in the UK) or for a teaching assistant position, open to graduate students.   However, when thinking about it, there are not so many kind of possible positions (permanent or not, with teaching or not, with research or not, with PhD supervision or not, with team responsibility or not, etc), and having a clear title could help a lot (for instance, in my case, I've been working in four different countries, with a different job title each time!).    Is there some kind of official taxonomy that one could refer to?  If not, who could be in charge to create it? (the EU, if only for intra-Europe mobility?) Does javascript use immutable or mutable strings? Do I need a "string builder"? Operation not permitted turning off airplay mirroring Can gravity be interpreted as the acceleration of spacetime towards an object? Greetings StackExchange!  We were having a conversation with a peer about stupid ways of interpreting theories. We would go to and fro with an interpretations, but we would always find a way to disprove them. There was one, however, that we couldn't refute:  Gravity on a plane in a bidimensional space can be interpreted as the acceleration of spacetime towards an object.   We tried to invalidate in saying that the inertial mass and gravitational mass would be different, thus violating GR, but after some thought this couldn't be. The gravitational mass would accelerate spacetime towards it. If that object we were to be pushed, the pulling of spacetime would make it difficult for it to move.   We know for a fact this can't be true, and we would greatly appreciate any refutation of this thought. I can clarify if needed, or do a sketch. I apologise in advance as I'm not a native speaker. Find $ P(Z>X+Y)$ where $X,Y,Z \sim U(0,1)$ independently I'm trying to follow a line in a derivation for $P(Z&gt;X+Y)$ where $X,Y,Z$ are independent continuous random variables distributed uniformly on $(0,1)$.  I've already derived the pdf of $X+Y$ using the convolution theorem, but there's a line in the answer that says:  $P(Z&gt;X+Y) = \mathbb{E}[\ P(Z&gt;X+Y\ |\  X+Y )\  ]$ where $\mathbb{E}$ is the expectation.  I'm not familiar with this result. Could anyone give a pointer to a similar result if one exists?  Thanks. Do black holes have a moment of inertia? My question is in the title: Do black holes have a moment of inertia?  I would say that it is: $$I ~\propto~ M R_S^2,$$ where $R_S$ is the Schwarzschild radius, but I cannot find anything in the literature. Agreement in "[Singular Noun] Is/Are [Plural Noun]"? Cannot set up multiple desktops (workspaces) I have a problem with the interpretation of a test result in which the p-value is 8.6e-28. How should it be interpreted? What is the e for?  Specifically, I used White's Test for the homoscedasticity assumption of a linear regression:  White's general test statistic :  150.0535  Chi-sq( 9)  P-value =  8.6e-28 What are the prerequisites for studying mathematical logic? I am looking to study mathematical logic, however, I find that introductory books are very daunting, which kind of disheartens me. You see, slowly but surely, I started to realize that the maths which I have learned did not just pop out of thin air, but is a collection of systems, which must of been developed via some other system, i.e, maths did not develop itself.  So I began to look into the origins of mathematics, and read that it was developed via a type of logic, which exists sort of by 'default', via a set of axioms, and then of course I looked up the definition of axioms.   So given that I'd be studying a type of logic whose origins are self evident axioms, naturally I believed there would be no prerequisites. However, in looking up mathematical logic, I have come across things such as Boolean algebra, sets, first order logic, some other type of logic, called 'traditional logic', as well as references to a sort of calculus, though not in a mathematical sense, I think.  So all in all, I am trying to develop a type of mental spider web, and I am trying to find out the strands which lye at the absolute bounds so that I may learn this mystique logic. Though I have no idea where to start.  Side note: This is the book I have started reading:   Credit goes to Wolfgang Rautenberg. In what cases should I use a comma before "or"? Assume that $Y_0,\ldots , Y_n$ are independent random variables with the following identical distribution: $Y_i=1$ with propability $p$ and $Y_i=0$ with propability $1-p$. Also set $S_0=0$ and $S_n=Y_0+\ldots + Y_n$.  It's quite trivial that $(Y_n)_{n\geq 0}$ is a Markov chain, and I managed to show that $(X_n)=(S_n)_{n\geq 0}$ is also a Markov chain, by showing that  $\mathbb{P}(X_{n+1}=i_{n+1}\,|\,X_0=i_0,\ldots,X_n=i_n)=\mathbb{P}(X_{n+1}-X_n=i_{n+1}-X_n\,|\,X_0=i_0,\ldots,X_n=i_n)=\mathbb{P}(Y_{n+1}=i_{n+1}-X_n\,|\,X_0=i_0,\ldots,X_n=i_n)=\mathbb{P}(Y_{n+1}=i_{n+1}-i_n)=\mathbb{P}(Y_{n+1}+i_n=i_{n+1})=\mathbb{P}(X_{n+1}=i_{n+1}\,|\,X_n=i_n)$  However I am now running into the problem that I have to find whether or not $(X_n)=(S_0+\ldots + S_n)_{n\geq 0}$ is a Markov chain. I suspect that it isn't, but i'm having trouble finding a counterexample. I also need to find if $(X_n)=(S_n, S_0+\ldots+S_n)$ is a Markov chain, but I think this actually might be one, since $X_n$ gives "more information" (so to speak) to $X_(n+1)$. Again, having trouble actually proving that.  I appreciate any help, tips etc you can give me. Choosing OpenLayers or Leaflet? I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver and PostGIS.  Then I found , which looks pretty new but has the features of connectivity with the Geoserver and PostGIS.  So my project details are as follows,   Use the map interface to fetch Feature Info Create a customized tool that takes the lat/lon from user as to where he/she clicks on the map and then fetches the Climate Data from the raster (which is handled by a py script on the server) Allows user to upload excel, which is sent to the py script, which returns a GeoJSON, which creates Vector Features on the map Allow user to create vector polygons, which will fetch the Features it intersects from the WFS Layer. Fetches Layer from the PostGIS Datastore on GeoServer and displays the layers on the map.   So now I am confused on which is better and why using OpenLayers over Leaflet makes more sense or not?