Tag Info

New answers tagged

1

I would say there are two approaches: Use the AWS API to determine the IP of all group members and then do SSH. -- This itself is possible on different levels, ranging from a shell script using aws-cli (describe-auto-scaling-instances and describe-instances) to a more sophisticated setup e.g. with Python boto and Fabric. Have all instances register ...


0

Why don't you use sshpass ? Loop with a table: tab=( 1.2.3.4 4.3.2.1 ... ); for (( i = 1; i < ${#tab[*]}; i++ )) { echo ${tab[i]}; ... } You'll need some conditions for specific IP addresses to set the right password. SCP sshpass -p $PASSWORD scp -o StrictHostKeyChecking=no $FILE $USER@$HOST:$PATH According to ...


0

If you have to manage hundreds of linux servers you should use a configuration management tool in order to execute these tasks. A very simple configuration management tool is ansible, the only requirement for managed system is python 2.4 or more( http://docs.ansible.com/intro_installation.html#managed-node-requirements ). Your problem solved with ansible: ...


1

Use something like: formail -i "To: user@example.com" -s sendmail -t < /var/spool/mail/USER formail is usually included with procmail. This will add a new To: header while replacing any old To: header with Old-To:. sendmail -t is executed for each message found in the standard input.


0

For scripts (particularly if doing reverse-lookup in reports), unless you need to be testing specific DNS functionality, then you would be better to use getent hosts ... That way, if you're running a local DNS caching daemon (eg. nscd or a local caching DNS server such as dnsmasqd) then you get a performance and caching gain, and don't bombard the DNS server ...


0

You need two backgrounded tailboxes and a static component. Msgbox will do. dialog --begin 1 2 --tailboxbg a 10 70 --and-widget --begin 13 2 \ --tailboxbg b 10 70 --and-widget --keep-window --msgbox "Exit" 5 10


5

According to the section on "Parameter Expansion" in the bash man page, this means "use the default value if the parameter is unset." So for example, ${PID-/run/unicorn.pid} equals $PID if $PID is set, otherwise /run/unicorn.pid.


0

Naming a variable with a variable (vr$n=value) is not possible without an export. However, I suggest to use an array instead: vr[$n]=$(echo -e "$line" | awk '{print $'$n'}') and reference the value afterwards with a syntax like this: echo ${vr[$n]}



Top 50 recent answers are included