vnc screen is freezed, not fixed by rebooting - vnc

I had several programs running on a server, which I connect to with VNC Viewer. And for some reason firefox became unresponsive, and the screen froze. I followed these steps:
vncserver kill -9 :1 to kill the process
vncserver :1 to start a new one
sudo reboot
However, when I reconnected, the screen was still frozen and I could not even move the mouse cursor. Here is a screenshot:

Whoops! I found the reason for that, I had mistakenly checked the view-only checkbox. Here is the screenshot:

Related

AWS EC2: keep running node.js after exit console

I use aws ec2 to host web server with node.js and apache.
So far, I always need to login ec2 through terminal to run npm start.
I wanna make it keep running even if Im not on terminal. How am I supposed to setup for it?
I turned on https, but nothing happened.
I appreciate it in advance.
One option is using the screen command:
screen
You will reach a new bash prompt for that screen. Run your app.
To detach the screen, press Ctrl+A, then D to detach from that screen.
To reattach screen when you next SSH in, use
screen -ls
to see detached screens and use
screen -r xxxxx
with the screen number to reattach that screen.

How to stop Yarn Package Manager script from CLI

https://yarnpkg.com/en/docs/cli/
Is there a way to stop what is started from the command "yarn run"? Is my only option to lookup the process number and call kill on it?
The usual way ctrl-c should work. If it doesn't work, than you have bug in the script. The script's author missed handler for shutdown (SIGINT/SIGTERM/etc).
I had a similar issue having it running after ctl+c and then I thought, maybe it is just running on the cache
so went to http://localhost:3000/
ctrl+F5
which forces refresh without cache showed me that the actual project wasn't really running anymore!
;)
*hadn't it worked I would have had to sudo kill the 3000 port
I know this is a well-answered question. However, it behaved once very strange when I was running a sample React code which was auto-created by the create-react-app CLI, on my Windows 10.
After hitting Ctrl+C, which is the most suggested standard way to stop the yarn run, though I got back the command prompt, there was a ghost process lingering around there, which was still actively listening to 3000(default) port, and localhost:3000 was working as normal.
So finally this is how I fixed it:
netstat -ano | grep ":3000" (yeah, I ran this from my git-bash instead of command prompt!)
Noted down the PID of the line where it says LISTENING on 3000
Pressed Ctrl+Shift+Esc to open the Task Manager
Went to the Process tab
Right clicked on one of the headings, say Name
Selected PID --> This added the PID column to the display
Located the PID in question
Right clicked on it and clicked "End task"
Luckily Windows knew how to kill that misbehaving, ghost process and the port became free for me.
NOTE: Prior to the above-mentioned steps, I tried to kill that PID from git-bash using the famous (or notorious as per its meaning?? >8)) kill -9 command. It was responding back with no such PID msg, however netstat -ano was clearly displaying the PID and browser was proving that the ghost process is up and alive!!

Starting two times firefox on different monitors

i'm using openthinclient and try to create a script that starts iceweasel in fullscreen on a machine two times on different monitors (each instance on a different monitor).
Is that even possible?
At the moment I only run
iceweasel -new-window http://stackoverflow.com -new-window http://www.google.com
So two instance are running. How can I move the windows to other monitors?
If I remember well on Fedora you can choose the display before starting a windowed app by setting the var DISPLAY:
xhost +localhost
DISPLAY=:0.0
gui-app
The first number of DISPLAY=:X.0 is the number of the display.
Try with your OS (Debian?)
The list of commands that works for me on Centos 7:
xhost +localhost
DISPLAY=:0
firefox => openned on the first monitor
DISPLAY=:1
firefox => openned on the second monitor

Start a server running with screen in a vagrant box

I'm trying to run a server automatically when my vagrant box boots.
Similar to start screen detached in a vagrant box with ssh, how?, except I'm trying to do it with a provisioning script set to run: "always".
I'm doing something like this: nohup screen -S server -mL -d bash -c 'start-my-server.sh'.
The server starts fine, and if I would have done this within the shell, I could switch to the server with screen -r server.
When I go in after with vagrant ssh, it doesn't find any screens...I'm assuming this is because its not the same shell session.
Is there anyway to get a hold of that screen session?
Edit
Forgot to mention that I had prefixed the screen command with nohup
The answer is that vagrant provision was running as a privileged user, and therefore I couldn't see the screen logging in as the vagrant user.

How to attach an running process to an existing screen in linux

I wish to debug a process which is already running using screen command.
Is there a way by which i can attach my running process with (some PID) to an existing screen (screen_name) ?
No, you can not use screen to debug a process running as daemon. If you would want to debug a process, shut off the daemon mode and run it in screen. and use
screen -rd {screen_ID}

Resources