One conch twisted connection for sftp and cdm - twisted

please tell me whether it is possible to use one SSHConnection to sftp, execute commands, and for port forwarding?
And allow me one question - is it possible to transfer multiple files over one SSHConnection connection?
Maybe there are examples.
Thanks in advance!

Yes. For example, you can use SSHCommandClientEndpoint.existingConnection to create an SSHCommandClientEndpoint to run commands on an existing connection rather than establishing a new one.

Related

Where to find a thorough list of node_redis commands?

I'm using redis to store the userId as a key and the socketId as the value. What's more important is that the userId doesn't change, but the socketId constantly changes. So I want to edit the socketId value inside redis, but I'm not sure what node_redis command to use. I'm currently just editing by using .set(userId, mostRecentSocketId).
In addition, I haven't found a good node_redis API anywhere with a complete list of commands. I briefly looked at the redis-commands package, but it still doesn't seem to have a full list of complete commands.
Any help is appreciated; thanks in advance :)
The full list of Redis commands can be found at https://redis.io/commands. After finding a proper command it wouldn't be hard to find how is it proxied in binding ("api") you use.
Upd. To make it clear: you have Redis Server, its commands are listed at the doc I provided. Then you have redis-commands - it's a library for working with redis (I called it a "binding"). My point was that redis-commands may have not all the commands that redis-server can handle, and also the names of some commands can differ a bit. Some other bindings can offer slightly different set of commands. So it's better to examine the list of commands that Redis Server handles, and then select a binding that allowes calling that command (I guess all the bindings have set method)

Connect to one server, and from there connect to another to read file

My problem is I basically need to on command, connect to one server, and from there connect to another (both of which I have access to). I need to connect to the first to reach the second. And on the second I need to read something from a text file. And fire that information back.
Is that possible? I wouldn't even know where to start. I'm fine with the text file thing!
Help would be appreciated.
EDIT - neither server is connected to the inter-web : (.
You will have to do something like a Service or Web Service on both of them so you can communicate with them and allow them to do some work.

How to automate interactive telnet commands?

I would like to query a telnet server on port 105. What I have to do currently is start an interactive session and enter the commands later one by one.
Since I already know the commands, I would like to automate this process and fetch the results without any manual intervention.
When I try to use pipe to push commands at the time of logging in, this doesn't work. Any help is highly appreciated.
You are probably looking for a tool like expect.
Since you do not say what OS you use, and what kind of script language you want to use I will just provide a few suggestions for further reading.
this questions might answer what you are looking for.
Also I found this that could help you out a bit.

Good FTP control?

I need to find a good control for VB.Net to upload big files to an FTP server:
Can upload files up to 10GB
Uses passive mode
Provides feedback during upload, to make sure it's going OK
Can cancel and resume
Up to two concurrent connections
I read about WebClient + NetworkCredential, but it doesn't seem to provide progress infos. There are also the FTPWebRequest/FTPWebResponse classes from WebRequest/WebResponse, as well as WebClient.UploadFileAsync.
Which free/affordable solution would you recommend?
Thank you.
You should expect the following to be provided by every FTP client classes/controls, as they are supported by FTP the protocol.
Can upload files up to 10GB
Uses passive mode
Can cancel and resume
The following requires you to make good use of the classes/controls, for example, use two client classes/controls at the same time.
Up to two concurrent connections
RemObjects has a free pack called Internet Pack, where you can find a class called FtpClient,
http://www.remobjects.com/ip.aspx
http://wiki.remobjects.com/wiki/FtpClient_Class
It supports all FTP features above, and it provides upload progress too, via events. You can read its documentation or simply write a small program to test it out.
To support multiple connections to the same FTP server, you can create multiple instances of this class.

NHibernate using single configuration file to connect to multiple dbs

I'd like to have a single configuration file and then when I'm creating a session change the hibernate-configuration->session-factory->connection.connection_string property to what I want it to be programmatically? Is it possible?
UPDATE:
I believe I may be able to do this like this
Configuration cfg = new Configuration();
cfg.Configure(sessionFactoryConfigPath);
cfg.Properties["connection.connection_string"] = ...
What I would wonder than, if that is ok, Is this a bad way to handle connecting to a different database for each session? if so why etc. I'd also like to know if/how you can open an nhibernate session with a .net connection object?
Use the ISessionFactory.OpenSession() overload that takes a IDbConnection.
That's how Castle's DifferentDatabaseScope does it.
I think it is better to use different configuration files per each data base just becouse you will be able to switch dialects very esasy.
You may also see this answer as it allows full configuration of session factories through one file. Configure NHibernate hibernate.cfg.xml file to have more connection strings