Skip to content

Instantly share code, notes, and snippets.

@kosyfrances
kosyfrances / nginx_ubuntu.md
Last active March 14, 2016 11:05
How to install nginx on Ubuntu 14.04 LTS

#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
@kosyfrances
kosyfrances / ubuntu_mac_file_share.md
Last active March 16, 2016 10:02
Access shared folder on mac from ubuntu Linux

Share the folder on your mac as usual.

On ubuntu, set up Samba client.
sudo apt-get install cifs-utils samba-common samba winbind

To mount up partner
First, let’s create a directory to attach our Mac share to:
sudo mkdir -p /mnt/tmpshare
…and now connect our share to that new directory:

@kosyfrances
kosyfrances / react.md
Last active March 5, 2016 21:05
Setting up a simple react project

#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

@kosyfrances
kosyfrances / querySelector.md
Created February 15, 2016 10:18
Get elements with one class but not another without iterating - Javascript
@kosyfrances
kosyfrances / docker_not_running.md
Created February 3, 2016 11:27
Docker error while trying to connect

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?```
@kosyfrances
kosyfrances / fabric_ssh.md
Last active February 2, 2016 11:02
To configure the system so that you can do fabric (i.e. SSH) without password.

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

@kosyfrances
kosyfrances / uninstall.txt
Created January 15, 2016 10:47
To uninstall what is not in requirements.txt
To uninstall what is not in requirements.txt
pip freeze | grep -v -f requirements.txt - | xargs pip uninstall -y
@kosyfrances
kosyfrances / selenium_firefox_tdd.md
Last active September 6, 2020 22:31
Unable to call firefox from selenium in python on AWS machine while running functional tests

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.

@kosyfrances
kosyfrances / unknown_locale.md
Last active January 21, 2016 09:02
unknown locale: UTF-8 error

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```
@kosyfrances
kosyfrances / aws_ec2.md
Last active January 7, 2016 08:53
Setting up and launching an Amazon EC2 ubuntu instance.

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