Assuming there is q process running in the background after launching it with system command:
$ q
q) system "q -p 5000"
q) \\
$
How can I attach my Windows console (cmd or PowerShell) or terminal multiplexer (such as ConEmu) back to that process, so that I get:
q)
q)\p
5000i
I found a similar question here: Windows equivalent for Linux "screen" or another alternative?
The asker is looking for a windows version of the Linux screen command, which I think would be what you are looking for. Unfortunately there doesn't seem to be a native solution but you should read through it and see if it sheds any light on the topic for you.
A workaround using IPC, connect to the process from a new q session using:
q)h:hopen `::5000;
Then pass the command through to get the information you need.
q)h"sum 10 20"
30
Here's a link to the kx IPC cookbook for more info on IPC:
http://code.kx.com/q/cookbook/ipc/
Hopefully some of this is useful to you.
Related
After copying myexentension#me.com folder to .../gnome-shell/extensions/ I'm executing this command on the terminal:
gnome-shell-extension-tool -e myexentension#me.com
Then, I restart my session with Alt + F2 and execute r, and everything works fine.
But can I start my extension only through the command line? Without Alt+F2+r? Without restarting my gnome-shell session?
According to some answers around the internet, sending SIGHUP to the gnome-shell process restarts it (i. e. killall -HUP gnome-shell), but I haven’t been able to find a clear source on this and couldn’t find the signal handling in the code. What I do know is that this should be exactly equivalent to Alt+F2 r:
busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'
Because apart from a gettext call on the message, this is exactly what Alt+F2 r is bound to (see runDialog.js – search for _restart).
January 2022 update: Since Gnome 41, calling Eval is restricted and requires “unsafe mode” to be enabled, so by default this will no longer work. I’m not currently aware of a replacement for this particular usage.
Personally, I prefer a solid Alt+F2, r+Enter but maybe try disabling and enabling:
gnome-shell-extension-tool -d myexentension#me.com && gnome-shell-extension-tool -e myexentension#me.com
or
gnome-shell-extension-tool -r myexentension#me.com
Which may do the same thing. There's also gnome-shell-extension-prefs which you can use to do the same thing (and is typically hidden in Gnome for some reason).
I am using Meteor on windows with cygwin, and after executing "meteor help" I was surprised to see that no command to stop the server was available. Hitting ctrl+c did not stop it. I can't find any process called node or meteor. What can I do?
read more about Ctr + C and Ctr + Z in here
and the reason for cygwin in here
I'm trying to setup a cluster on a Linux box using the parallel package. A wart is that the machine I'm using as the master is running Windows as opposed to CentOS.
After some hacking around with puttygen and plink (putty's version of ssh) I got a command string that manages to execute Rscript on (a) slave, without needing a password:
plink -i d:/hong/documents/gpadmin.ppk -l gpadmin 192.168.224.128 Rscript
where gpadmin.ppk is a private key file generated using puttygen, and copied to the slave.
I translated this into a makeCluster call, as follows:
cl <- makeCluster("192.168.224.128",
user="gpadmin",
rshcmd="plink -i d:/hong/documents/gpadmin.ppk",
master="192.168.224.1",
rscript="Rscript")
but when I try to run this, R (on Windows) hangs. Well, it doesn't hang as in crashing, but it doesn't do anything until I press Escape.
However, I can laboriously get the cluster running by adding manual=TRUE to the end of the call:
cl <- makeCluster("192.168.224.128",
user="gpadmin",
rshcmd="plink -i d:/hong/documents/gpadmin.ppk",
master="192.168.224.1",
rscript="Rscript",
manual=TRUE)
I then log into the slave using the above plink command, and, at the resulting bash prompt, running the string that R displayed. This suggests that the string is fine, but makeCluster is getting confused trying to run it by itself.
Can anyone help diagnose what's going on, and how to fix it? I'd rather not have to start the cluster by manually logging into 16+ nodes every time.
I'm running R 3.0.2 on Windows 7 on the master, and R 3.0.0 on CentOS on the slave.
Your method of creating the cluster seems correct. Using your instructions, I was able to start a PSOCK cluster on a Linux machine from a Windows machine.
My first thought was that it was a quoting problem, but that doesn't seem to be the case since the Rscript command worked for you in manual mode. My second thought was that your environment is not correctly initialized when running non-interactively. For instance, you'd have a problem if Rscript was only in your PATH when running interactively, but again, that doesn't seem to be the case, since you were able to execute Rscript via plink. Have you checked if you have anything in ~/.Rprofile that only works interactively? You might want to temporarily remove any ~/.Rprofile on the Linux machine to see if that helps.
You should use outfile="" in case the worker issues any error or warning messages. You should run "ps" on the Linux machine while makeCluster is hanging to see if the worker has exited or is hanging. If it is running, then that suggests a networking problem that only happens when running non-interactively, strange as that seems.
Some additional comments:
Use Rterm.exe on the master so you see any worker output when using outfile="".
I recommend using "Pageant" so that you don't need to use an unencrypted private key. That's safer and avoids the need for the plink "-i" option.
It's a good idea to use the same version of R on the master and workers.
If you're desperate, you could write a wrapper script for Rscript on the Linux machine that executes Rscript via strace. That would tell you what system calls were executed when the worker either exited or hung.
Now what I do is:
$ lein ring server &
Then what I see is: [1]+ Stopped lein ring server. Then I'm trying to use:
$ fg 1
And also see that it's stopped. What do I do wrong and how can I run ring as a background process?
As lein simply launches a Java process, this answer of course does not apply to ring/leiningen only.
The simplest way might be to use one of the following Linux/UNIX utilities (and some more as well):
screen
detachtty
nohup
I made a pseudo terminal with method described here: http://lists.apple.com/archives/student-dev/2005/Mar/msg00019.html
The terminal itself worked well. Anyway the problem is terminal cannot being switched to child process. For an example, I launched bash with NSTask, and if I execute ftp within the bash, it stops automatically.
ftp
ftp
ftp>
[1]+ Stopped ftp
bash-3.2$
And if I try to continue the ftp with fg, it terminates quietly. (I checked this with Activity Monitor)
fg
fg
ftp
bash-3.2$
fg
fg
bash: fg: current: no such job
bash-3.2$
I think it needs some more infrastructure (which completes pseudo terminal) to switch control to child process. What's required to do this?
I could finally do this by creating a pty device. To make a program behave like "Terminal", it must be executed in an interactive terminal, and that needs pseudo-terminal device.
Unfortunately, AFAIK, NSTask does not support any pty ability, so I had to get down to BSD layer.
Here's my current implementation: https://github.com/eonil/PseudoTeletypewriter.Swift
sudo is working well, and I believe ssh should also work.
Have a look at the source code of MFTask and PseudoTTY.app (which works on Mac OS X 10.6).
See: http://www.cocoadev.com/index.pl?NSTask
For a pty command line tool see here.