It is possible to edit the RDP file in client side to set a specific url being launch? - rdp

Would like to ask, can we configure a RDP file in the client side to launch a specific url?
I already have a RDP file that will launch IE in the server. I would like a specific url being launch together with the IE.
I notice,the url can be added as a commandline argument in the properties of the RemoteApp.
But,it is possible for us to set the url in RDP file in the client side ? (The file can be opened as notepad correct? Can we edit there?)
Thanks a lot in advance,

RDP files are plain text. As far as I know, the full RDP file format is not documented, but as you noticed, it is rather easy to read.
The command line arguments are passed via the remoteapplicationcmdline:s: parameter.
If you change the file, you will get certificate errors unless you re-sign it with rdpsign.

Related

How to set properly QPKG_WEBUI variable in QNAP

I am trying to developing an App for QNAP. I am really noob about QNAP, so please help me!
I succeeded in creating a qpkg package and installing it correctly, and it works. But the problem arises when I want to give my app a web interface.
I have just a index.html file that just has an helloworld text inside.
I create the environment with the QDK and I have the /share/XXX_DATA/.qpkg/QDK/MyApp folder
Now, a part of the other files, I create
/share/XXX_DATA/.qpkg/QDK/MyApp/Web
and put there my index.html with my HelloWorld message.
Ok now, I modify the /share/XXX_DATA/.qpkg/QDK/MyApp/qpkg.cfg file and set the variable
QPKG_WEBUI="/MyApp/Web"
From the documentation, for example https://edhongcy.gitbooks.io/qdk-qpkg-development-kit/content/qpkg-configuration-file.html , I can see
QPKG_WEBUI
Relative path to installed application's web interface (the
specified path is relative the configured location of web server data;
usually /share/Web or /share/Qweb.) The specified path must start with
a '/'. The displayed link can only be accessed when the QPKG is
enabled. A default value of '/' is set automatically at installation
if QPKG_WEB_PORT has been given a value and QPKG_WEBUI is empty.
Then I also create a link in /share/XXX_DATA/Web folder to my web folder.
(the /share/Web is just a link to /share/XXX_DATA/Web)
That is:
ln -s /share/XXX_DATA/.qpkg/QDK/MyApp/shared/Web /share/XXX_DATA/Web/MyApp/Web
Well, what happens that now, I can open a Window in my QNAP when I click on "open" in my app but it is completely blank. I tried a lot of different variants but my window is allways blank.
Must I modify something more a part from the qpkg.cfg file?
Do you have some documentation with sample codes?
Is QPKG_WEBUI the correct variable to modify?
Thanks very much to everyone
After a carefully study of the problem, and after trying other applications with the same problem, I found the conclusion that the problem was not the QPKG_WEBUI variable.
The problem was that my QNAP web interface (I do not know if it is a general thing for every QNAP or only in my case) has as default port 8080, but the WEBUI have as default port 80.
Then it seems that the web browser blocks the WEBUI in the iframe inside the QNAP interface in order to follow the Same Origin Policy. When opened in a new window, the WEBUI works correctly.
Setting the QPKG_USE_PROXY=1 variable let the iframe work too.

How to detect that a file is being uploaded over FTP

