sudo: stop: command not found - amazon-web-services

I'm running a shiny app on an amazon web services instance using shiny-server. I wanted to stop the shiny-server in order to set up password protection but when I was following a protocol that said to type sudo stop shiny-server I got this error sudo: stop: command not found.
I tried to look into it and tried to install sudo apt-get install upstart-sysv but now my error is stop: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused.
the aws instance is ubuntu 16.04, any help is appreciated

You should use sudo systemctl stop shiny-server
Most major Linux distros, including Ubuntu 15.04+, now use systemd for management and configuration.
Earlier versions of Ubuntu used upstart (where the command was sudo stop shiny-server).
For more, see shiny-server documentation.

Related

start cassandra on google cloud on debian vm

I have created a Debian VM and followed the steps to install cassandra on it. In the end, when I ran sudo apt update
sudo apt install cassandra
cassandra was installed and also automatically started.
However, cassandra wasn't added to PATH. I stopped cassandra using ps -aux|grep cassandra and kill pid. Now when I am trying to start it again using cassandra -f, I am getting several permission denied errors. eg
/usr/sbin/cassandra -f
OpenJDK 64-Bit Server VM warning: Cannot open file /var/log/cassandra/gc.log due to Permission denied
I can try using -R option and start Cassandra as root but it is not recommended. How can I start cassandra as normal user?

Unable to start VM - Minikube

I am trying to start the minikube using the minikube start command and this is the error i am getting. Even installed the latest version of virtual box but still it gives me this error.
Can someone please tell me why this is happening?
Follow the advice of the error message. Did you try installing virtualbox-dkms and the linux headers?
$ sudo apt update
$ sudo apt install virtualbox-dkms linux-headers-generic
Follow the instructions in the docs, if you aren't already: https://kubernetes.io/docs/tasks/tools/install-minikube/
First of all I would recomend you to install newest version of Minikbue (currently it is 1.5.2) and Kubectl.
Second thing check if your machine is supporting virtualization. It can bo done via command egrep -q 'vmx|svm' /proc/cpuinfo && echo yes || echo no.
If it is no you have to:
If you are running within a VM, your hypervisor does not allow nested virtualization. You will need to use the None (bare-metal) driver.
If you are running on a physical machine, ensure that your BIOS has hardware virtualization enabled.
Minikube set VirtualBox as default driver, but you can use other. Here under Hypervisor Setup you might find that you can also use KVM or None as driver for Linux OS.
Solutions:
1. As Minikube output advised, try to install
- $ sudo apt-get install virtualbox-dkms linux-headers-generic
- run $ sudo modprobe vboxdrv
- reinstall VirtualBox
2. If there is no virtualization option on your Laptop you can use Minikube with --vm-driver=none flag.
$ sudo minikube start --vm-driver=none
If you would use this option, you might need to specify --cpus=X and --memory=XXXX as default is requesting less resources.
Another think is that none driver provides limited isolation and may reduce system security and reliability. More info can be found here.
$ minikube start
๐Ÿ˜„ minikube v1.5.2 on Ubuntu 18.04
๐Ÿ”ฅ Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB)
...
$ sudo minikube start --vm-driver=none
๐Ÿ˜„ minikube v1.5.2 on Ubuntu 18.04
๐Ÿคน Running on localhost (CPUs=2, Memory=7470MB, Disk=9749MB) ...
After successfull installation, don't forget to execute mentioned commands.
โ–ช sudo mv /home/<your_user>/.kube /home/<your_user>/.minikube $HOME
โ–ช sudo chown -R $USER $HOME/.kube $HOME/.minikube

Django channels integrating with django

I'm following django channels tutorial in order to integrate it with django. But, at one point I confronted with error which I can't solve. In terminal Django says:
[Errno 111] Connect call failed ('127.0.0.1', 6379)
I think that problem is about with these lines in tutorial:
We will use a channel layer that uses Redis as its backing store. To start a Redis server on port 6379, run the following command:
$ docker run -p 6379:6379 -d redis:2.8
I'm working in Linux Ubuntu 17.04 and can't run command shown in above. When I run that command ubuntu terminal says:
docker: command not found
Result is still the same after installing 'docker' with 'sudo apt-get install docker'. How can I solve this problem? Is there other way to start redis server on specified port without installing docker?
From the first page of the tutorial:
This tutorial also uses Docker to install and run Redis. We use Redis as the backing store for the channel layer, which is an optional component of the Channels library that we use in the tutorial. Install Docker from its official website.
So, install docker on your ubuntu system, and the command docker will become available.

RDP into Linux Instance AWS

