Error while trying to install Kops on Ubuntu 20 EC2 Instance - linux

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.

Related

"sudo: k0s: command not found": even though its script is executable and its location is in the path

What I am trying to do is:
To play with K0s. So, first I download the K0s scrips and make it executable:
$ curl -sSLf https://get.k0s.sh | sudo sh
.. and here is the terminal output:
> Downloading k0s from URL:
> https://github.com/k0sproject/k0s/releases/download/v1.20.6+k0s.0/k0s-v1.20.6+k0s.0-amd64
> k0s is now executable in /usr/local/bin`
At this point, when I type k0s in the terminal, I get the help page. Also, when I run type k0s, I get the /usr/local/bin/k0s
Again, when I run $ echo $PATH, I see that /usr/local/bin/ is included in the path variables.
The problem is:
When I try to run:
$ sudo k0s install controller --single
I get:
> sudo: k0s: command not found
But it works when I put the full path of the k0s:
$ sudo /usr/local/bin/k0s install controller --single
I tried this answer and this answer but both did not work. Both suggest changing the mode and erload the shell hash-table.
The question is:
what is the probelm, and how to fix it ?

how to install anaconda / miniconda on Linux silently

How do I install the anaconda / miniconda without prompts on Linux command line?
Is there a way to pass -y kind of option to agree to the T&Cs, suggested installation location etc. by default?
can be achieved by bash miniconda.sh -b (thanks #darthbith)
The command line usage for this can only be seen with -h flag but not --help, so I missed it.
To install the anaconda to another place, use the -p option:
bash anaconda.sh -b -p /some/path
AFAIK pyenv let you install anaconda/miniconda
(after successful instalation)
pyenv install --list
pyenv install miniconda3-4.3.30
For a quick installation of miniconda silently I use a wrapper
script script that can be executed from the terminal without
even downloading the script. It takes the installation destination path
as an argument (in this case ~/miniconda) and does some validation too.
curl -s https://gist.githubusercontent.com/mherkazandjian/cce01cf3e15c0b41c1c4321245a99096/raw/03c86dae9a212446cf5b095643854f029b39c921/miniconda_installer.sh | bash -s -- ~/miniconda
Silent installation can be done like this, but it doesn't update the PATH variable so you can't run it after the installation with a short command like conda:
cd /tmp/
curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -u
Here -b means batch/silent mode, and -u means update the existing installation of Miniconda at that path, rather than failing.
You need to run additional commands to initialize PATH and other shell init scripts, e.g. for Bash:
source ~/miniconda3/bin/activate
conda init bash

Windows Linux Bash bad variable name when running /bin/sh -c "$(curl -fsS https://install.airshipcms.io)"

everything was working until I changed my mobo/cpu and I'm not sure what the error message means.
After running the install command
/bin/sh -c "$(curl -fsS https://install.airshipcms.io)"
my windows ubuntu bash shell returns
Starting Airship Launcher installation for ubuntu Linux64
Will install version 2.1.1
Downloading https://install.airshipcms.io/Linux64/airship-2.1.1.tar.bz2
To /tmp/AirshipLauncher.65/airship-2.1.1.tar.bz2
Added ~/.airship-bin to $PATH in ~/.profile
/bin/sh: 504: export: (x86)/Intel/iCLS: bad variable name
My guess was that because I already had it installed pre-upgrade of the mobo/cpu the variable name is already taken in the ~/.profile ? I'm not sure how to edit it, when I ran cat ~/.profile it rendered a bunch of unreadable characters.
thank you.
edit: I've tried reinstalling my linux shell, to no avail.
Okay so the fix is to replace sh with bash so the working command was
/bin/bash -c "$(curl -fsS https://install.airshipcms.io)"
credit goes to this guy https://github.com/probonopd/PowerShell/commit/2441d99a7405b488dc9289789edb636dc2cdcdfc

Amazon Linux curl

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

Enable Postgresql in Cygwin

I installed Cygwin with Perl and Postgresql packages enabled.
Then typed:
/usr/bin/cygserver-config (This will install the service)
Then type:
net start cygserver(This starts the service)
Next i need to enable Postgresql in Cygwin, so i tried the commands mentioned below:
cygrunsrv -S cygserver
initdb -D /usr/share/postgresql/data
pg_ctl start -D /usr/share/postgresql/data -l /var/log/postgresql.log
createdb
psql
I get an error:
$ initdb -D /usr/share/postgresql/data
-bash: initdb: command not found
$ pg_ctl start -D /usr/share/postgresql/data -l /var/log/postgresql.log
-bash: pg_ctl: command not found
Can someone please tell me how to get it right.
The Postgresql initdb and pg_ctl executables are located under /usr/sbin.
I am guessing that /usr/sbin is not on your PATH setting. Adding it should do the trick.
I use a start/stop script which I keep under $HOME/bin called pg. Here's the gist.

Resources