Windows installation through http URL - http

We have created a http URL and stored the windows setup files. Our requirements is to execute this setup files through HTTP.
we tried with command CURL http://192.168.2.20/win2k12/setup.exe but it shows only the ASCII characters.
Also is it possible to execute the .exe files through wget?
Can anyone help us how to execute the setup.exe file from command prompt?

Related

Download code from GCloud VM instance with expired RStudio Server license

I had created a Google compute engine (virtual machine) instance with RStudio Server being unaware that RStudio Server is a licensed software. Now, my trial license for RStudio has expired, and I cannot login to my R sessions anymore.
However, I had written some code which I need to recover. How do I download the files?
I have SSH-ed into my virtual machine but cannot find the relevant files or a way to download them.
I had a similar issue and I was able to recover the files by performing the following steps:
SSH to the virtual machine
Once you are in the virtual machine run the following command: cd ../rstudio-user/
Now ls there you will see the file structure you used to see in the RStudio Server interface}
Navigate using cd and ls between the folders to get to the desired file
Once you are in the desired location (where with an ls you can see the files you want to recover) run the following command: pwd
Click on the Engine and go to download file
Enter the full path of the file you want to download, it will be something like: /home/rstudio-user/FILENAME.R
Click on Download
You can do this for each of the files you want to recover.
In case you want to recover a full folder its easier to compress to a zip file and then to download it.

Downloading Ngrok on Mac

So i downloaded Ngrok on my windows machine it was pretty straight forward unzipping and running.
Now I want to run it on my mac I am faced with all sorts of problems.
I downloaded Ngrok from ngrok.com
However it doesn't seem to download as a zip file?
This is where my Ngrok is kept
/Users/Jay/Downloads
What do i have to type in my terminal in order to get this to work? It doesn't seem to be zipped as mentioned.
Any help will be greatly appreciated.
When using ngrok on Mac, be sure you're running the command from the directory where the ngrok binary resides.
So for your installation, you downloaded ngrok to /Users/Jay/Downloads, so the binary is probably in a directory called /Users/Jay/Downloads/ngrok/bin.
You can use ./ngrok help to test that this works.
So the command to try this from a terminal might look like this:
./Users/Jay/Downloads/ngrok/bin/ngrok help
Or cd directly into that /bin directory and try ./ngrok help from there.
Note that the initial period/full-stop (".") is needed.
Also, do yourself a favor by adding it to your root directory so you can just call the command from a new shell with just ./ngrok help.

Move zip file with today's date (like ABC_20161010_DEF.zip) from Linux server to Windows server using sftp

I am using below code to move zip file.
Unfortunately I am unable to get set part right. I want to set Dt to have value like "ABC_20161010_DEF.zip"
open UserNameHere#ServerNameHere
ascii
cd "ValidPathHere"
lcd "ValidPathHere"
Set Dt=SomePrefixHere_%date:~-4,4%%date:~-10,2%%date:~-7,2%_SomeSuffixHere.zip
get Dt
pause
quit
You are mixing SFTP client (OpenSSH sftp?) commands (open, get, etc.) with Windows batch file commands (set). That's not possible.
You have to call the set from Windows batch file and then use the resolved value in the SFTP script. How to do that depends on capabilities of your SFTP client.
If you are using the OpenSSH sftp, you have to generate the script on the fly, as its script cannot resolve environment variables. In the other hand, the OpenSSH sftp does not have the ascii command. So I'm not sure, what client you are using actually.
Also note that using the date environment variable is not reliable. It gives different values with different locale. For example, on the US locale the %date% resolves to ddd, mm/dd/yyyy, so you will get yyyymmdd. On the contrary, on the UK locale, the %date% resolves to dd/mm/yyyy, so you will get yyyyddmm. On other locales, you can get yet another results.
An easy and more reliable solution, is using the WinSCP SFTP client, with its locale-independent %TIMESTAMP% syntax. WinSCP also supports the ascii/text mode (using the -transfer=ascii switch), if you need that.
With WinSCP scripting, you can use a batch file (.bat) like:
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open sftp://username:password#example.com/ -hostkey=""...""" ^
"get -transfer=ascii ""/remote/path/SomePrefixHere_%%TIMESTAMP#yyyymmdd%%"" ""C:\local\path\""" ^
"exit"
You can even have WinSCP generate the script/batch file template for you.
(I'm the author of WinSCP)

Problems using cron to run a encrypted php file

I'm having problems using cron to run a encrypted php file. The file is encrypted using Source Guardian v8.0 and i can run it successfully when i call th script directly from the browser. The frequency is to run every 24 hours and i'm testing by setting this to every 5 minutes so i can test it quickly. The frequency works ok and im getting the emails to the email address i specify in the job.
my emails contain this:
X-Powered-By: PHP/5.3.26
Content-type: text/html
but the resultant script(which updates a db table) is not running.
My web host (shared hosting) advised i use:
php -c /home/myUserName/public_html/path/to/my/daily/repeated/script.php
Source Guardian Support suggest full paths and specifying the php.ini path, thus:
/usr/local/bin/php -c /usr/lib/php.ini -f /home/myUserName/public_html/path/to/my/daily/repeated/script.php
Previously i was using:
php /home/myUserName/public_html/path/to/my/daily/repeated/script.php
Nothing seems to run this script!! with/without switches; full paths or not ...
any suggestions appreciated

Wget doesn't exit after copying files

On my Unix server I execute this command to copy all content from folderc via the unix shell.
wget -r -nH --accept=ismv,ismc,ism,jpg --cut-dirs=5 --level=0 --directory-prefix="/root/sstest" -o /root/sstest2.log http://site.com/foldera/folderb/folderc/
All the content from folderc is actually copied to /root/sstest .
The wget does not exit after copying and take me back to the command prompt.
What could be causing this behaviour?
I had the same problem, and I just add single quote to the front and end of the URL.
This step resolved this issue form me.
It's possible that the HTTP server miscommunicates the length of a response, so that Wget keeps waiting for more data. It could be due to a bug in Wget or in the server (or a software component running on the server) which you don't notice in an interactive web browser.
To debug this, make sure you are running the latest version of Wget. If the problem persists, use the -d flag to collect the debug output, and send a report about the misbehavior to Wget developers at bug-wget#gnu.org. Be sure to strip the sensitive data, such as passwords or internal host names, from the report before sending it.
I observe a similar problem when downloading files from dropbox with wget:
the download finishes (file is complete)
wget (or curl, depending on what I use for download) do not show up in running processes, anymore, after the file is complete
wget (or curl) do not return to the command prompt
returning to the command prompt can be "forced" by simply hitting enter, I do not have to actually kill any process to return to the command prompt, it's just kind of stuck before I press enter one more time.
The problem is not wget-specific, it also occurs when I try to download the same file from the same location with curl. The problem does not occur at all if I download the same file from several unix web server, neither with wget, nor with curl.
I have tried using timeout (with a sufficiently long time) to force wget/curl to return to the command prompt, but they even do not return to the command prompt after timeout kills them.

Resources