#Install Nginx
For Ubuntu 10.04 and newer:
sudo -s
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update
apt-get install nginx
#Install Nginx
For Ubuntu 10.04 and newer:
sudo -s
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update
apt-get install nginx
#Setting up a simple react project
In the shell,
mkdir project_name
Create new project directory.
cd project_name
Step into the project directory created.
npm init
This utility will walk you through creating a package.json file.
Use npm install <pkg> --save
afterwards to install a package and save it as a dependency in the package.json file.
npm install --save react react-dom
npm install --save-dev html-webpack-plugin webpack webpack-dev-server babel-{core,loader} babel-preset-react
If you want to get an element with a class but not another, For instance, I want an element with class1 but not class2, How do I do that without iterating?
Using querySelector, you can do -
var getClassOne = document.querySelectorAll( '.class1:not(.class2)' );
More information can be found here - http://stackoverflow.com/questions/19492716/get-elements-with-one-class-but-not-another-without-iterating
I had this error while running vagrant provision - ==>
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.```
Even when trying docker commands I got something like -
```ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?```
For this, on local machine do:
ssh-keygen
and agree with all defaults (if you have no reasons do otherwise)
cat ~/.ssh/id_rsa.pub
and copy that key
On remote machine:
mkdir ~/.ssh && chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2
To uninstall what is not in requirements.txt | |
pip freeze | grep -v -f requirements.txt - | xargs pip uninstall -y |
While trying to run functional tests in python on an Ubuntu EC2 instance using
python manage.py test functional_tests --liveserver=superlist-staging.tk
I got this error
RuntimeError: Could not find firefox in your system PATH. Please specify the firefox binary location or install firefox
So I did sudo apt-get install firefox
to install firefox.
Afterwards I tried running the tests again and got another error:
WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
We had this error when I was trying to use django rest swagger in the api we built,
unknown locale: UTF-8
Request Method: GET
Request URL: http://localhost:8000/docs
Django Version: 1.8.2
Exception Type: ValueError
Exception Value:
unknown locale: UTF-8```
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizeable computing capacity—literally, servers in Amazon's data centers—that you use to build and host your software systems.
If you are new to Amazon EC2. First set up using this link. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html
Then launch and connect to your new instance using this http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
If you need to create a nonroot user, here’s how:
# these commands must be run as root
root@server:$ useradd -m -s /bin/bash elspeth # add user named elspeth