Access and write back to txt file on linux server from iOS on local network - ios

I currently have a txt file on a Linux install that I need to access from my app and write back to. The app and the Linux server are on the same subnet and I have full control of both machines (permissions). I've thought about SSHing into the machine but this obviously has its security drawbacks sending raw credentials. Does anyone have any suggestions on what framework to use to create a secure tunnel or perhaps an alternative solution?

Write a simple web service in your language of choice php, python, ruby, etc. And make a simple secure call to your service with the changes.

Related

NeutralinoJS and Tauri backend services

I have used Electron for many years and like the fact that I can deliver a frontend app that has a bunch of backend services (connections to databases etc) that can be bundled in a dmg.
Electron is however a bit heavyweight and I have been looking at NeutralinoJs and Tauri to see if I can do the same. I've tried NeutralinoJs and it's certainly good for bundling a frontend app but it appears not have any mechanism for writing backend services and being written in C++, I suspect this is unlikely to happen.
Does Tauri allow you to write backend services in Rust - I can't tell from the documentation.
You need to understand how NeutralinoJS Works.
NeutralinoJS written in C++ starts a server on the specified port in neutralino.config.json
"port": 0,
port 0 means Neutralino will chose a random port and start the server on it which serves all the content inside the folder we specified in the config file:
"documentRoot": "/resources/",
After starting the server Neutralino uses the native WebView APIs to start a new window and tells the WebView to load the URL we want, in our case it will be 127.0.0.1 with the port we specified.
but since this WebView can't directly modify our storage or get information about the computer, Neutralino has some Pre-Defined APIs written in C++ to view and edit information on our computer.
since we use JavaScript, the Author of Neutralino has provided us a bridge using which we can access all the Pre-Defined APIs written in C++, and this bridge which provides us this stuff is neutralino.js.
neutralino.js handles all the communication between our WebView and the Neutralino Process.
the path of neutralino.js is also defined in the config file:
"clientLibrary": "/resources/js/neutralino.js",
So if you want to work with the "Backend", you have 2 options you can either directly add those APIs in the Neutralino's Source Code or you can use a better way to work with BackEnd in Neutralino called "Extensions".
Yes, it's a core feature. Here's their guide about Rust commands that can be called from Javascript:
https://tauri.studio/en/docs/usage/guides/command
According to their roadmap, support for C-interop languages like Go, Nim, and Python is underway.

How can i ota my application via internet on esp32?

I'm trying to run the demo code of esp 32 for native ota update which works just fine for local server ota update,i want to know which internet servers are providing free platform for ota update.
I've tried native sample code which works fine.
When performing an OTA update on the ESP32, all you're really doing is sending a GET request to whatever server that you're pointing the OTA client config struct to. In the simple_ota_example from the IDF examples directory, you have:
esp_http_client_config_t config = {
.url = CONFIG_FIRMWARE_UPGRADE_URL,
.cert_pem = (char *)server_cert_pem_start,
.event_handler = _http_event_handler,
};
The example value they give for CONFIG_GIRMWARE_UPGRADE_URL here is
https://192.168.0.3:8070/hello-world.bin.
You could, for example, use Amazon Web Services to host your firmware files, like I do. Then you just change 192.168.0.3 to the IP address (or host name) of the AWS Server you're using. Change 8070 to the port that the server is setup to use. Then change hello-world.bin to /path/to/your/firmware.bin. You'll also need to change the embedded CA Root Cert in the firmware to use Amazon's (or that of whatever hosting service that you're using).
A lot of hosting services have free tiers, which if you're only testing OTA updates or using them infrequently may work you. I believe Amazon has a free tier, possibly Google as well.
If you're planning on using this for a production device that customers are using, you're going to have to pay for hosting most likely. You'll have to take many more aspects such as security and scaleability into account.

Sending Commands to a Remote Printer

