google cloud platform SSH You need to be root to perform this command - google-cloud-endpoints

When I try to install something via putty SSH yum install python-setuptools && easy_install pip, it tells me that:
You need to be root to perform this command
Even if I use sudo yum install python-setuptools && easy_install pip still get permission denied.
How can get root user permission or how can I resolve this?

You're missing sudo on the second portion of the command. Do this:
sudo yum install python-setuptools && sudo easy_install pip
The reason for this is that && is part of a conditional shell expression, which executes the command after && only if the first command was successful. sudo itself is a command/program, so, without the second sudo, this is just saying "if sudo yum install python-setuptools was successful, run easy_install pip (without sudo)".

Related

Permision denied for dotnet

I recently installed dotnet 5.0 on Pop OS but whenever I try to use it it says that I don't have permission.
For example, if I just try to run the command dotnet it gives the the message
cannot snap-exec: cannot exec "/snap/dotnet-sdk/144/snap/command-chain/snapcraft-runner": permission denied
When I run the command as the root user it works perfectly fine.
I don't know if this is because I installed dotnet as a snap package
I had the same issue and unfortunately the dotnet issue page was not working.
To fix this issue I had to install the package with apt instead of snap.
sudo snap remove dotnet-sdk // if needed
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
sudo apt install apt-transport-https
sudo apt-get install -y dotnet-sdk-5.0
Remove snap first
sudo snap remove dotnet-sdk
Manually download Dotnet SDK https://dotnet.microsoft.com/en-us/download/dotnet/6.0
When your download completes, open the terminal and run the following commands to extract the SDK to make the commands available at the terminal.
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-6.0.101-linux-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
one last thing
Edit shell profile to permanently

Why does the system hint 'invalid syntax', when I am executing 'pip install shadowsocks' on centos6

When I am executing pip install shadowsocks on my vps for install the shadowsocks, it tells me invalid syntax. I prepare to install shadowsocks on my vps this morning, I am running yum update -y and yum install python-setuptools && easy_install pip in turns.
After that I am executing pip install shadowsocks and got a hint invalid syntax. I am reading the hint seriously, but I can't read it very well.
I do not understand what the hint want to tell me.
what is you do something like this
sudo apt-get update && sudo apt-get install python-pip

Log in RStudio with AWS EC2 instance

I managed to follow all the steps to create EC2 instance and install R Server on it.
But now when I go to RStudio to connect (which looks something like "ec2-[Public IP]-.eu-west-3.compute.amazonaws.com:8787")
I am asked a username and a password but I did not configure any:
I tried rstudio (username) and rstudio (password) but it does not work.
Anyone knows how I can find the username and the password to connect?
Thanks.
M
If this is using the AMI from http://www.louisaslett.com/RStudio_AMI/, the default password recently changed to the instance ID of the EC2. A code starting with i- and 17 alphanumeric characters, for example.
Username is still rstudio.
You can create a user/password in Linux and use it to log in
#add user(s)
useradd username
echo username:password | chpasswd
here is a detailed blog from on running R on AWS
I was having the same issue (I believe there is no ubuntu password for an AWS EC2 Instance and R studio requires one).
You can add a new user by typing the following: sudo adduser YOURUSERNAME and follow the terminal instructions (press enter to skip the info you do not want to give). Head over to the IP xxx.xxx.xxx.xxx:8787 and you should be able to log in now.
How to install R studio 3.4.4, upgrade to 3.6.0 and add a username (Ubuntu 18):
sudo apt update
sudo apt-get install -y r-base r-base-dev
sudo apt install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.2.1335-amd64.deb
sudo gdebi rstudio-server-1.2.1335-amd64.deb
sudo chmod 777 -R /usr/local/lib/R/site-library
sudo adduser YOURUSERNAME
#########
# Upgrade R
echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y r-base r-recommended r-base-dev
# Rstudio dependency issues (when installing devtools) - I installed from an AWS EC2 account so I need to change my root password.
sudo passwd root
su root
apt-get -y build-dep libcurl4-gnutls-dev

opencpu cloud server installation guide on ubuntu 16.04

Would anyone know or like to share their note on installing opencpu cloud server on ubuntu 16.04?
I thought it is easy, but we saw many error here and there when following the instructions. I am new to opencpu. And, I don't have much experience on apache and nignx.
Here is the long story:
I created a new and clean ubuntu 16.04 server from microsoft azure vm, and installed opencpu cloud server following:
# Requires Ubuntu 14.04 (Trusty) or 16.04 (Xenial)
sudo add-apt-repository -y ppa:opencpu/opencpu-1.6
sudo apt-get update
sudo apt-get upgrade
# Installs OpenCPU server
sudo apt-get install -y opencpu
The server reported insserv error when running opencpu init script
update-rc.d: error: insserv rejected the script header dpkg
We then did some goolge and fix around, we got apache2 running, but when called:
curl http://localhost/ocpu/info
received 404 error.
FYI, the single user server runs fine.
The solution we found is that opencpu need mod_R to be turned on from apache2:
sudo a2enmod R
You need first to change to dir:
/etc/apache2/mods-available
And, make sure R.load file exists.
After running a2enmod command, should see a link to R.load (R module) in
/etc/apache2/mods-enable
Thank you y g for your question and response .. I had the same problem i try what you have mentioned in your comment but
curl http://localhost/cpu/info
takes along time without no response.
Thank you.
I used opencpu 1.5 works without bugs on ubuntu 16.04
sudo add-apt-repository -y ppa:opencpu/opencpu-1.5
sudo apt-get update
sudo apt-get upgrade
Install R and then install opencpu
sudo apt-get install r-base r-base-dev
sudo apt-get install -y opencpu
Also you should probably install Rstudio for IDE access
sudo apt-get install rstudio-server
To login to R you'll need to make a new user - follow the prompts
sudo adduser myname
Now just to make sure its all working
sudo service opencpu restart
sudo service rstudio-server restart
And try something like to check if its working
curl -L -v localhost/ocpu/library/
which should return a list of packages now installed on Ubuntu like this
Final Screenshot

Cron job in Plesk

In Plesk panel I get the log error : wget command not found. But there is already wget command installed.
How could I solve this issue ?
cron command: wget -q -O – http://www.example.com/wp-cron.php?doing_wp_cron
This should simple and straight forward. what you need to do is install
On Ubuntu: sudo apt-get install wget
or on Fedora/Redhat/Centos: sudo yum install wget
make sure you have rights to run apt-get install or yum install. After you install wget that error in Plesk should go away. By the way, instead of wget -q -O you can also use cURL as an alternate solution to call your cron script.

Resources