View Effective_Engineer.md

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

View eca.py
#!/usr/bin/env python3
__author__ = "Ahmad Alhour"
__date__ = "2017-10-29"
__website__ = "https://gist.github.com/aalhour/533b8ea1a1d71bbfb026c16d956aa6d2"
"""
eca.py
Elementary Cellular Automata PNG images generator. Based on Nicolas Seriot's gist (https://goo.gl/fh4d5Y).
View async_psycopg2.py
#!/usr/bin/env python
__author__ = 'Frank Smit <frank@61924.nl>'
__version__ = '0.1.0'
import functools
import psycopg2
from tornado.ioloop import IOLoop, PeriodicCallback
View supervisord.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
View Django_Gunicorn_Nginx.makefile
SHELL := /bin/bash
#-----------------------------------------------
# __ __ _ __ _ _
# | \/ | __ _| | _____ / _(_) | ___
# | |\/| |/ _ | |/ / _ \ |_| | |/ _ \
# | | | | (_| | < __/ _| | | __/
# |_| |_|\__,_|_|\_\___|_| |_|_|\___|
#
#-----------------------------------------------
# Makefile to use:
View gunicorn.conf.py
bind = "127.0.0.1:9006"
workers = 2
worker_class = 'gevent'
max_requests = 1000
timeout = 30
keep_alive = 2
preload = True
View digitalocean-deploy-django
deploy django app on digitalocean
=================================
# Packages
sudo apt-get install python-pip python-dev python-virtualenv supervisor nginx
# Create dirs
mkdir -p /webapps/my-project/{logs,run}
View gunicorn_start.bash
#!/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
View .gitconfig
[gui]
recentrepo = /home/ahmada/Workspace/tyra-5
[user]
email = ahmad.alhour@trustyou.net
name = Ahmad Alhour
[alias]
# one-line log
l = "log --pretty=format:"%C(yellow)%h\\ %ad%C(red)%d\\ %C(reset)%s%C(blue)\\ [%cn]" --decorate --date=short --graph"