Parsing MT4 config files - config

I'm trying to write an install script for an MT4 expert advisor. Part of the installation process includes adding an allowed WebRequest URL. I assume this is saved as a setting in C:\Users\{User ID}\AppData\Roaming\MetaQuotes\Terminal\{Terminal ID}\config\experts.ini as I can see the allowed URLs there, but I cannot parse this data as no editor I have can decode it. Is this file parsed using a proprietary encoding or is it encrypted in some way? Any help here would be appreciated.

Related

Serve gzipped content via a Web Resource

I have a Dynamics 365 instance that makes heavy use of custom front-end interfaces using a modern Nodejs-based build pipeline involving the usual suspects such as webpack/babel/etc. I'm hosting these files as webresources in Dynamics (one html file and one bundle.js file per SPA).
As my team nears production, I'm trying to set up a nice production build for our front-end stuff to reduce load times. Unfortunately, I can't find a good way to serve our bundle.js files encoded as gzip because Dynamics does not return the Content-Encoded: gzip header when a request is made and therefore the browser doen't decompress the file and tries to read the compressed file as plain JavaScript.
Of course, we can serve the uncompressed file just fine but we would like to provide the smaller, faster loading file if possible as it's generally about 1/3 the size.
Does anyone have any brilliant ideas for how to override the default response headers coming back from dynamics when I request a web resource? Or any other clever solutions to this problem?
Thanks, and let me know if any clarification is needed.
I don't know of any way to serve gzipped content via a web resource.
If the download size is a huge concern perhaps encode the gzipped code to base64 and store it as a string variable in JS.
Then during execution you could decode, unzip, and eval() the code.
You could also store base64 gzipped code as a file attachment via an annotation record or within an XML web resource, though those options would require an additional API call to get the code, so a string variable may be your best bet.

FusionPBX: How to Provision binary files?

I am currently trying to auto-provision a SNOM phone with FusionPBX v4.4. When it comes to provisioning of certificates, SNOM needs these in DER format, which is binary.
Provisioning of text files works like a charm by calling http://fusionpbx.example.com:80/app/provision/?mac=000413xxxxxx&file=mytextfile
However, if the requested file is binary, the call fails with
Fatal error: in
/var/www/fusionpbx/resources/templates/engine/smarty/sysplugins/smarty_internal_templatecompilerbase.php
on line 3
It seems like FusionPBX is trying to parse the file with some template engine. Is there any chance (like an URL parameter) to disable parsing of the file and just deliver it as is?
I haven't tried the DER format yet can you provide a link to info on it. So I will have example to test with?
There is no need to run a binary through the template engine. Instead just put the file in the web directory and pull the file directly.

Export file from NetSuite's FileCabinet to FTP

File resides in the NetSuite file cabinet and needs to be placed on an FTP server each day.
I'm not sure how to handle this via Suitelet/RESTlet, or if it's possible - but would prefer to not use an external source/application.
My current and hopefully temporary workaround is a local scheduled task to run a script to pull files from NetSuite & upload to the FTP.
In SuiteScript 2.0, although unsecured FTP is still not support, but SS2.0 has the capability to do SFTP. See http://www.upilioconsulting.com/blog/netsuite-2016-2-sftp-suitescript-2-0/
In SuiteScript 1.0, it's not supported. The workaround is that you'll need to write a middleware code (i.e. in PHP) and let the middleware do the FTP transfer.
Netsuite doesn't interact with FTP.
You need a bridge server of some sort that runs a web app (full blown Apache or nginx running PHP or just a simple Node service)
Just get a server and install some web server/web service and POST your files to it (nlapiRequestURL with a Scheduled script). Have the web app on the bridge server send the files to the FTP server. If you are using Netsuite you can afford the cost of the bridge server.
One possible solution is to create a saved search on the Documents to list out all the files in Netsuite filtering by createdate or lastmodifieddate. Create a scheduler to fetch only the new files and save them locally where you want.
Note all the files will be in base64 encoded string format, you need to decode again to obtain the file.
As bknights said NetSuite doesn't support FTP. You need a web server(any server side language can do for that matter, I have written one in Node.js), to receive the files.
The file content for text file will be in Text format, so, no decode logic required for text files. However, binary/pdf/image and other would be in base64 format, as NetSuite's JS has no way of handling binary data. So, make sure you decode it before you create the file on your FTP Server.

JMeter: Generate unique csv file then POST

Completely new to JMeter.
Just wondering if it can be configured to generate a file (i.e. .csv) and then post said file with a HTTP POST?
I've searched a bit on the internet but can't work out whether it is possible...
Reason I want to do this is that I want to test a server that receives data in the form of a .csv file and uploads it to a database. Hoping to test this server by sending a whole bunch of randomised data.
Would be good to have different threads sending different amounts of data at different rates.
Any tips would be amazing, I am a complete newbie.
Cheers
It is possible to upload a file using JMeter HTTP Request sampler.
JMeter supports beanshell which is Java - scripting language. It can be used to create a CSV file& store it in some path.
Update the csv file path in the 'Send file with the request' of the HTTP Request sampler.

Is it possible to rename a file on FTP server programmatically using cocoa?

My basic requirement is to add a ".temp" suffix to a file while it is getting uploaded on to the FTP server (suffix should be only for time until the file is fully uploaded).
As per my understanding, i thought this could be achieved by: Add a suffix to file on the local machine, then upload it and after the upload is complete, rename the file to remove suffix on server.
But now the another problem is that i could not found a way to rename a file on FTP server using cocoa. I know renaming a file is feasible using Java or other languages but i want to achieve the same in objectiveC.
Please tell be if the above task is feasible and if it is what is the approach i should follow?
FYI: I know how to upload and download a file on FTP server using NSInputStream and NSOutputStream.
Thanks. I'd appreciate any help.
Take a look at CFNetwork FTP docs. They do not mention exactly your case, but there may be a way to sent RNFR and RNTO commands over the stream.
https://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFFTPTasks/CFFTPTasks.html#//apple_ref/doc/uid/TP30001132-CH9-SW1
There is also a sample project you can look into:
https://developer.apple.com/library/ios/samplecode/SimpleFTPSample/Listings/Read_Me_About_SimpleFTPSample_txt.html
This library claims to do what you want (rename remote files)
http://www.chilkatsoft.com/ftp-objc.asp