My application is keeping watch on a set of folders where users can upload files. When a file upload is finished I have to apply a treatment, but I don't know how to detect that a file has not finish to upload.
Any way to detect if a file is not released yet by the FTP server?
There's no generic solution to this problem.
Some FTP servers lock the file being uploaded, preventing you from accessing it, while the file is still being uploaded. For example IIS FTP server does that. Most other FTP servers do not. See my answer at Prevent file from being accessed as it's being uploaded.
There are some common workarounds to the problem (originally posted in SFTP file lock mechanism, but relevant for the FTP too):
You can have the client upload a "done" file once the upload finishes. Make your automated system wait for the "done" file to appear.
You can have a dedicated "upload" folder and have the client (atomically) move the uploaded file to a "done" folder. Make your automated system look to the "done" folder only.
Have a file naming convention for files being uploaded (".filepart") and have the client (atomically) rename the file after upload to its final name. Make your automated system ignore the ".filepart" files.
See (my) article Locking files while uploading / Upload to temporary file name for an example of implementing this approach.
Also, some FTP servers have this functionality built-in. For example ProFTPD with its HiddenStores directive.
A gross hack is to periodically check for file attributes (size and time) and consider the upload finished, if the attributes have not changed for some time interval.
You can also make use of the fact that some file formats have clear end-of-the-file marker (like XML or ZIP). So you know, that the file is incomplete.
Some FTP servers allow you to configure a hook to be called, when an upload is finished. You can make use of that. For example ProFTPD has a mod_exec module (see the ExecOnCommand directive).
I use ftputil to implement this work-around:
connect to ftp server
list all files of the directory
call stat() on each file
wait N seconds
For each file: call stat() again. If result is different, then skip this file, since it was modified during the last seconds.
If stat() result is not different, then download the file.
This whole ftp-fetching is old and obsolete technology. I hope that the customer will use a modern http API the next time :-)
If you are reading files of particular extensions, then use WINSCP for File Transfer. It will create a temporary file with extension .filepart and it will turn to the actual file extension once it fully transfer the file.
I hope, it will help someone.
This is a classic problem with FTP transfers. The only mostly reliable method I've found is to send a file, then send a second short "marker" file just to tell the recipient the transfer of the first is complete. You can use a file naming convention and just check for existence of the second file.
You might get fancy and make the content of the second file a checksum of the first file. Then you could verify the first file. (You don't have the problem with the second file because you just wait until file size = checksum size).
And of course this only works if you can get the sender to send a second file.

SSH Remote access in Aptana

I have since connected to my SSH site using Putty and Filezilla. Putty and Filezilla give me direct access to the appropriate directories and Filezilla gives me a full path from the top level directory. I have then tried the same path from the starting point in Aptana, but get blocked one level above my target directory. If I collapse all the directories in Putty and Filezilla and try to expand again, Putty works fine, but Filezilla then blocs at the same point as Aptana. So there is some subtle difference in approach between Filezilla and Aptana and Putty.
I was looking for a way to get an encryted link when editing files on my hosted webserver when using Aptana Studio. I can get an ordinary Remote FTP link set up and use that to edit files. The SSH facility looked as though it could do a secure link, so got the SSH details off my ISP and set up in Studio. In the setup I was asked to select a directory, but the ones available were all system directories rather than my htdocs tree. However by leaving out the default provided /, I could get to the htdocs tree and see all my files under remote. However when I try to load a file to Studio, I get a file does not exist message.
I'm new to SSH (and Studio) and don't know whether what I am trying to do is not possible or there is something else I need to set up. So far I have just been using Studio as a remote editor for PHP and HTML. I suspect there is a much better and professional way to set up what I am doing under Studio (even ignoring the secure transfer) as I am currently doing separate backup of the files in Filezilla, but just haven't figured out the way to set everything up yet.
Many thanks for any help.
Actually I'd like to post this as a comment to your question, but I'm pretty new here, so the system doesn't allow me to.
Anyway. You can add connections to remote servers over ssh like this:
If you don't have the remote tab go to Window -> Show View -> Remote
Rightclick in the remote tab and click "Add New FTP Site..."
Change the Protocol to SFTP and put in your credentials (you can use Username/Password or Username/Private Key authentification)
When you close Aptana with files still opened, it usually show you those files when you reopen Aptana later. It seams not to do this when you work with files of a SFTP remote host and shows you an error instead. I guess this is because it tries to validate those files (if they still exists) but doesn't authenticate with the remote host first. So nothing to worry there.
Hope this helps.

Server side: detecting if a user is downloading (save as...) or visualizing a file in the browser

I'm writing an apache2 module
by default and when viewed in a web browser, the module would only print the first lines of a large file and convert them to HTML.
if the user choose to 'download as...', the whole raw file would be downloaded.
Is it possible to detect this choice on the server side ? (for example is there a specific http header set ?).
note: I would like to avoid any parameter in the GET url (e.g: "http://example.org/file?mode=raw" )
Pierre
added my own answer to close the question: as said #alexeyten there is no difference. I ended by a javascript code the alter the index.html file generated by apache.

How to change permissions on ftp file in rebol?

What's the function's name to change this permission on ftp file (ftp software can do it so I guess Rebol can too)?
FTP has two ports open, one for commands and one for data transfer. Since you only want to issue a command, then you don't need to use ftp, but can use the telnet protocol.
The ftp protocol in Rebol2 does not support site specific commands such as chmod. However, I have written my own ftp protocol for Rebol3, ( see http://github.com/gchiu/Rebol3/tree/master/protocols/ ), and it looks like it is only a few lines to add the SITE command.
The REBOL function for changing file permissions is set-modes.
However, that is enabled only for local files -- so no equivalent of chmod for remote files using FTP.
This thread suggests it may be possible to modify REBOL's FTP scheme to make it possible....
http://www.rebol.org/ml-display-thread.r?m=rmlSWGQ
....But, as far as I know, no one has.