Using linux wget to grab data from windows box - linux

I need to get the data from Windows box and store it on my linux box using wget.
#!/bin/sh
#
user="vim1"
pass="pass11"
host="10.20.15.124"
#from this folder
localbase="C:/Users/i1/Desktop/datafolder"
remotebase="/home/myfolder"
wget_opts="-q"
When I run
wget --user=vim1 --password='pass11' 10.20.15.124
it does nothing. Just says
Connecting to 10.20.15.124:80...
Can someone tell me why?

As already commented, if you don't have an HTTP or FTP server up and running on your Windows box you will have problems connecting to it through internet. Until you have resolved that, a relatively fast way to transfer your files would be through sneakernet if you have physical access to the Windows box.

As pointed out by #n.m. and #htor, you need to have an HTTP server running on your Windows machine to be able to connect this way. What you can do is use Samba to mount a shared folder from your Windows box on your Linux box and copy the files to a local folder on your Linux box (google buzzword: smbmount).

If by any lucky accident you have Python on your source machine, then you can use the preinstalled SimpleHTTPServer module to serve your file over HTTP. Go to the folder with your file and run
python -m SimpleHTTPServer
or if you have Python 3
python3 -m http.server
And then on your Linux machine use
wget http://<source-machine-IP>:8000/<filename>
The module allows to specify an optional PORT parameter, if the default 8000 port is not suitable for you.

Related

How to I get to my desktop when using "python3 -m http.server 8080"?

I am running a Windows Subsystem for Linux on my Win10 machine. I have another VM machine that is a windows7. When I access the localhost:8080 I want it to open to my desktop or just load my documents, music, downloads, desktop, pictures folders. Pretty much I am stuck because I do not know how to navigate to my desktop because all I see is
directory listing
I want to be able to see documents, music, downloads, desktop, pictures folders, etc. I know there is a way to dd it but I forgot how.
I don't do windows, but you need to find the c:\ or where ever the directories you're hoping to see in your shell, and start the python3 -m http.server 8080 from there.
Edit:
Did some poking, you can cd /mnt/c/Users/<USERNAME> and start python from there ...

windows subsystem Linux cannot find files in the terminal

When using window 10 system.
I have assessed the home directory of the WSL and manually move a python file into the following address
C:\Users\assa8\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\lxr\demo
However, the python file did not show up when I use the 'ls' command in the Linux terminal and I also could not run it using command lines. It appears the file did not exist when I tried to access it through the terminal.
How can I fix it?
Thanks
If you are using WSL1 then the recommendations are to not under any situations edit or modify any Linux files inside of your %LOCALAPPDATA% folder using Windows apps or tools which includes moving files using file explorer. See this blog post from Microsoft https://devblogs.microsoft.com/commandline/do-not-change-linux-files-using-windows-apps-and-tools/
If you are Using WSL2 that is a slightly different issue of which i cant help you right now as i am still using WSL1
You should do your dev work in the /mnt/c/ sub folders in WSL which will allow you to easily edit those same files on windows. Personally I work in a folder c:\projects\ which is mapped to /mnt/c/projects/ in WSL.

xcopy, net use not working from Linux machine

I am trying to copy files from windows server to network shared folder via VPN . Here is my code from batch file. This is working fine without any issues.
net use \\servername\test_folder password /user:user_name
xcopy C:\Apache\htdocs\arul\xias \\servername\\test_folder
But when I try to run this from Linux machine it is not working. This Linux machine is also connected to network shared folder via VPN. So I tried below on Linux machine in .sh file.
net use \\servername\test_folder password /user:user_name
cp C:\Apache\htdocs\arul\xias \\servername\\test_folder
I am getting errors like net command is not found and cp: -r not specified;
How to achieve this from Linux machine ?
The commands "net use" and "xcopy" are specific to Windows and will newer work on linux.
You should use some smb specific commands instead (of course, the kernel must support them).

How to export DISPLAY onto another linux host's Xserver

I use Xming for running Xserver on windows machine and that works just fine.
export DISPLAY=<windows_host_IPAddr>:0.0
But I want to export display onto another linux host.
export DISPLAY=<linux_host_IPAddr>:0.0
I am running opensuse and I think Xorg should do the job. But I could not figure out what exactly needs to be done.
If there are any other Xming equivalent packages for linux, please let me know. Thanks in advance.
The only thing you have to do is to enable remote X sessions on your SuSe box. So, login at the desktop, open a shell, and type:
xhost +<IP_address_of_server>
Where IP_address_of_server is the address of the machine where you are starting your actual program (so you allow incoming X connections).
However, this is not very secure, so a better option may be to use SSH and X-forwarding. Again, on your SuSe box, open a terminal and type
ssh -X <account>#<IP_address_of_server>
Then, in the ssh session start your X program without any DISPLAY options, and the output should appear on your local desktop.
In case you have trouble with the -X option, you may try the -Y one, but see the manual page of ssh for details.

What is the command line to run arangodb (arangod.exe) 1.2.0 on windows?

It demands --server.endpoint option, but nothing I give it works. Has anyone ever run this database on Windows?
I've done the following: Downloaded and installed "arango64.msi" into a directory "c:\Users\fceller\ArangoDB" under Windows 8. Switched into this directory and executed "shellExample.bat". This starts the server and you can access it via the browser under "localhost:8529".
As for the server.endpoint option: It either supports tcp or unix domain sockets (presumably not under Windows). For TCP the syntax is
tcp://127.0.0.1:8529

Resources