Downloading a file created from console output in PuTTY - putty

So my class Project3 prints a load of data to the console of PuTTY when I run it, and I've used "java Project3 > variance.data" to create the file variance.data in the pwd.
I think this has worked because when i use "ls" variance.data is there.
However I want to save this file onto my computer, how do I do this?

You can use PuTTy Secure Copy to download the file.
Open CMD on your Windows machine and use the following command:
pscp <user>#<Remote Server IP>:/path/to/file .
You will then be prompted for the password of the user you are trying to connect as.

You can use FileZilla to connect to the server with your credential (the one you use with PuTTY) and then download the file you need only double-clicking on it. In the image you'll fine it in the 5th rectangle. At the same way, you can easily upload a file double-clicking on in the 4th rectangle.

Related

How to run windows batch file containing OpenSSL encrypt file command from a Windows Service application

We would like to make some Postgres databases backups from a windows service application, using OpenSSL app to encrypt those files. To accomplish that we use a batch file, containing that command lines. If we do it in two steps, first we make the backup file and after that we want to encrypt it or even when we include in Postgres "pg_dump" instructions it doesn't work, I presume because the service app is running as SYSTEM. If I run the same application as desktop mode it works fine.
Is there any workaround that can help us to do that?
Thank you. Regards.

Copy data/File from Windows to Linux machine or HDFS

I am working on Big data and want to fetch data/files from a file system present in remote machine not from any databases i.e to copy files from remote linux / windows machine to hdfs. Please help me.
You can copy file from your local file to a remote file system and vice versa by using
scp commands
scp [Options] [[User#]From_Host:]Source_File [[User#]To_Host:][Destination_File]
Try to install Hue. It's a very useful tool for this.
Follow this link for more details : http://gethue.com/
Enter into the File Browser in Hue, and click on "Add files" button then you can upload your files into HDFS

How to download a file using command line

I need to download the following file using the command line to my remote computer:
download link
The point is that if I use wget of curl, I just get a html document. but, if I enter this address in my browser (on my laptop), it simply starts downloading.
Now, my question is that since the only way to access my remote machine is through command line, how I can download it directly on that machine using the command line?
Thanks
Assuming that you are using a linux terminal.
You can use a command line browser like Lynx to click on links and download files.
The link provided by you isn't a normal file link, this link sends the filename as a GET variable, another page with form is sent by server as a response to this request. So wget, cURL will not work.
That website likely tracking session and checks if you've submitted the data & confirmed you're not a robot
Try different approach: copy it from your machine to remote via scp:
scp /localpath/to/file username#remotehost.com:/path/to/destination
Alternatively, you may export cookies from your local machine to remote and then pass them to wget with ‘--load-cookies file’ option, but can't guarantee it will work 100% if site also tracks session ID to IP
Here's Firefox extension for exporting cookies:
https://addons.mozilla.org/en-US/firefox/addon/export-cookies/
Once you have cookies.txt file just scp it to remote machine and run wget with '--load-cookies file' option
One of the authors of the corpus here.
As pointed out by a friend of mine, this tool solves all the problems.
https://addons.mozilla.org/en-GB/firefox/addon/cliget/
After installation you just click the download link and copy the generated command to the remote machine. Just tried it, works perfectly. We should put that info on the download page.

Mount an FTP server locally

I do a lot of work with files hosted on an FTP server. Currently to edit a file on the server I have to open the server in Cyberduck, navigate with the mouse to the folder I want and then click "Edit," which opens a temporary file. Anyway, editing files on the server would be way easier if I could use the terminal to navigate through the file directory and edit files. Is there a way to create a symbolic link in my home directory to an FTP server?
edit: I'm on a Mac
If your using linux you can mount an ftp site with curlftpfs. Check out this tutorial: Ubuntu Geeks Curlftpfs
If you are on windows you can use NetDrive:
NetDrive.Net
With either of these you can create links/shortcuts to your hearts content.

error when i want to save java file in jdk/bin

when i save java file error is you dont have permission to save in this location contact the administrator to obtain permission on window7
Don't store application data in the "Program Files" directory.
It is very bad design and regular users don't have write access to that directory (for a very good reason).
So even if you changed your settings locally to open up the door for viruses your application won't run on other computers.
Besides: storing a Java file in the JDK directory serves no purpose at all.
Btw: your uppercase letters are broken, as well as the dot or the comma...
That's normal - jdk/bin is the installation directory of the JDK, regular users cannot (and should not) write files there. You'll have the same problem on Linux/Unix and on Mac OS X, where installation directories are off-limits to regular users.
Write your files to the users home directory (System property "user.home", works across platforms), or let the user choose where you save stuff.
Bin directory do not allow directly to save program in it.
it is so simple, just save your .java file on desktop and then copy paste it in Bin. done ;)
If the file can't save directly to c:\program files\java\jdk1.8.0\bin\
Solution:-
Click start Menu type Notepad command in run run as administrator
Right click the Notepad run as Administrator, then type the program file can save directly to c:\program files\java\jdk1.8.0\bin\
Just try it......

Resources