Amazon Linux curl - linux

bash -c "$(curl -s https://install.prediction.io/install.sh)"
I run the above script on and ec2 instance running Amazon linux to install prediction IO. Nothing happens no error. Does anyone know whats going on?

That command downloads a file in silent mode $(curl -s https://install.prediction.io/install.sh) and then run the file with bash -c.
you should run the command in separated steps to check what it is going on
curl -O https://install.prediction.io/install.sh
chmod +x install.sh
./install.sh

First, check whether the like https://install.prediction.io/install.sh is accessible from your Amazon EC2.
curl -v https://install.prediction.io/install.sh
If its working, try this
curl -s https://install.prediction.io/install.sh | bash

Related

Error while trying to install Kops on Ubuntu 20 EC2 Instance

I went through the steps listed here: https://kubernetes.io/docs/setup/production-environment/tools/kops/
After moving the kops file to /usr/local/bin/ and renaming to kops, I tried to confirm if it was in fact installed and executable by trying 'kops --help' and 'kops --version'/'kops version' and neither command worked. Any idea what the issue might be?
Edit: Here's what I did step by step
curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-darwin-amd64
sudo chmod +x kops-darwin-amd64
sudo mv kops-darwin-amd64 /usr/local/bin/kops
It's a t2.micro Ubuntu 20.04 EC2 Instance.
Tried to confirm if kops was properly installed and executable by entering 'kops --help' and 'kops --version' and also 'kops version' but they all return this error:
-bash: /usr/local/bin/kops: cannot execute binary file: Exec format error
I think its because you are using kops-darwin-amd64. This is for mac. I think you should be using kops-linux-amd64 instead for linux.

Installation of Cron in cygwin

When I run the following command in cygwin,
$ cygrunsrv -I cron -p C:\cygwin64\bin --args -n
I get the following error
cygrunsrv: Given path doesn't point to a valid executable
Why am I getting this error?
You only gave a folder and not a path to the executable. Besides this I wouldn't recommend to use windows paths in cygwin, this can cause errors. You should write /cygdrive/c/cygwin64/bin/something instead of C:\cygwin64\bin\something.exe
Perhaps you are looking for an
installation guide, and you would like to do something like this:
Install cron as a windows service, using cygrunsrv:
cygrunsrv -I cron -p /usr/sbin/cron -a -D
net start cron

WGET command in putty console

I am trying to run a wget command do download from a given list in background and if the file is arleady on disk to be overriten
the command that try to use is :
wget -b -N -q -x -i liks.txt
But is not working. I am doing something wrong.?
I am running the command on a CENTOS VPS

bash & s3cmd not working properly

Hi I have a shell script which contains s3cmd command on ubuntu 12.04 LTS.
I configured cron for this shell script which works fine for local environment but don't push the file to s3. But when i run shell script manually, It pushes the file to s3 without any error. I checked log and found nothing for this. Here is my shell script.
#!/bin/bash
User="abc"
datab="abc_xyz"
pass="abc#123"
Host="abc1db.instance.com"
FILE="abc_rds`date +%d_%b_%Y`.tar.gz"
S3_BKP_PATH="s3://abc/db/"
cd /abc/xyz/scripts/
mysqldump -u $User $datab -h $Host -p$pass | gzip -c > $FILE | tee -a /abc/xyz/logs/app-bkp.log
s3cmd --recursive put /abc/xyz/scripts/$FILE $S3_BKP_PATH | tee -a /abc/xyz/logs/app-bkp.log
mv /abc/xyz/scripts/$FILE /abc/xyz/backup2015/Database/
#END
This is really weird. Any suggestion would be a great help.
Check if the user running configured in crontab has correct permissions and keys in the environment.
I am guessing the keys are configured in env file as they are not here in the script.

Linux script to do simple setup on new install?

When I get a new VPS there is always the same tasks that I need to do before I can begin using the VPS.
I need to change the root password.
Add more repositories.
Install some programs with apt-get
Would it be possible to create a simple script to do all these things? What type of script would I need to write?
You can write a simple bash script, or you can look into power tools like Puppet, Chef, Salt or Ansible.
Scripts are very low-level, and hard to make "idempotent" (able to be run twice). The above tools let you declare what you want, and the the tools implement it, skipping over work that has already been done.
yes... it is possible:
#!/bin/bash
script=$'
apt-get install <package-name>
apt-get install <package-name>
apt-get install <package-name>
passwd <<EOF
<your-new-password>
<your-new-password>
EOF
'
while read pass port user ip; do
sshpass -p$pass ssh -o 'StrictHostKeyChecking no' -p $port $user#$ip "$Script"
done <<___HERE
<pass> <port> <user> <ip>
<pass> <port> <user> <ip>
. . . .
<pass> <port> <user> <ip>
___HERE
first of all this makes a ssh connection to your ip. after that run commands in $script and then go to your next server.
but on all of your servers you should install sshpass:
apt-get install sshpass
What your looking for is a bash script. Shell scripting using bash is a great way to automate all of those menial tasks that you run one-by-one from the command line
Check it:
http://www.panix.com/~elflord/unix/bash-tute.html

Resources