How To download a file from webserver to your computer? - webserver

I'm back connected with a Freebsd server [netcat ] And There is a File On /tmp That i want to download it but
Its can't be browsed with My Browser So there is any ways to download it ?
because i don't have access to others folders . Just /tmp

You can use fetch(1)
eg. fetch https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
or download wget with
pkg install wget
and use wget
eg. wget https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js

If you have an account on the server and the ssh daemon is running you can use scp. From a terminal emulator (e.g. xterm) you can do % scp freebsd.server.org:/tmp/file .. Of course replace freebsd.server.org with the correct name of the host.
If you're on windows, you could also use a graphical program such as Winscp.

If you have SSH installed on the server, you can use any SSH client out there. For Windows, WinSCP is a good option but if you run *nix OS with Gnome, Nautilus can do the same natively.

Related

code tunnel -h doesn't list options and doesn't open a tunnel to WSL

I'm following the guide
and I am noticing that code tunnel -h in a ubuntu terminal window just launches the code UI.
Using the command palette to get the URI results in a tunnel to my Windows version of VSCode rather than the WSL:ubuntu (which is the one I care about)
How do I fix this?
It appears that, for now, you need to manually install the CLI in WSL in order for it to work. The downloads can be found here. Since you are on Windows, I would recommend the x64 CLI download. When you extract the tar.gz file, you will get a file named code. I would recommend moving it to your home directory for ease. To open the tunnel, run ./code tunnel (from wherever you put the code file) to force the new CLI. If you use code tunnel it will still use the Windows version.
Source: https://github.com/microsoft/vscode/issues/171196

vscode remote extension to locate manual server installation

I have unpacked and installed vscode server on my server using:
wget https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
and unpacked the tar file into ~/.vscode/bin/${commit_id}
Now I'm trying to log in into my remote using the vscode extension, but the extension keeps on trying to download and install the remote server. The extension is not able to recognize that code-server is already installed in the server. Is there a way to hack this problem ?

Open remote folder in local VSCode like "code ."in WSL2

Is it possible to use $ code . in remote server ssh session just like I do in WSL when I want to open current working directory in remote host in local VSCode?
ADDENDUM:
In local WSL, I can issue $ code . and that would open the current directory in VSCode which is installed on Windows 10.
I am trying to get the same behavior in another remote Linux which I have connected to remotely through ssh. So when I am on that remote machine and issue $ code . it would open that directory in VSCode installed on local window.
I don't imagine this would be simple to do but I certainly share your desire to want to be able to do it.
Problem
Here's an explanation of why it doesn't work, and a hint at why it's probably quite a difficult thing to setup:
The way code . works from WSL (or PowerShell) is by launching VS Code in the given directory (passed as the first argument as the dot).
When you run code from WSL it uses wslpath to convert the path to the Windows accessible one, and the WSL magic executes code.exe (which is, after all, a Windows binary and not a Linux one) in Windows with the WSL path (\\wsl$...);
Theory
In order for this to work you need to achieve three things:
Work out which remote you're connected to, and be able to pass that information to vscode
Execute code.exe on your local machine, but from your remote terminal
Ideas
A couple of ideas you could play with if you wanted to try and implement it:
A script on your remote could output a vscode:// URL for you to click (or find a way to get your client to auto-load it).
You might be able to use a forwarded port in your SSH session to contact something on your PC (perhaps custom made, or maybe with Windows RDP or a telnet/ssh server perhaps?)
Perhaps mount a local directory as part of your SSH connection (I don't know all the edges of SSH but it does a lot of cool stuff! SCP might help?) and be able to execute/trigger things?
Just some musings! It's not something I need enough to put any effort into it, but I came across your question looking for something else and found it interesting. Hope that's helpful to anybody, any thoughts/feedback is welcome!

Netbeans can't add remote host running on Virtualbox

I installed Ubuntu Server 15 on VirtualBox 5.0.10 and set up ssh access to the guest using NAT/port forwarding (host:3022->guest:22). The host is Windows 7 64bit.
I can successfully access the Ubuntu server via putty or other ssh client from an external computer (not the host). But NetBeans 8.0.2 can't complete adding the remote host. It just freezes on "Connecting ip_addr:3022..." stage (authentication type is 'Password')
What can be the reason? How can I resolve it?
It seems like the reason is that com-jcraft-jsch.jar distributed with NetBeans 8.0.2 doesn't work with OpenSSH 6.9 distributed with Ubuntu 15. There is a workaround for this, but unfortunately it doesn't work with OpenSSH 6.9.
I was able to resolve the issue after I downloaded and built OpenSSH-5.4 (requires zlib-dev, libssl-dev and some other packages). To use existant ssh config files you need to configure OpenSSH properly before build:
./configure --sysconfdir=/etc/ssh
make
sudo make install
Please note that make install will install binaries in /usr/local/bin, configuration files in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different installation prefix, use the --prefix option to configure.
You may need to modify /etc/ssh/sshd_config file (at least to point to sftp-server) and you may want to modify /etc/init.d/ssh, but anyway, OpenSSH-5.4 does work with NetBeans 8.0.2.
UPD: NetBeans 8.0.2 also works correctly with OpenSSH 6.6.1

finding files on android os

There is no utilites like find, grep , "ls -laR" to find files in Android os. IS there a way or is there a list of current default files in the os file system hierarchy?
Make a local copy of the files using adb pull /system system; adb pull /data data and use your favorite tools to search on your development machine. Or you can install BusyBox on the emulator, which gives you something intermediate between the extremely limited built-in command line and a full unix command line.