Automated Putty Program? [closed] - centos

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have multiple Linux vps's and I need to be able to run a program that executes a command on the servers at the same time, or with minor delay. If someone could point my in the right direction that would be great. Thanks.

In bash, you can run a task in the background by appending & after the command. I would write a script to execute the command on the different servers:
#!/bin/bash
for server in server1.domain server2.domain server3.domain
do
ssh username#$server "mycommand params"&
done
This is for manual execution of a task on a number of remote machines. Of course, you will need to be using public key authentication (not password) otherwise it will hang on the password prompt.
If instead you meant that you want a regularly scheduled task to run on each individual machine, use cron as another answer suggested.

Related

Raspberry pi NTP working without conf file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
On raspberry, I was looking at the NTP configuration file under /etc/systemd/timesyncd.conf. All lines are commented (by default) but when I run the timedatectl status command, I get:
...
Network time on : yes
NTP synchronized : yes
...
How NTP works without configuration in conf file ? Where are NTP server links ?
Raspberry pi 3 ; Raspbian 9.13 (stretch)
The NTP management of systemd is called systemd-timesyncd. On my Ubuntu system, the corresponding systemd service is /lib/systemd/system/systemd-timesyncd.service. Typically, when you don't have items activated in a configuration file, daemons use default values. Moreover, if you look at the comment in the configuration file, you will see that the commented items are actually default values:
Entries in this file show the compile time defaults.
You can change settings by editing this file.
Defaults can be restored by simply deleting this file.

Run Perl script in SunOS machine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
We have a SunOS machine where we run our daily jobs, on failures we usually login into the machine (using Putty) and run a perl script that take an input parameter to start the failed jobs. Similarly if we need to stop a job we follow the same process and run another script.
I would like to formulate a single script outside of the remote machine which would follow the process of logging in , navigating to the directory where the script is and running the script.
Just looking for ideas as to see how i can implement this
I would recommend looking into Net::OpenSSH (https://metacpan.org/pod/Net::OpenSSH). I've used this with great success to connect to remote machines, execute commands, and capture their output. Also, connection creation can be greatly simplified if you set up passwordless authentication to your remote machines. Then you can test your commands from the command line (and chain commands together):
ssh host 'cd dir1/dir2 && run_script'
The implementation in the controlling script would be to the tune of:
my $ssh = Net::OpenSSH->new($my_host);
my ($out, $err) = $ssh->capture2($my_command);

How to make an offline translator? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
**Problem: **
The result must be a working translator - offline.
We need http API (self-hosted) similar to Google Translate.
I found a few options:
Install Microsoft Translator on Windows, download dictionaries, and somehow through http transfer requests for translation there
Apertium, this option is closer to reality, but it’s not clear how to set everything up ...
Apache Joshua
Promt, it is perfect but it is very expensive
Install Android on PC, and there is already Google Translate, but again there will be a question of sending http requests
**Todo: **
We need to translate whole sentences, not just individual words.
Maybe there is some kind of command line utility. Or maybe there is something for linux.
Which of the above options is better to look for more information?
The five-minute solution is to do this on Debian or Ubuntu:
sudo apt install apertium-apy # http server for apertium
sudo apt install apertium-eng-spa # install some language data
sudo systemctl enable apertium-apy # start http server on next boot
sudo systemctl start apertium-apy # start http server right now too
You now have translation between English and Spanish that responds to http requests and answers in JSON:
curl 'http://localhost:2737/translate?langpair=spa|eng&q=Eres+la+leche'
You can see all the apt-installable Apertium language pairs with
apt-cache search apertium |grep 'pair$'
If you want more pairs in Apertium, you could try the adding the nightly apt repo with unreleased data (or consider Contributing your own language data).
However, you tagged this neural-network – if you want NN's, or more language pairs than Apertium has, you could train a translator with OpenNMT and data from e.g. http://opus.nlpl.eu/ , but that will definitely take more than five minutes :-)

How to run a Batch script on all connected Computers with Admin rights (Windows 7) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have a Simple Script to create a user and add it to administrators localgroup in a local computer:
NET USER admin password /ADD
NET LOCALGROUP administrators admin /ADD
I'd like to create a script that copy & execute my file (or execute the commands above) in every available computer in my LAN network. i have admin right to do it manually. but i would very like to automate the process of adding user + give it admin privileges with shell script.
p.s.
If there is another way to do it with CMD / PowerShell it would be great.
I don't have access to the internet so third party programs are not an option.

how to install initctl on a centos-7 box [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
service autofs restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service autofs restart
/etc/init.d/autofs: line 54: initctl: command not found
I have looked up on the web and do not see any yum package that can install initctl. can you please help.
CentOS 7 comes with systemctl to manage service. You don't need to use initctl.
service autofs restart should point to systemctl restart autofs
You can check the status of this service with systemctl status autofs and post us the output if not able to restart.