How to Check FTP Connection via NSTask? - objective-c

I want to write a cocoa application that checks if my ftp server is still up and running.
So far I learned that CFFTP could be used but this is not object oriented code so a no go for me. Also some people recommend ConnectionKit but that won't build on 10.7.
So my idea was to use terminal commands in my application with the help of NSTask.
The problem is: there are multiple commands that need to be executed, the first being
ftp ftp.foobar.com. Then I need to check if the response is ok or not. After that I will have to put in my username and password and also evaluate that output of that.
Does anyone know how the entire ftp connection handshake can be accomplished in Objective C via NSTask?

You could run
ftp -N /path/to/a/netrcfile
and try to parse the output.
I agree with #Rob Keniger in the comments, though - why not go for the C API? I am sure there is plenty of sample code out there to learn[*] from.
[*] Read: copy, then try to figure out why it does what it does

Related

How to send result file after all tests run in nunit console c#

Is there a way to send a mail with result file (I set this file in console command with option --result) after running.
I have run my selenium test cases in following way
How to Schedule Selenium Web Drivers Tests in C#
The result file was created after OneTimeTearDown function.
If sending an e-mail into OneTimeTearDown function - the result file comes incomplete
Thanks in advance
Sangeetha P.
I'm not sure I'd actually recommend doing this - but I think it's possible. Personally, I'd instead handle the email sending outside of the NUnit console, in a separate script in your CI System.
Anyway. You could achieve this by writing your own ResultWriter extension. Take a look at the implementation of the standard NUnit3XmlResultWriter as an idea - you'd essentially want the same thing, except to send the file by email, rather than write a file. (You may even want to make your ResultWriter actually inherit the NUnit3XmlResultWriter class.)

How do I make the remote call actually remote?

How do I make an actual remote call?
I've followed the guide: https://codelabs.developers.google.com/codelabs/webrtc-web/#4
And gotten their example fully integrated in my application (Angular, TypeScript, multi webcam &etc).
How do I make the remote call actually remote? - I get the idea of a signalling server, but maybe someone can show with basic strings?
I found this, but it's not been updated in a while so I'm not sure what's still valid:
Found some nice sequence diagrams https://webrtc.org/native-code/native-apis/
Setup call
(source: webrtc.org)
Receive a Call
(source: webrtc.org)
Close Down a Call
(source: webrtc.org)

Does anyone know how to connect RabbitMQ with COBOL?

Does anyone know how to connect RabbitMQ with COBOL? I tried the documentation in RabbitMQ site but the examples make calls to programs like "RMQ_CONNECT" that don't exists.
From the looks of it, RMQ_CONNECT is not a program, but an entry point in a library. Try using Call "RMQ_CONNECT" and make sure the rabbitMQ library is properly linked for your environment.
Write a c or c# helper exe that takes the payload on the command line and sends it to rabbit, then execute it with a "Call SYSTEM using command-line"
like this:
insert-mongodb-record.
move spaces to command
string "mongo --quiet --eval 'db.norple.insertOne({_id: """my-id""", age: """my-age""", initial:"""my-initial""","
"description:"""trim(my-description)""", nimbus:"""my-nimbus"""})' cobol"
into command
display command
call "SYSTEM" using command end-call
exit paragraph
.

Any good tool(s) for Automating remote logging

I need to write a script, that can automate few things:
a) telnet to a router
b) issue configuration commands.
c) check for status(success/error)
What language/framework should I use?
I only know about "expect".
What are other better alternatives?
If you don't want to use expect, you're probably going to end up using some more standard scripting language which is less specifically well-suited to the task. If you get into that realm, the proper answer is "anything you feel comfortable with", be that bash, python, or whatever else.
It's a pretty general problem, so use whatever produces an easy-to-maintain system.
you can make use of Jcraft an open source tool.
You can try using Ganymed SSH2 a Java Open Source API to connect to Remote Machines. I used it for secured remote login. You may even check my blog for referene
http://allianceglobalservices.com/blog/terminal-window-automation-using-ganymedssh-2-api

Up and download directly - no waiting

I would want to program something where you upload a file on the one side and the other person can download it the moment I start uploading. I knew such a service but can't remember the name. If you know the service I'd like to know the name if its not there anymore I'd like to program it as an opensource project.
And it is supposed to be a website
What you're describing sounds a lot like Bit Torrent.
You might be able to achieve this by uploading via a custom ISAPI filter (if you use IIS) -- all CGI implementations won't start to run your script until the request has completed, which makes sense, as you won't have been told all the values just yet, I'd suspect ISAPI may fall foul of this as well.
So, your next best bet is to write a custom HTTP server, that can handle the serving of files yet to finish uploading.
pipebytes.com I found it :)