I am new to AWS.
I created a Linux free tier instance and its up and running as i am able to access it via ssh putty as i am a windows user.
Now, I wanted to RDP the Linux Instance to see the interface but i am unable to do so. I am unable to find any option for that.
As per my understanding by reading online forms, it is not possible to RDP LinuxInstance on AWS.
If anyone can give there expert opinion if it is possible to RDP the Linux Instance? If not then Is there any way I can access the graphical interface for Linux Instance in AWS or I just have to work with command line interface from my local machine?
Amazon had a page that described how to do this with various linux versions but they took it down. Here are the steps for Linux 16.04. I just did this on a new ubuntu ec2 instance and it worked fine.
sudo apt update && sudo apt upgrade
sudo sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
sudo /etc/init.d/ssh restart
sudo passwd ubuntu
sudo apt install xrdp xfce4 xfce4-goodies tightvncserver -y
echo xfce4-session> /home/ubuntu/.xsession
sudo cp /home/ubuntu/.xsession /etc/skel
sudo sed -i '0,/-1/s//ask-1/' /etc/xrdp/xrdp.ini
sudo service xrdp restart
RDP is a proprietary protocol developed by Microsoft, Linux servers do not come in with GUI, you need to SSH into Linux box and then install packages to enable desktop GUI functionality
Here is an article from AWS
https://aws.amazon.com/premiumsupport/knowledge-center/connect-ec2-centos-windows/
Note: Amazon Linux does not provide any desktop GUI functionality
try install GNOME packages i.e.,
$sudo yum -y groupinstall "Server with GUI"
$sudo systemctl enable xrdp; systemctl start xrdp
now try login from your windows machine using "windows remote desktop or any vnc client

Docker build has no network, but docker run has

If I want to build my Dockerfile, it can't connect to the network or at least DNS:
Sending build context to Docker daemon 15.95 MB
Sending build context to Docker daemon
Step 0 : FROM ruby
---> eeb85dfaa855
Step 1 : RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
---> Running in ec8cbd41bcff
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/InRelease
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease
W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/Release.gpg Could not resolve 'httpredir.debian.org'
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/Release.gpg Could not resolve 'httpredir.debian.org'
W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg Could not resolve 'security.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package build-essential
INFO[0001] The command "/bin/sh -c apt-get update -qq && apt-get install -y build-essential libpq-dev" returned a non-zero code: 100
But if I run exactly the same command via docker run it works:
docker run --name="test" ruby /bin/sh -c 'apt-get update -qq && apt-get install -y build-essential libpq-dev'
Does anybody have an idea, why docker build does not work? I have tried all DNS related tipps on StackOverflow, like starting docker with --dns 8.8.8.8 etc.
Thanks in advance
Check what networks are available on your host with the below command:
docker network ls
then pick one that you know is working, the host one could be a good candidate.
Now assuming you are in the directory where it is available your Dokerfile, build your image appending the flag --networks and change the <image-name> with yours:
docker build . -t <image-name> --no-cache --network=host
Docker definitely seems to have some network issues. I managed to fix this problem with
systemctl restart docker
... which is basically just the unix-level 'restart-the-daemon' command in Debian 8.
I had similar problem. But as I was running AWS linux i had no systemctl. I solved using:
sudo service docker restart
My docker build also failed while trying to run apt-get upgrade with the exact same errors. I was using docker-machine on Mac OSX and a simple docker-machine restart default solved this issue. No idea what initially caused this, though.
Another case of the above reported behaviour - this time building a docker image from Jenkins:
[...]
Step 3 : RUN apt-get update && apt-get install -y curl libapache2-mod-proxy-html
---> Running in ea7aca5dea9b
Err http://security.debian.org jessie/updates InRelease
Err http://security.debian.org jessie/updates Release.gpg
Could not resolve 'security.debian.org'
Err http://httpredir.debian.org jessie InRelease
[...]
In my case it turned out that the DNS wasn't reachable from within the container - but still from the docker host !? (The containers resolver configuration was okay(!))
After restarting the docker machine (a complete reboot - a 'docker.service restart' didn't do the trick) it's been working again.
So one of my activities (or of a colleague of mine) must have broken the docker networking then !?? Maybe some firewalld modification activity ???
I'm still investigating as I'm not sure which activity may have corrupted the docker networking then ...
I have the exact same issue with a Raspberry.
Start/stopping the service did not help, but re-installing the package (dpkg -i docker-hypriot_1.10.3-1_armhf.deb && service docker start in my case) immediately solved the situation : apt-get update manages to resolve and reach the servers.
There must be some one-shot actions in the installation process...
Also faced the same issue today. My workaround was to restart your docker-machine. In my case, it's on VirtualBox.
Once you power off it and then restart the machine, http://security.debian.org seemed resolved.
Hope this helps.
A couple of suggestions, not sure if they will work or not. Can you change the ...apt-get install -y... to ...apt-get install -yqq...
Also, has that image changed that you're trying to build from?