I'm working on a web project in which I need to be able to communicate directly with my customer's printer. The customer uses my application through a browser, and would like to be able to click a button to print tickets uninterrupted, meaning there is no printer dialog popup from the browser. This requirement eliminates many traditional ways of sending information to the customer's printer, and because I want a solution that will work on any browser, solutions that use VBSCRIPT or other browser-dependent solutions will not work.
My initial solution for this problem was to create a Java applet that was loaded into the page dynamically when a "Print" button was clicked. However, browsers like Chrome and soon Firefox are removing support for NPAPI, which breaks my Java plugin.
The current solution I'm working on is to create a service in C# that the user installs locally on their machine, and then when the customer clicks the "Print" button, my server communicates with that service directly. This way I can bypass the browser restrictions, and the service running on the customer's machine will have full access to communicate with the target printer. The downside to this approach is that the user now has to install an additional bit of software on their machine, and for each machine they wish to access my application on and print from, that machine needs to have proper port-forwarding and firewall settings configured. I can make this work for my current customer, but with future customers it becomes a hassle. Furthermore, my new approach currently only supports Windows machines, and if future customers are using OS X or Linux, I will need to port the service.
Has anyone faced this problem before, or are there any ideas out there for how to communicate with a client's printer that is browser-independent?
There's no possible solution to this that both supports Chrome and doesn't require something to be installed on the machine; you can't run arbitrary code that interfaces with the OS from within Chrome. And the only way to interact with that other code besides a local web server would be Native Messaging in an extension, but that doesn't fulfill your cross-browser requirement.
you can't communication directly because of security. i also develop 1 application in c# for remotely printing.
there is one way if your client have remote printer then you can do this task easily make small app on server and integrate with all remote printer and you can execute printer command from server and print will comes from client printer

how to upload files from a FTP location into Marklogic

i need to upload files from a FTP location into marklogic. please guide me on this
MarkLogic doesn't allow accessing external FTP locations from XQuery, like it allows HTTP calls. Nor does it provide FTP servers, like it provides WebDAV servers.
You can however easily put a mediator in between that accesses the FTP instead, and use other means to upload the document into MarkLogic. The latter can be done through a WebDAV App Server that you can create using the Admin interface, through the built-in REST api in MarkLogic 6 ( http://docs.marklogic.com/REST ), or through custom code like Corona ( http://developer.marklogic.com/code/corona ).
If you write the mediator in Java, you can also use the Java API ( see Java API tab at http://docs.marklogic.com/ ).
HTH!
We have a app that needs documents from a shared folder that we running an etl on to get into marklogic. You can do this a number of ways. If you are able to I'd amount the drive on the marklogic box and then read from there. IF that doesnt work see if you can make those files viewable from an http-get requested. IF that doest work then you might want to make a web services.
I personally would avoid WebDav unless you absolutely need it.
Is this a one-off, batch , or continous job ?
If one-off or batch then I would suggest using a script to FTP the files to a local disk then using mlcp or RecordLoader or xmlsh to push them to MarkLogic.
If this is a continuous job then a custom Java app is probably the way to go.
Do realize that FTP is a horribly sensitive protocol .. it can fail in so many ways and takes special port openings etc. It was designed in the 80's before firewalls, NAT and such.
Getting FTP to work reliably irregardless of MarkLogic is a black magic art in itself.
If its possible to use another protocol then FTP that would be ideal.
Say scp or rsync or http.

FTP Client/Server with Web Based UI/API

I don't even know where to begin to look for something like this, or whether or not one even exists. What I am generally looking for is a FTP Server that I can run in the background of any given linux distro. Particularly RedHat and Ubuntu. Having this server run as a service on the machine. Then through that I need a FTP client that can interact with that particular service thats built into a Browser based UI. It would be nice to have something that I can tie the server admin into the UI as well.
So my question here is, is there anything like that, that anyone knows of? The UI portion should be able to support (j)Ruby
F->It may fit the bill. It has a Javascript client wrapped in Rails on the server.
Read about it:
http://www.webresourcesdepot.com/web-based-ftp-client-similar-to-windows-explorer/
See a demo:
https://fit.jupiterit.com/
Download it:
http://code.google.com/p/f-it/

Resources