Is there a documented way to check, from within the code of the program running as the service itself, that it has been started by systemd (as opposed to being started from within an interactive login session, from cron, etc.)?  My current solution is to define an environment variable in the .service unit (Environment=...) and check for its existence in my code.  But there may be something directly available.
To debug a JACK/Pulseaudio issue, I want to understand when and why the pulseaudio daemon is started by systemd (on Fedora).  Using:  $ ps -o'pid,ppid,args' `pgrep pulse`   I see that the pulseaudio daemon is being started by systemd (pid=1)   PID  PPID COMMAND 2738     1 /usr/bin/pulseaudio --start   However, I was unable to find any unit-file on my system containing pulseaudio or even just pulse.  My specific questions are:  A) Is there a way to determine the systemd unit that caused the creation of a specific process (in my example output, process 2738, the PA daemon)?  B) Are there alternative approaches to find out which unit-dependency chain or other settings of systemd resulted in the invocation of /usr/bin/pulseaudio --start?
Open subscheme of an irreducible component remains open? How to change Gnome-Terminal title? I've always wondered how to write the "A ? B : C" syntax in a C++ compatible language.  I think it works something like: (Pseudo code)  If A &gt; B    C = A Else    C = B   Will any veteran C++ programmer please help me out? How to fix task manager memory column if it shows lies What's that ship in the opening credits of 'Star Trek: Enterprise'? When can a (finite) group be written as the quotient of some other group by its center? So if I'm given $H$, when I can conclude there is a group $G$ such that $H\cong G/Z(G)$? It's easy to show that non-trivial cyclic groups are not of this form. More generally, any group with the property that all finitely generated subgroups are cyclic (e.g. $\mathbb{Q},\mathbb{Q}/\mathbb{Z}$) cannot be of this form. Are there are any others? Can we show new/anonymous users more Q&A? With left nav, responsive design, and various new-user notices, this is what an anonymous user currently sees (browser window here is 1090px wide):    I realize that a lot of this content -- code of conduct, new-user intro, cookies notice -- is important.  And I get that the left nav is an important design element, and responsive design dictates the width of the right column.  But when you add it all up, Q&amp;A -- what the site is about -- gets a distressingly small portion of the screen.  Can we do better?   Maybe we can make that intro/mini-tour shorter? Maybe we can hide the right column for anonymous users? Maybe some things can wait until the user's viewed a few pages? Maybe other things I haven't thought of?   My concern is that anonymous users -- people coming from Google, people who were referred to a site by users hoping to recruit them, or others who find their way to us but aren't invested in us -- will turn away before seeing how rich and helpful our sites are.  Which would be a real shame, because our sites are awesome.  First impressions matter.  When I'm asking a rabbi to check out Mi Yodeya or a professional chef to check out Seasoned Advice or my vet to check out Pets (all of these have happened), I want to make a good impression.  I want the person to see more than 2.5 questions; I want to increase the chances the person will see something interesting or say "oh I can answer that!" and dig deeper.  Yes, the other stuff is important, but maybe not now?  Is there a better way to "stage" all this information for people we haven't yet hooked? I know that hardly any information is passed to the PDF when a .tex file is compiled.  But is there a tool that can convert a PDF document back to (La)TeX? First and foremost I am sorry for this; in order to make the questions clear I must first upload the lecture notes from my institution $^\zeta$ for the derivation of Hydrostatic Equilibrium:          $^\zeta$ Lecture notes courtesy of Imperial College London, Astrophysics dept, 2017-2018 edition.    Firstly, in equation $(3.1)$ why is there no negative sign for $F_g$? Last time I checked, Newton's law of gravitation told us that   $$F=-\frac{GMm}{r^2}$$  Nextly, I have a conceptual problem with equation $(3.2)$; when they use the term 'pressure' I am going to assume that they are referring to the radiation pressure that is released due to nuclear fusion reactions taking place in the sun. In that formula it must be the case that $P(r) \gt P(r+\delta r)$ if this is the case then $(3.2)$ should read $$F_p=-\left(\frac{dP}{dr}\right)\delta r\,\delta A $$   Correct me if I'm wrong but Hydrogen nuclei are fused together to generate the more stable Helium and hence lots of radiation pressure acting outwards from the centre of the star. If this is correct then $P(r+\delta r)=0$, since the outside face of that cylindrical volume element in Figure $3.1$ will not 'feel' any of this radiation pressure because this pressure only acts on the inner face. What am I not understanding here?  Moving on to equation $(3.3)$, let's suppose the sign of the gravitational force in $(3.1)$ really is neglected. Does this mean that the negative sign in $(3.3)$ is due to $P(r+\delta r) \lt P(r)$ and hence $$\frac{GM(r)\rho(r)}{r^2}=-\left(\frac{dP}{dr}\right)\,?$$ I know this is the same equation as in $(3.3)$ but I have written it with the negative sign next to the pressure differential as I would like to know where this minus sign originates from. Does anyone know?  My final concern is the sign in $(3.4)$ as last time I checked $$g=-\frac{GM}{r^2}$$ and not $$g=\frac{GM}{r^2}$$  Hence, equation $(3.4)$ should read  $$\left(\frac{dP}{dr}\right)=\rho(r)\,g\,?$$     I forgot to mention that I have done some research and  is the closest derivation I could find, which, needless to say is no less helpful than the notes I have. Why is it impossible to override a getter-only property and add a setter? Why is the following C# code not allowed:  public abstract class BaseClass {     public abstract int Bar { get;} }  public class ConcreteClass : BaseClass {     public override int Bar     {         get { return 0; }         set {}     } }      CS0546 'ConcreteClass.Bar.set': cannot override because 'BaseClass.Bar' does not have an overridable set accessor How do I enable Scroll Lock? I need to enable scroll lock so I can toggle lights on my keyboard. This works on Arch.Funny thing it doesn't work on Ubuntu.    $ xmodmap -e ‘add mod3 = Scroll_Lock’ xmodmap:  unknown command on line commandline:1 xmodmap:  unable to open file 'mod3' for reading xmodmap:  unable to open file '=' for reading xmodmap:  unable to open file 'Scroll_Lock’' for reading xmodmap:  4 errors encountered, aborting. How do I restart the SSH service? I recall being somewhat impressed by a novel I read a few years back – this book may be less than five years old – which featured a college-aged man.  He had a laptop which transformed into a troll goblin that served as his familiar.  In the story's universe, mages had switched to the Internet for most of their magic &amp; communication.  The main character was essentially a magical hacker, and spent much of the book fighting against his evil aunt (I think, I know it was a female relative) with the help of his cousin.  Older forms of magic were also featured, including using special paintings as magical portals, and spells being whistled by wizards.  It features a scene at a gas station where the laptop is disabled by a virus, and the main character whistles a spell to reanimate dinosaurs from the gasoline.  Is this ringing any bells? How do I place a bootable ISO on a USB drive? How to list all functions in a Python module? I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the help function on each one. In Ruby I can do something like ClassName.methods to get a list of all the methods available on that class. Is there something similar in Python? eg. something like: from somemodule import foo print(foo.methods)  # or whatever is the correct method to call Verify proof that sequence converges Creation of a matrix $$Rad(I)=\{a \in R | \exists n \in \mathbb{N} \text{ such that } a^n \in I\}$$   R is a commutative ring, I is an ideal.   To show that $Rad(I)$ is an ideal of $I$, we have to show that for $a,b \in Rad(I)$ it stands that $a-b \in Rad(I)$ and for $r\in R$ it stands that $a\cdot r\in Rad(I)$, right??   When $a,b \in Rad(I)$ we have that $a,b \in R$ and $a^n, b^m \in I$.   $a-b \in R$.   But how can we show that $(a-b)^x \in I, x \in \mathbb{N}$ ?? Adding HTML entities using CSS content How do you use the CSS content property to add HTML entities?  Using something like this just prints &amp;nbsp; to the screen instead of the non-breaking space:  .breadcrumbs a:before {     content: '&amp;nbsp;'; } How do I change the extension of multiple files? I would like to change a file extension from *.txt to *.text. I tried using the basename command, but I'm having trouble on changing more than one file.  Here's my code:  files=`ls -1 *.txt`  for x in $files do     mv $x "`basename $files .txt`.text" done   I'm getting this error:  basename: too many arguments Try basename --help' for more information