I have a Linux system which has a monitor plugged into it, but no keyboard. I would like to ssh into it and run startx as if I had typed this at virtual terminal 1. I have set up  for a non-root user on this terminal.  How can I do that?  $ ssh -x myhost Last login: Mon Dec  9 00:55:14 2019 from 192.168.42.3  # I have permissions to write to /dev/tty1 $ ls -al /dev/tty1 crw------- 1 myusername tty 4, 1 Dec  9 09:21 /dev/tty1  # but I need to tell startx how to use /dev/tty1 instead of /dev/pts/3 $ startx  /usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server xinit: giving up xinit: unable to connect to X server: Connection refused xinit: server error Couldn't get a file descriptor referring to the console [1]  # redirecting doesn't work $ startx &lt;&gt; /dev/tty1 zsh: device or resource busy: /dev/tty1 [1]  # I can run startx as root, but that's not what I wanted to do $ sudo sh -c "startx &lt;&gt; /dev/tty1"  X.Org X Server 1.18.4 Release Date: 2016-07-19 X Protocol Version 11, Revision 0 ...   This is meant to be a question about "how can I run a command as if it had been typed in on /dev/tty1, with the same permissions etc.". For example, if I want to run a command in X, but from a remote login, I can run "DISPLAY=:0.0 xterm", and xterm will come up on the server's monitor. Can someone provide a script called for example run-on-tty, where run-on-tty /dev/tty1 startx will work as expected?  I'm pretty sure there must be a way to do this with ttys on Linux, either with ttysnoop or screen or openvt, but I can't figure it out, and the answers to other similar questions , , and  all seem to advocate working around the missing functionality.
I want to start an Xorg server (which should only feature a minimal xterm terminal emulator from a newly created &quot;pristine&quot; tty). I have thought this to be as simple as issuing a xinit or maybe a startx however both have failed me. Therefore the question: How to manually run/init/start a Xorg server on a different VT/TTY? here the Longer background story to the question at hand: This is the backgroud and what I have tried already: Looking at man openvt I was able to run a shell on a newly created tty (or vt, cannot tell precisly the different vt&lt;&gt;tty) like this:  $&gt; sudo openvt -s /bin/bash  the -s of causes the direct switch to that new tty/vt on that new tty I wanted to manually start a Xorg server which according to man xinit should start with a minimal xterm application. On the new shell on the switched to tty I (created via openvt) I hence issues this command:  $&gt; su -c 'xinit xterm -display :4 -- :4' - mahr &amp;&gt;/tmp/output  and I receive this output $&gt; cat /tmp/output X.Org X Server 1.19.6 Release Date: 2017-12-20 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.4.0-148-generic x86_64 Ubuntu Current Operating System: Linux scitech 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 Kernel command line: BOOT_IMAGE=/vmlinuz-4.15.0-70-generic root=/dev/mapper/ubuntu--vg-root ro Build Date: 03 June 2019  08:10:35AM xorg-server 2:1.19.6-1ubuntu4.3 (For technical support please see http://www.ubuntu.com/support)  Current version of pixman: 0.34.0     Before reporting problems, check http://wiki.x.org     to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting,     (++) from command line, (!!) notice, (II) informational,     (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: &quot;/home/mahr/.local/share/xorg/Xorg.4.log&quot;, Time: Thu Nov 28 10:57:53 2019 (==) Using system config directory &quot;/usr/share/X11/xorg.conf.d&quot; (EE)  Fatal server error: (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied) (EE)  (EE)  Please consult the The X.Org Foundation support       at http://wiki.x.org  for help.  (EE) Please also check the log file at &quot;/home/mahr/.local/share/xorg/Xorg.4.log&quot; for additional information. (EE)  (EE) Server terminated with error (1). Closing log file.  Session terminated, terminating shell...xinit: giving up xinit: unable to connect to X server: Connection refused xinit: unexpected signal 2  ...terminated.
Equality holds in triangle inequality iff both numbers are positive, both are negative or one is zero How do we show that equality holds in the triangle inequality $|a+b|=|a|+|b|$ iff both numbers are positive, both are negative or one is zero? I already showed that equality holds when one of the three conditions happens. Is kinetic energy a relative quantity? Will it make inconsistent equations when applying it to the conservation of energy equations? Equality in an integral estimate Let $u,v\in W^{1,p}(\Omega)$ with $1&lt;p&lt;\infty$ and $\Omega$ be a bounded smooth domain in $\mathbb{R}^N$. Suppose, we have $$\int_{\Omega}|\nabla u|^{p-2}\nabla u\nabla v\,dx=\left(\int_{\Omega}|\nabla u|^p\,dx\right)^\frac{p-1}{p}\left(\int_{\Omega}|\nabla v|^p\,dx\right)^\frac{1}{p} $$ Suppose the equality $$ \int_{\Omega}|\nabla u|^p\,dx=\int_{\Omega}|\nabla v|^p\,dx $$ holds. Then can we say that $u=v$ in $\Omega$? I tried in the following way: Since the first given equality, which is the equality in Holder's inequality holds, and by the second given equality holds, we have $|\nabla u|=|\nabla v|$ in $\Omega$. Then I am unable to proceed. Can someone please help to give an argument? How to make cmd correctly display arabic script? Environment variable substitution in sed If I run these commands from a script:  #my.sh PWD=bla sed 's/xxx/'$PWD'/' ... $ ./my.sh xxx bla   it is fine.  But, if I run:  #my.sh sed 's/xxx/'$PWD'/' ... $ ./my.sh $ sed: -e expression #1, char 8: Unknown option to `s'    I read in tutorials that to substitute environment variables from shell you need to stop, and 'out quote' the $varname part so that it is not substituted directly, which is what I did, and which works only if the variable is defined immediately before.  How can I get sed to recognize a $var as an environment variable as it is defined in the shell? In The Matrix Reloaded, the Architect reveals to Neo that Trinity is about to die. I can't help but wonder if Neo would still choose the left door if the Architect had withheld that information.  The Architect could have designed a better choice mechanism so as to trick Neo into making a choice in the machine's favor rather than a highly risky one.   Did I miss anything important in the movie? For example, you're a fashion designer who wants to get the opinion of both a professional and someone who doesn't know much about fashion. What's a term for the latter person? I need to exclude .git from my find search. To achive that, I am using the -path ./.git -prune switch:  $ find . -path ./.git -prune -o \( -type f -o -type l -o -type d \) | grep '.git' ./.git   However, even though this skips the contents of the .git directory, it lists the directory itself. It works when I add -path ./.git -prune -o -print -a  find . -path ./.git -prune -o -print -a \( -type f -o -type l -o -type d \) | grep '.git'   Why is this necessary. I thought that both commands should have same output. The second syntax is quite ugly. Linux determines the type of a file via a code in the file-header. It doesn't depend on file-extensions for to know which software is to use for opening the file.  That's what I remember from my education. Please correct me in case I'm wrong!  Working a bit with Ubuntu systems recently: I see a lot of files on the systems which have extensions like .sh, .txt, .o, .c  Now I'm wondering: Are these extensions are meant only for humans? So that one should get an idea what kind of file it is?  Or does they have some purpose for the operating-system too? Run a program without administrative privileges in Windows 7 My account in Windows 7 is an administrator account. When I open the Run box (WinKey + R), I am warned, "This task will be created with administrative privileges."    Is there any way to run programs as myself, but without administrative privileges when logged in as an administrator? I installed Ubuntu on a Dell XPS 13 laptop that had Windows 10 preinstalled on it. I installed it from a USB flash drive on a partition. When I boot my computer I can only boot into Windows 10 and Ubuntu is nowhere to be seen.  If I boot into my USB then I can see that Ubuntu is installed, but I can't get to it from the BIOS boot menu. How can I programmatically pause an NSTimer? I'm using an NSTimer to do some rendering in an OpenGL based iPhone app.  I have a modal dialog box that pops up and requests user input.  While the user is providing input I'd like to "pause" i.e. something like this:  [myNSTimer pause];   I'm using this syntax because I've been doing things like:  [myNSTimer invalidate];   when I want it to stop.  How can I programmatically pause the NSTimer? Close Lightning Modal by clicking anywhere outside of it Why do some bad traits evolve, and good ones don't? If a trait would be advantageous to an organism then why hasn't it evolved yet?  Conversely, if a trait is not advantageous or mildly disadvantageous, why does it exist?  In other words why does evolution not make the organism more "perfect"?    This is a general question that would be applicable for any kind of trait. Please keep the answers precise and scientific.   Read this meta post for more information: Is there a way to avoid "+canned.response" in the email address using Gmail's canned response feature If I set up a filter and send it a canned response, Gmail appends +canned.response to my username in the reply.  For example, given the filter "from:foo@example.com to:me@example.com" set up to send a canned response, when foo@example.com sends me an email the canned response comes from me+canned.response@example.com instead of me@example.com, exposing that I'm using a canned response.  Is there a way to avoid this? Is there any lower or upper limit on the energy of a photon? i.e. does the mathematical framework we currently use to study photons blow up when a photon surpasses a certain upper limit of energy? (or the same on the opposite side?)  My thoughts: If I let the energy of a photon tend to infinity, its wavelength would be tending to zero, and since it is thought that we cannot really distinguish things when they are on the scale of a Planck Length, would the photon have its maximum energy when its wavelength is equal to the Planck length? (Feel free to correct me, I feel I might not be.) and for the opposite end of the spectrum a photon with the least energy would have zero wavelength, implying no photon, which is a trivial case. How do you run as a different user from the Start Menu in Windows 10? Running an application as a different user (e.g. domain admin account) from the start menu (by shift + right-clicking the application) used to be an option in Windows 7 &amp; XP.  However, I can't find that option in Windows 10. The workaround seems to be either 1) to find the application in Windows Explorer (shift + right-click) or 2) use runas.exe from the command line.  However, in order to use those workarounds, I have look up the executable name first. It's a bit difficult because I don't have the name of every RSAT tool or executable name memorized.  (e.g. "Active Directory Users and Computers" is dsa.msc, "Routing and Remote Acces" is rrasmgmt.msc)  Is there a simpler way to do this? I am working on a git repository with a master branch and another topic branch. I have switched to topic branch and modified a file. Now, if I switched to master branch that same file is shown as modified.   For example:  git status in git-build branch:  # On branch git-build # Changes to be committed: #   (use "git reset HEAD &lt;file&gt;..." to unstage) # #       modified:   cvsup_current #   Switch to master branch  [root@redbull builder_scripts (git-build)]# git co master M       builder_scripts/cvsup_current Switched to branch "master"   git status in master branch  [root@redbull builder_scripts (master)]# git status # On branch master # Changes to be committed: #   (use "git reset HEAD &lt;file&gt;..." to unstage) # #       modified:   cvsup_current #   Why is that the file is shown as modified in master branch even though it was modified in git-build branch?   My understanding was that the branches are independent of each other and when I change from one branch to another the changes do not "spill over" from one branch to another. So I am obviously missing some thing here.   Anyone got a clue stick? Question  If $|G|=p^3$ and $G$ is not abelian show that $G'=Z(G)$  Attempt   Since $|G|=p^3$ then $G$ is solvable and let $$1\leq G^{(n-1)}\leq...\leq G^{(n)}=G,(1)$$  be its derived series.We know that $G^{(n-1)}$ is an abelian subgroup of $G$ so $|G^{(n-1)}|=p$ or $p^2$ (since $G$ is not abelian).Hence we have that $\bigg|\dfrac{G}{G^{(n-1)}}\bigg|=p$ or $p^2$ so $\dfrac{G}{G^{(n-1)}}$ is abelian $\Rightarrow G'\leq G^{(n-1)}$ so $(1)$ is $1\leq G' \leq G,(2)$.   Furthermore, $Z(G)\not=1$ (since $G$ is a $p-$group) and $\dfrac{G}{Z(G)}$ is abelian $\Rightarrow G'\leq Z(G)$  Is this correct so far? How could I continue? How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]