Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / querySelector.md
Created February 15, 2016 10:18
Get elements with one class but not another without iterating - Javascript
@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 / 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 / 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 / nginx_virtual_host.md
Last active August 19, 2017 19:39
How To SetUp NGINX VirtualHosts on Ubuntu 14.04

#Set up nginx virtual host on Ubuntu 14.04

In this example, we will create a website called devops.com and create site to publish "Hello World!"
We are assuming you have nginx installed. If not, follow the steps here to install nginx .   We want to make the necessary directories in /var/www folder.

sudo mkdir -p /var/www/devops.com/httpdocs

And we want to write Hello world! in Index.html file.

@kosyfrances
kosyfrances / self_signed_ssl.md
Last active August 26, 2024 16:30
How to create self signed SSL certificate on Nginx for Ubuntu 14.04

Create the SSL certificate -
Let us make a directory to store all our ssl configuration.

sudo mkdir /etc/nginx/ssl

Next, create the key -

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt

These options will create both a key file and a certificate.

@kosyfrances
kosyfrances / mysql_docker.md
Last active April 5, 2016 15:12
MYSQL server in docker container failed to start

Mysql failed to start, and I got these errors

160405  8:58:33  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
160405 08:58:33 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
@kosyfrances
kosyfrances / ansible_unknown_encoding.md
Created May 8, 2016 20:40
Running ansible playbook gives unknown encoding error

While running ansible playbook, I encountered this error

Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 110, in <module>
    display.error("Unexpected Exception: %s" % to_unicode(e), wrap_text=False)
  File "/Library/Python/2.7/site-packages/ansible/utils/display.py", line 261, in error
    self.display(new_msg, color=C.COLOR_ERROR, stderr=True)
  File "/Library/Python/2.7/site-packages/ansible/utils/display.py", line 124, in display
    msg2 = to_bytes(msg2, encoding=self._output_encoding(stderr=stderr))
 File "/Library/Python/2.7/site-packages/ansible/utils/unicode.py", line 208, in to_bytes