VSCode SSH connection can't see the program but remote terminal can - vscode-remote

I work on an HPC cluster. I added my cluster .bashrc ml load git.2.foobar. When I connect to the host on VSCode, it tells me to update my git1.8.
But when I open a terminal on Vscode, git --version returns the one on bashrc.
What is going on?
Thanks!
I also tried adding the ml command to .bash_profile, which didn't fix the issue. I also closed and reopended the host connection to re-source it.

Related

Can't open PID file /var/run/teamviewerd.pid (yet?) after start: No such file or directory

I have installed and configured and also used TV the first time today in Nvidia jetson Xavier,
but after restart Im getting this issue:
teamviewerd.service: Can't open PID file /var/run/teamviewerd.pid (yet?) after start: No such file or directory
Please tell me why and how to fix it, it is of extreme importance !
I use TeamViewer to connect to a machine (Ubuntu 20.04) that not always have a graphical user session started and I noticed that even with teamviewerd running the machine is offline.
I fixed the problem running:
sudo teamviewer setup
From teamviewer --help:
teamviewer setup Configure headless modes (non-gui/console)
Without running this, the only way for me was to start manually a graphical user session and open the TeamViewer GUI on the host I wanted to use.
Make sure you enable/start gdm.service or another supported login manager
Found this question via a search when facing the same issue on Fedora 30 x86_64.
Solution for me was to edit /etc/systemd/system/teamviewerd.service and comment out the line that says:
PIDFile = /run/teamviewerd.pid
So it reads:
# PIDFile = /run/teamviewerd.pid
(or whatever PIDFile it specifies)
then run:
systemctl daemon-reload
systemctl start teamviewerd
systemctl status teamviewerd

VSCode Remote SSH to Linux - Connecting was canceled

I am trying to connect from my Windows 10 machine to my Ubuntu Linux server (16.04.6) using Remote SSH.
To do this I've read many different tutorials but have no success.
I am able to connect from my Windows 10 command prompt to the Ubuntu Linux server via ssh without any problems. I even used ssh-keygen to generate a private and a public key and copied the public key to the appropriate directory on the Linux Server (.ssh).
In VsCode I installed the extension Remote-SSH added my host to my configuration file c:\user.ssh\config:
Host <ip-address>
HostName <ip-address>
User <username>
Then I clicked in VSCode the button bottom left "Open a remote Window" and chosed my host. A new windows opens and VSCode is trying to connect. Then I see a window with the error message: "Could not establish connection to . Connection was canceled". This is the log.
[11:53:17.573] Log Level: 2
[11:53:17.582] remote-ssh#0.51.0
[11:53:17.583] win32 x64
[11:53:17.586] SSH Resolver called for "ssh-remote+<ip-address>", attempt 1
[11:53:17.587] SSH Resolver called for host: <ip-address>
[11:53:17.587] Setting up SSH remote "<ip-address>"
[11:53:17.648] Using commit id "5763d909d5f12fe19f215cbfdd29a91c0fa9208a" and quality "stable" for server
[11:53:17.650] Install and start server if needed
[11:53:18.624] getPlatformForHost was canceled
[11:53:18.625] Resolver error: Connecting was canceled
[11:53:18.640] ------
Again, I can connect to the same linux server via ssh from my local machine (Win 10) without any problems.
I've resolved the connection issues; possibly the ssh config was not correctly saved/accessed by VS Code?
I thought I should be able to directly set it up to point to an existing config file, but that didn't seem to work. Instead, I created a new config file in the UI, and over-wrote the contents. Shouldn't be necessary, but seemed to do the trick.
What I did was:
Add new host: => Remote-SSH: Connect to host... => Add New SSH Host...
Type in command: ssh user#host to attempt to connect
Choose platform in the command bar in the new window (Linux in my case)
Verify connected (I needed to change ssh-agent settings to store credentials)
Edit the config location: => Remote-SSH: Connect to host... => Settings
Enter config file under Remote.SSH: Config File (C:\Users\me\.vagrant\machines\default\virtualbox\config in my case)
Modify config file further, as needed
Connect through the UI: Remote-SSH: Connect to host... =>
Hope that helps!
For me it was not starting necessary SSH*. See status services using:
Get-Service SSH* on PowerShell.
I got a time out error on enabling necessary services and this helped.
A colleague of mine was with this problem. We solved just deleting his %USERPROFILE\.ssh\config file, closing VSCode, reopening it, and trying to connect again.
There was some garbage in his ssh config file.
I also found that if the value of the "Host" field includes a ")" character, then there will be an error message as follows and the VSCode keeps trying opening remote:
The terminal process "C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\xxxxx_xxxxx\AppData\Local\Temp\vscode-linux-multi-line-command--ccton_---_---2-705401992.sh" | ssh -T -L 127.0.0.1:53080:/run/user/1000/vscode-ssh-remote-server-sock-1636523090 Accton_AWS_EC)2 bash) & exit /b 0" terminated with exit code: 1.
I tried the following that worked for me:
Click on View > Command Palette (alternatively press CTRL + Shift + P)
Start typing:
Remote SSH: Kill
Click on the first option that says: Remote-SSH: kill VS Code Server on Host...
From the options, click on the server you are having trouble connecting to. This will kill that VScode server.
Now just try to reconnect:
a. View > Command Palette (alternatively press CTRL + Shift + P)
b. Start typing:
SSH Remote-SSH: Connect to host...
c. Select the server.
Adding my 2 cents here, I too had lots of trouble connecting to a remote using "Remote SSH Extension of Microsoft". Unfortunately, no luck and spent a lot of time trying all ways possible.
I found another extension named "SSH Client" by cweijan. It was easy and I was able to access my remote using it.
When I had this issue it was because the extension was complaining that the pem file permissions were too open, it should be accessible just by my current user.
Yes, I would like to ~ add on top of Shivam Popat's answer.
Configure F1 ssh.add and Option to add client, and password appears.
Now, connect, and save.
From the left pane you would see icon of key. and upon clicking it will open the remote folders.
The previous problem with VScode remote SSH resolved.

