Steps with explanations to set up a server using:
- Virtualenv
- Virtualenvwrapper
- Django
- Gunicorn
from django.views.generic import View | |
from django.http import ( | |
QueryDict, HttpResponse, HttpResponseBadRequest, | |
HttpResponseNotFound, HttpResponseNotAllowed, | |
) | |
from django.core.serializers.json import DjangoJSONEncoder | |
from django.core.exceptions import ( | |
ObjectDoesNotExist, ValidationError, | |
) | |
from django.db import transaction |
$ brew remove git | |
$ brew remove curl | |
$ brew install openssl | |
$ brew install --with-openssl curl | |
$ brew install --with-brewed-curl --with-brewed-openssl git |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
func gen(done <-chan struct{}, nums ...int) <-chan int { | |
out := make(chan int) | |
go func() { |
require 'optparse' | |
require 'yaml' | |
require 'base64' | |
options = { | |
config_path: File.join(ENV['HOME'], '.kube', 'config'), | |
write_dir: File.join(ENV['HOME'], '.kube') | |
} | |
OptionParser.new do |opts| |
pip install streamlit | |
pip install spacy | |
python -m spacy download en_core_web_sm | |
python -m spacy download en_core_web_md | |
python -m spacy download de_core_news_sm |
#!/bin/bash | |
NAME="hello_app" # Name of the application | |
DJANGODIR=/webapps/hello_django/hello # Django project directory | |
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
USER=hello # the user to run as | |
GROUP=webapps # the group to run as | |
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
Django documentation says to use:
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.
I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:
1) Filter Table
Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.