As courtesy we host our clients' website files. Each client has their own Linux account, and website files are served from /home/user/public_html.  All of the clients files have ownerships of user:user. Permissions for the accounts are 755, and this allows them to upload and manage files via SSH, and Apache can serve files, too since it has read access via the "everyone else" permissions. With this setup, users are free from worry that other users can modify their files.  The problem comes in with a Wordpress, Drupal, or other CMS where the software is responsible for self updates and file management is done through the website's interface (Wordpress' Media Library, for example.)  To do this a user or group has to have write access. Many solutions on the net advise the following ownership and permissions setup on web files and directories that need to be routinely updated / modified:  ownership: user:www-data permissions: 775 user becomes a member of the www-data group  With this setup, two undesirable things happen. The first is that, because they are of the same group, users can now access other user's accounts and, accidentally or not, modify delete or upload files, which is a bit security risk, especially if a user uploads a plugin or module with malicious code.  The second is that after uploading an image through the interface, for example, that file is now owned by www-data:www-data and the user can no longer manage these files via ssh / ftp.  Is there a way to force www-data to respect the ownership of the files so that user is always the user? What's the proper way to set up Apache in a multi user environment where Apache needs write access but I avoid these permission and security issues?
I want to stop having to use sudo everytime I work in /var/www. How can I do that? I simply want to put all of my sites into this directory and work with them without too much pain.
How do I remove any Ubuntu brand and trademark from my Ubuntu install? I have a problem understanding the proof of Rencontres numbers (Derangements) A fair coin is tossed until a head comes up for the first time. The probability of this happening on an odd number toss is?  How do i approach this problem ? Install a .NET windows service without InstallUtil.exe In Season 6, we find out the following about the magical properties of the wall:     BENJEN: This is where I leave you.   BRAN: You're not coming with us?   BENJEN: The Wall is not just ice and stone. Ancient spells were carved into its foundations. Strong magic to protect men from what lies beyond. And while it stands, the dead cannot pass. I cannot pass.   —"Winds of Winter" (Game of Thrones, S06E10)   So why would the men of Westeros need to worry about the Night King and his army? Couldn't they sit back and enjoy the wall's protection? Unsubscribe anonymous method in C# Is it possible to unsubscribe an anonymous method from an event?  If I subscribe to an event like this:  void MyMethod() {     Console.WriteLine("I did it!"); }  MyEvent += MyMethod;   I can un-subscribe like this:  MyEvent -= MyMethod;   But if I subscribe using an anonymous method:  MyEvent += delegate(){Console.WriteLine("I did it!");};   is it possible to unsubscribe this anonymous method?  If so, how? Holomorphic self map on the open unit disc How can I scale all images in a folder to the same width? I want to scale all images in a given folder to the same width (but different appropriately scaled heights). How can I do this using  a GUI-based or command-line tool?  For bonus points, is it possible to restrict which images are scaled based on their initial width (that is, only scale images that have a width > x and/or a width &lt; y)? Conjunction Puzzle: Is this clause dependent or independent? Third grade teacher here. I plan to teach students to distinguish between simple, compound and complex sentences — but only if I can demonstrate a clear and meaningful difference between the latter two!  Complex or Compound? Each sentence in the following pairs is similar to its partner.   All dogs are mammals, so huskies are mammals. All dogs are mammals, therefore huskies are mammals. I come bearing soup, for Kate is sick. I come bearing soup, because Kate is sick.   Are the sentences above complex or compound?   First, we need to decide whether each italicized clause is independent or dependent. To me, they all look dependent. If that is the case, there's not much need to teach about compound sentences. Is there a meaningful difference between the sentences in each pair that I am missing? (Are the FANBOYS as special as they'd like to think?) Does time pass fastest in isolated, resting space? While it is fairly established that both fast movement and the presence of gravity make time pass slower as compared to a system at rest / free of gravity, does that mean that there is no way for time to pass faster than in vacuum, or does general relativity also have "faster" metrics?  To be more precise, is there any frame into which one could go for a while, and on returning to vacuum less time would have passed there? Solving $\textbf{r}''(t)=\frac{GM}{(r(t))^3}\textbf{r}(t)$ I have the following problem that I don't know how to solve:  Let $\textbf{r}(t)$ be a curve and let $r(t):= |\textbf{r}(t)|$. Let the curve $\textbf{r}(t)$ be defined by: $$\textbf{a}(t)=\frac{GM}{(r(t))^3}\textbf{r}(t)$$ Where $\textbf{a}(t) = \textbf{r}''(t)$ is the acceleration of the particle and $G,M \in \mathbb{R}$. Suppose that $\textbf{r}(t)$ and $\textbf{r}'(t)$ are not parallel. The objective is to determine the trajectory $\textbf{r}(t)$ in polar coordinates.  So basically we have the following equation: $$\textbf{r}''(t)=\frac{GM}{(r(t))^3}\textbf{r}(t)$$ The thing is that I don't know how I should proceed from now on. If we'd have just normal scalar function this would be a differential equation and I think I would be able to solve it, but like this I have no idea how to approach the problem. How can I solve this?  Edit: If $$\textbf{r}(t):=(x(t),y(t))$$ then the equation turns into the following system of equations: $$x''=\frac{GM}{(\sqrt{x^2 + y^2})^3}x$$ $$y''=\frac{GM}{(\sqrt{x^2 + y^2})^3}y$$ I don't know if this helps but I think that this turns thing easier perhaps. Bash Brace Expansion & Variables I have a find command:  find Directory/{Alpha,Bravo,Charlie} arg1 arg2   I want to replace Alpha,Bravo,Charlie with $find_dir  find Directory/{$find_dir} arg1 arg2   however the latter expands to   find Directory/{Alpha,Bravo,Charlie} arg1 arg2   rather then   find Directory/Alpha Directory/Bravo Directory/Charlie arg1 arg2   Why? It's part of a fairly complex bash script that may have more or less directories, not all which are relevant (so globbing Upload/* would not work). So if I setup three now and add another, I'll have to manually add it in later. Plus I need it run from the root of directories to keep finds outputs perspective (./Upload/Dir/file as opposed to ./Dir/file).   But using a variable would permit me to change that as needed and keep it relevant to other parts of the script. Adding Items to the List Using JQuery Mobile in Javascript When customers buy things from a store, you say:  (1) Customers give ABC Store business.  If I "turn this around", can I say:  (2) ABC Store obtains or acquires business from its customers.  Do these verbs work in (2)? Free, open-source substitutes for Mendeley? is (mainly) a proprietary social network to share basic citation data and research papers.   Are there any free and open source substitutes for this service?   A technical possibility: users could collect BibTeX data and a hash and share this information.  It would be very useful to have such a free service because every journal provides the citation data in a different format. That includes false field entries, broken files and hidden download buttons on the website. How to show that a set of discontinuous points of an increasing function is at most countable I would like to prove the following:       Let $g$ be a monotone increasing function on $[0,1]$. Then the set of points where $g$ is not continuous is at most countable.     My attempt:    Let $g(x^-)~,g(x^+)$ denote the left and right hand limits of $g$ respectively. Let $A$ be the set of points where $g$ is not continuous. Then for any $x\in A$, there is a rational, say, $f(x)$ such that $g(x^-)\lt f(x)\lt g(x^+)$. For $x_1\lt x_2$, we have that $g(x_1^+)\leq g(x_2^-)$. Thus $f(x_1)\neq f(x_2)$ if $x_1\neq x_2$. This shows an injection between $A$ and a subset of the rationals. Since the rationals are countable, $A$ is countable, being a subset of a countable set.    Is my work okay? Are there better/cleaner ways of approaching it? How do I update the GUI from another thread? I know I can only use the gym feature after hitting level 5, but are there any other privilege or rewards for the levels above 5?  For example, in Ingress, some items are only available for the higher level player. How about Pokemon Go? Class imbalance strategies When dealing with the class imbalance problem in a binary classifier, there are three ways I know of to address it: over-sampling, under-sampling and using cost-sensitive methods.   Are there any guidelines, rules of thumb or general strategies to choose among these methods? A possible answer would be: over-sample when the positive class has more than 100 instances (I just made it up). How do I make Div Container 100% width only on homepage of site?