HTTP Server: Connection closed by foreign host

Attempting to get this HTTP webserver I found online running after downloading their source files (source: Webserver). [Files located at bottom of webpage.]
I attempted to compile it using their Makefile but there were some errors, where I just needed to #include some extra libraries. However, once I got that compiled and running (tested using telnet)
telnet localhost <port number>
I get the following:
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Then after 5 seconds or so it displays the following:
Connection closed by foreign host.
I'm not sure if the person who wrote it is still managing it so I figured I'd ask here. Any ideas as to why connection closes?
I'm running this on a Windows machine connected to a Unix server, so as the program site states, it should be running correctly on Unix machines.
in the file: reqhead.c
in the function: Get_Request()
There is a timed call to select()
You can change the timeout value (currently 5 seconds)
or replace the timeout parameter with a NULL parameter (although replacing with NULL would mean the code, once a connection is established would wait forever.)
First we will see ubuntu system log with this command
sudo gedit /var/log/syslog
and if you will see this error "execv( /usr/sbin/tcpd ) failed: No such file or directory"
then run this command
sudo apt-get install tcpd
It will solve your problem (if not then you need to search your system error on google)

Opendaylight (odl) ovs-vsctl not found error

I am following this tutorial: https://wiki.opendaylight.org/view/Getting_started
I am trying to use the following code in opendaylight using karaf
ovs-vsctl show
But the command window says Command not found: ovs-vsctl
I have installed all the necessary libraries and the local host server (http://localhost:8181/dlux/index.html) is running fine. But somehow odl can't find ovs.
Can anyone tell me what's the error? I am running win 8.
Thank you
You need to run this command outside of karaf terminal.
Firstly, you should have ovs(Open Virtual Switch) or Mininet installed, and then create one or two open switches.
Basically, you started the SDN controller in karaf, and now in the step you are encountering problem, the switches need to be assigned ODL controller as their manager.
You must check also that ovsdb is already installed in karaf.
For that, try to execute the next command:
feature:list | grep ovsdb
That command will display all the ovsdb components/features that are available in your karaf distribution. The third column will indicate you if a given component is already installed or not (if you see an X, that means that the component is installed). If you want to install a component/feature:
feature:install <name_of_the_feature>
After that, try to execute it outside of karaf, as Sidhant01 has indicated you before.
Try to do it with sudo:
sudo ovs-vsctl show.
If you want to configure ovsdb in an active mode:
tools-vm:~$ sudo ovs-vsctl set-manager tcp:127.0.0.1:6640
tools-vm:~$ sudo ovs-vsctl show
98d8cf7a-44b1-4b02-a60c-7d832409d06f
Manager "tcp:127.0.0.1:6640"
is_connected: true
ovs_version: "2.0.2"
Cheers

unable to attach client process to postgresql server using gdb

I am working with PostgreSQL 9.3.4 source using Eclipse IDE in ubuntu 14.04. I am facing a problem in attaching client process to postgresql server using gdb to debug. When I start the postmaster then I connect to it from client on a terminal. It works fine. Queries get responses. When I run debug config from eclipse then select postgres process id from list I get error saying
Can't find a source file at "/build/buildd/eglibc-2.19/socket/../sysdeps/unix/sysv/linux/x86_64/recv.c"
Locate the file or edit the source lookup path to include its location.
After this when I send any query from client, it just stucks. No response comes. After attaching gdb to client process, client does not get any response from postgres server. One thing to note is that I was able to debug properly till yesterday. But now it is not working. I tried reinstalling but did not help. How could I fix this issue? Kindly help.
solution which worked for me:
./configure --prefix=$HOME/project --enable-depend --enable-cassert --enable-debug
in eclipse: Make Target: install
attach client process to application

Resources