What is the simplest way to run a go server in the background?
I currently have the server running in CMD and would rather not change the actual code.
I'd use a screen. Assuming Ubuntu 18.04:
sudo apt-get install screen
Then
screen
Then
go run main.go
Use Ctrl + A + D to get out of the screen. To return to it:
screen -r
Related
I have created the VM using GCP Console in browser.
While creating VM, I selected the VM Image as "c2-deeplearning-pytorch-1-8-cu110-v20210619-debian-10". Also, I selected GPU as T4.
VM gets created and started and it shows green icon in browser.
Then I try to connect from "gcloud compute ssh " and it asks if I want to install nVidia Driver and I do Y, then it gives error for lock file and driver is not installed as:
This VM requires Nvidia drivers to function correctly. Installation
takes ~1 minute. Would you like to install the Nvidia driver? [y/n] y
Installing Nvidia driver. install linux headers:
linux-headers-4.19.0-16-cloud-amd64 E: dpkg was interrupted, you must
manually run 'sudo dpkg --configure -a' to correct the problem.
Nvidia driver installed.
I try to verify if driver is installed by running python code as:
import torch
torch.cuda.is_available() #returns False.
Anybody else faced this issue?
This is the correct way to install NVIDIA driver on a GCP instance:
cd /
sudo apt purge nvidia-*
Reboot
cd /
sudo wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
sudo sh cuda_11.2.2_460.32.03_linux.run
Adjust your config accordingly as it pops options in the terminal
Reboot
Solution to my problem was:
Run manually : sudo dpkg --configure -a
Disconnect from machine.
Connect again using SSH. Select Y again when asked to install nVidia Driver.
It works then.
Make sure you are running as root. I know this sounds silly, but if you use their notebook instances the default user is not root and if you try to ssh into the instance and run something like gpustat etc or run custom code, you might get errors like NVIDIA drivers are not loaded or such.
If you make sure your user (which is called jupyter in the default case) is in the sudoers then all will work fine.
It is often very complicated to install or reinstall GPU drivers on GCP instances. Make sure you actually need to reinstall before you attempt other solutions.
This is now the third or fourth time that this has happened in the last couple of weeks: When I launch Postman all I get is a blank screen:
The only way to get around this that I have found is to reboot my workstation, which is of course a PITA.
I am using Ubuntu 18.04.4 LTS, 7.20.0.
Any fixes, workarounds etc are welcomed.
I had same problem on my linux machine. Simply run the following on your terminal until they both tell you no more process to kill.
killall Postman
killall _Postman
I started facing this issue on updating to version - v8.2.3,
Try below approach, which worked for me..
Step 1: Add windows environment variable: POSTMAN_DISABLE_GPU, with the value: true
Step 2: From the same blank screen open a New Postman Window (File -> New Postman Window)
None of these worked for me, I had to go to "System Monitor" and kill a load of processes with names like "postman --no-sandbox", "postman --type=zygote".
Expanding on the previous answer, I put a script together that performs the loop as many times as needed to get Postman working again:
#!/bin/bash
OUTPUT=$(killall Postman 2>&1)
while [ "$OUTPUT" != "Postman: no process found" ]; do
OUTPUT=$(killall Postman 2>&1)
done
OUTPUT=$(killall _Postman 2>&1)
while [ "$OUTPUT" != "_Postman: no process found" ]; do
OUTPUT=$(killall _Postman 2>&1)
done
Make sure you set the permission for the file correctly so you can execute it:
chmod 700 kill_all_postman_procs.sh
To run it:
./kill_all_postman_procs.sh or may you need to do sudo ./kill_all_postman_procs.sh
It's all about GPU driver and setting, it may happen when you don't force disable that setting and running on dual monitor.
On windows 10, to disable it you can disable it from gpu control panel, POSTMAN_DISABLE_GPU, or try to run postman before plugging the 2nd monitor
FOr all options listed above failed to work. My os is Ubuntu 18. The only solution was to install a version that worked. Before you install this version uninstall the currently installed afterwards install this snap version
snap install --channel=v7/stable postman
If you have this specific version installed. run the following
snap refresh --channel=v7/stable postman
This issue came up overnight for me. I resolved this issue by just reinstalling Postman. It kept all my settings and collections. You might like this quick way instead of fiddling with settings.
According to this - https://github.com/postmanlabs/postman-app-support/issues/9193 and figuring out that issue is not fixed for 2 years, I recommend switching to another tool, like advanced rest client from google.
I am connecting my windows 7 computer to a linux based cluster using cygwin. Within a specific node in the cluster I want to launch the anaconda spyder gui.
to launch spyder you simply type:
spyder into cygwin
but that returns:
QXcbConnection: Could not connect to display
Aborted (core dumped)
I also tried:
QTA_QPA_PLATFORM=offscreen spyder
but that returns:
QFontDatabase: Cannot find font directory /home/spotter/anaconda2/lib/fonts - is Qt installed correctly?
I installed qt4 dev-tools but it didn't change anything
EDIT:
I installed xinit and xorg and now I try this:
before logging in with ssh i run:
export DISPLAY=localhost:0.0
then I login using ssh:
ssh -Y -X usrname#machine
and now when I try to use spyder I get:
connect localhost port 6000: Connection refused
QXcbConnection: Could not connect to display localhost:11.0
So it sounds like you are running Cygwin on your local Windows machine, logging into a remote server with ssh, and running spyder from that machine with the intent of having it show up on your local screen. Now that you have startx working, you are close to a solution.
Between steps 5 and 6, you need to run the export DISPLAY command on the remote machine and set it to the name of your local computer. You will need to know your hostname for this. The steps will look like this:
startx
ssh -Y -X username#machine
export DISPLAY=win-machine-name:0.0
spyder
The last two commands are executed on the remote machine. I just made up the win-machine-name. In its place, you will put the IP address or machine name of your windows machine. That is how you tell set the DISPLAY environment variable on the remote machine, so X clients know where to send the graphics commands.
Hope this helps!
For me what I did was:
Install packages associated with startx
Change the sshd_config file to allow X11 forwarding
export DISPLAY=localhost:0.0
startx
login with ssh -Y -X username#machine
spyder
i am doing project in virtualbox. i have a client and server code in c++. i want server code to be integrated with virtualbox source code. client is sending cd image to server and cd image is diaplayed as virtual cdrom in guest os. i am trying to integrate this cd image with virtual cdrom part of vbox. but i dont know where to integrate this such that while running guest os, cd appears in it. it should NOT BE DONE MANUALLY. dont know where to put this cd image such that it will apperas in guest os. it would be a great help if u sort out this problem .
Simplest, your server can run the shell command VBoxManage storageattach to eject or attach cdrom images to a virtualbox guest.
I'd like not to be disturbed by the browser that is launched by Selenium RC. Is there any way how to force it to run the browser on another X11 desktop? Running Selenuim server on another desktop does not solve the problem.
Vít Šesták 'v6ak'
Yes, on Linux you can start for example Xvfb (X in a virtual framebuffer) to provide an X environment and launch the selenium controlled browser in that.
We are doing that for years on headless server boxes and that work just fine (well from time to time you have to shoot a hanging browser, but that is the same on a desktop).
First install Xvfb:
sudo apt-get install xvfb
Then start selenium server in background via xvfb:
xvfb-run java -jar ~/Downloads/selenium-server-standalone-2.45.0.jar
Finally run your tests as usual (phpunit, or whatever you are using).
You should be able to do this by setting the DISPLAY environment variable to a different display than the one your desktop is using. This must be set when starting up the Selenium server. Selenium will then use this value when starting up the browsers.
I solved this using workspaces/viewports not X using devilspie.
This addon lets you put a custom title on firefox, I installed it on my selenium profile:
https://addons.mozilla.org/en-US/firefox/addon/57/
I replaced Mozilla Firefox in the titlebar with FFSELENIUM
Then use devilspie to pin those windows to firefox:
http://ubuntu-tutorials.com/2007/07/25/how-to-set-default-workspace-size-and-window-effects-in-gnome/ http://foosel.org/linux/devilspie
Then create a file .devilspie/selenium.ds with the contents:
(if
(and
(contains (window_name) "FFSELENIUM")
)
(begin
(set_viewport 3)
)
)
Woot firefox windows in the third viewport!