I'm using Linux CentOS 6.4 .  I'm writing a shell script and I need to extract a machine's IP in order to use it in the script. How can I find the machine's IP?  I'm looking for the "best" way because I know there are a few ways to get IP addresses.  Thanks
If I want to display the IP address that is assigned to eth1, how can I do this in Bash?
I just installed a new Ubuntu Server 18.04. I set my hostname hostnamectl set-hostname ****.openbayou.biz and I set /etc/hosts:  127.0.0.1 localhost [ip address] ****.openbayou.biz hostname # The following lines are desirable for IPv6 capable hosts [ip6 address] *****.openbayou.biz hostname ::1     localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters   I also installed OSSEC to monitor for new files, errors and changes to my server and I'm now getting these alerts:  Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-  0001, retrying transaction with reduced feature level UDP.`   It's now repeating itself:  systemd-resolved[3195]: message repeated 4 times: [ Server returned error  NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction  with reduced feature level UDP.]   I've looked online for a solution and nobody is reporting this issue. Clicking on tags in global search results is broken How to recover a dropped stash in Git? I frequently use git stash and git stash pop to save and restore changes in my working tree. Yesterday I had some changes in my working tree that I had stashed and popped, and then I made more changes to my working tree. I'd like to go back and review yesterday's stashed changes, but git stash pop appears to remove all references to the associated commit.  I know that if I use git stash then .git/refs/stash contains the reference of the commit used to create the stash. And .git/logs/refs/stash contains the whole stash. But those references are gone after git stash pop. I know that the commit is still in my repository somewhere, but I don't know what it was.  Is there an easy way to recover yesterday's stash commit reference?  Note that this isn't critical for me today because I have daily backups and can go back to yesterday's working tree to get my changes. I'm asking because there must be an easier way! I own a lot of games on Steam, and I'm overall a big fan of the service.  However, one thing about it really bothers me, and I'm wondering if anything can be done about it.  Let's say I have two different online, multiplayer games, both of which I legally own.   If I bought these games normally, I could be playing one of them online, while my fiance could play the other one online on another computer.     However, with Steam, I can only be signed in on one computer at a time.  So, despite the fact that I have bought about 40 games, if I'm playing one of them, someone else in my house is not able to play any of the others.  Is there a way to get around this?  I don't think this is illegal or immoral as I own both of the games in question, and only one person is playing the game at a given time (same IP address and the same household, so it should be easy for Steam to verify that I am not sharing my games unfairly).    If I had bought simple boxed copies, this wouldn't be an issue, but since I became such a fan of Steam, I can't play any of those games at the same time as my fiance.    Is there anything that can be done? Is trace of regular representation in Lie group a delta function? My major is physics. I need to use some tools in group theory, but I am really  confused by the trace in compact infinite groups. The following is my question:  In discrete group theory, the irreducible representation of identity group element $e$ is always an identity matrix. So the trace of $e$ under  regular representation is the order of the group : $\chi(e) = |G|$. I hope to get  similar result for Lie group. For example, SO(2) has infinite number of irreducible representations, $D^{(m)}$, where $m=0,\pm 1, \pm 2,\cdots $. All of them are 1-dimensional $D^{(m)} = e^{im\phi}$. Here $\phi$ is the rotation angle. For element $R(\phi)$ in SO(2), the trace in $m$th irreducible representation should be  $\chi(R(\phi))=e^{im\phi}$, if we sum all these traces up, we get the trace in regular representation. So what is the trace of $e$ in the regular representation ? It seems to be infinite. In my situation, it's for a local build/staging server running ubuntu server. Things I'd like to know are:  Why I should/shouldn't use LVM?  What problems might it cause in terms of either regular server operation or things I might want to do later? (ex. partitioning)  Why I should/shouldn't use encrypted LVM instead of LVM?  What problems might encrypted LVM cause in terms of either regular server operation or things I might want to do later? (ex. partitioning) Understanding a probability paradox Three prisoners are informed by their jailer that one of them has been chosen at random to be executed and the other two are to be freed. Prisoner A asks the jailer to tell him privately which of his fellow prisoners will be set free, claiming that there would be no harm in divulging this information because he already knows that at least one of the two will go free. The jailer refuses to answer the question, pointing out that if A knew which of his fellow prisoners were to be set free, then his own probability of being executed would rise from 1 3 to 1 2 because he would then be one of two prisoners. What do you think of the jailer’s reasoning?  If the jailer refuses to say anything, then the probability that prisoner $A$ is excecuted is $\frac{1}{3}$. If the jailer says to prisoner $A$ that prisoner $B$ will walk free, then $2$ prisoners remain to be considered, $A$ and $C$. One dies, one does not. Heads or tails essentially. $\frac{1}{2}$ ought to be the conditional probability that $A$ dies given that $B$ walks free no? Apparently not though, allegedly the correct answer is still $\frac{1}{3}$. Even my attempt to calculate the correct answer yielded the result $\frac{1}{2}$.   Let $A_D$ and $C_D$ respectively denote the event of $A$ and $C$ dying. Let $B_F$ denote the event that $B$ walks free. Assume that the jailer tells prisoner $A$ that prisoner $B$ will walk free.   Here's my attempt.  $$P(A_D\mid B_F)=\frac{P(A_D\cap B_F)}{P(B_F)}=\frac{P(A_D\cap B_F)}{P((B_F\cap A_D)\cup (B_F\cap C_D))}=\frac{P(A_D)P(B_F\mid A_D)}{P(A_D)P(B_F\mid A_D)+P(C_D)P(B_F\mid C_D)}=\frac{\frac{1}{3}\times 1}{\frac{1}{3}\times 1+\frac{1}{3}\times 1}=\frac{1}{2}$$  What am I doing wrong?  Edit 1: Intuitively I am still troubled but I understand now that $B_F$ may occur even though the jailer does not necessarally say $B$.   Edit 2: I suppose that it makes some sense if the faiths of the prisoners had already been decided before prisoner $A$ asked the jailer the question. If the jailer decides to reveal one of the others who will walk free then that must've been the case. i'm surprised there is so little documentation on this issue. But i'm trying to duck the audio on all the mix buses in Unity so that you can clearly hear the VO of the game.  Now it works great except that I have some reverb zones in the game and any sound that plays in these reverb zones, the actual reverb itself is NOT DUCKED.  So the VO is accompanied with a huge wall of wishy washy muddy noise.  Anyone deal with this before? How can we deal with this? How do I install transition molding between my new hardwood and existing tile floors? I have ripped out some old carpet and am preparing to install a new solid hardwood floor myself.  In several places, the floor transitions to an existing tile floor.  The hardwood floor guys told me the best transition between the two is a T molding.  You simply leave a gap between the two floors, and then place down the T molding between the two floors, so it sits on both surfaces.  Sounds simple enough.  However, the height difference of the two floors is considerable, and the T molding does not sit flush.  What are my options?  Here is a diagram showing the dimensions.      NOTE:  Using the T molding is not a requirement, I could go some other route if there is a better option. How do I find values not given in (interpolate in) statistical tables? Often people use programs to obtain p-values, but sometimes - for whatever reason - it may be necessary to obtain a critical value from a set of tables.   Given a statistical table with a limited number of significance levels, and a limited number of degrees of freedom, how do I obtain approximate critical values at other significance levels or degrees of freedom (such as with $t$, chi-square, or $F$ tables)?  That is, how do I find the values "in between" the values in a table? What does “pull sb. out of the hat” mean? I found the phrase, “pull her out of the hat” in the following sentence of the quote from Frank Bailey, the most relied-upon former aide of Ms.Sarah Palin, whose memoir, “Blind Allegiance to Sarah Palin: A Memoir of Our Tumultuous Years” is due out on Tuesday this week.  “I doubt if there's anything new in this book, just more detailed views of the gruesome story of her rise and fall. What would really be interesting is an account of who made the decisions in the GOP to pull her out of the hat. It certainly wasn't McCain.”  I don’t find the idiom, “pull one out of the hat” in any dictionaries at hand. Does it mean to “pick up” (Sarah Palinfor (vice) presidential candidate) or “remove her from (the candidate seat)? Can somebody teach me the meaning of this phrase? How can I display just a portion of an image in HTML/CSS? Our 3 months old baby is very keen on rolling over and being on his stomach. Most of the time he automatically rolls over in a few minutes after we put him on his back, including during bed time. Is this dangerous? We are particularly worried that   his nose maybe blocked when facing down it is said that SIDS risk increases when a baby sleeps on his stomach   If it is dangerous, how can we stop this, especially during bed time or other times when we can't watch him continuously? Finding the index of an item in a list Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python? TikZ/PGF 3.0 datavisualization vs pgfplots To follow-up on a previous question , the current release of TikZ 3.0 has a flexible datavisualization engine that creates the same kind of plots as the more mature plotting package pgfplots.  What is the current recommendation for producing complete plots in LaTeX? What is $\int_{c}^{\infty}\Phi(a+bx) \phi( x ) dx$ for $c\in\mathbb{R}$ It is straightforward to show $$\int_{-\infty}^{\infty}\Phi(a+bx) \phi( x ) dx = \Phi\left(\frac{a}{\sqrt{1+b^2}}\right)$$ but what value does $$\int_{c}^{\infty}\Phi(a+bx) \phi( x ) dx$$ have for $c&lt;\infty$, e.g., for $c=0$? Even a good approximation would really help me! How can I shutdown my Android phone using an adb command? How do I halt an android phone using adb command? I can reboot, but I don't know how to halt.  I tried shutdown -k wait command, but it did not work. What is a “protected” or "highly active" question? Javascript infamous Loop issue? Keep iphone active while running program how to set iPhone device to stay active ( to not lock ) while my app is running ? Any idea