This document has now been incorporated into the uWSGI documentation:
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Steps with explanations to set up a server using:
| # Optimized my.cnf configuration for MySQL/MariaSQL | |
| # | |
| # by Fotis Evangelou, developer of Engintron (engintron.com) | |
| # | |
| # === Updated December 2018 === | |
| # | |
| # The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores. | |
| # If you have less or more resources available you should adjust accordingly to save CPU, | |
| # RAM and disk I/O usage. | |
| # The settings marked with a specific comment or the word "UPD" after the value |
| #!/bin/bash | |
| # Script for checking if SSH port is open | |
| # Only checks that port is open. Not that actually SSH connection can occur | |
| counter=0 | |
| result="ssh disabled" | |
| if [ -z "$1" ] | |
| then | |
| echo "hostname argument required. Example ssh_port_checker.sh 10.1.1.1" |
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
| /** | |
| * Convert iframes to divs via ajax iframe_to_div jQuery Plugin | |
| * | |
| * Uses javascript to replace iframes with divs containing their source content | |
| * by loading via ajax. If you use this to load vanilla html snippets, this has the | |
| * effect of applying the page's css to your vanilla html snippet. | |
| * | |
| * This will not work if the iframe src is not a relative link due to ajax restrictions across domains. | |
| * | |
| * As an example: |
| #change it to latest version | |
| #NGX_VERSION=1.12.0; | |
| NPS_VERSION=1.11.33.4; | |
| echo "Changing Directory to $HOME..." | |
| cd $HOME; | |
| echo "Nginx version to install: " && \ | |
| read NGINX_VERSION && \ | |
| echo "Downloading nginx-$NGINX_VERSION..." && \ | |
| wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \ |
| #!/bin/sh | |
| # | |
| # Script to prepare and restore full and incremental backups created with innobackupex-runner. | |
| # | |
| # This script is provided as-is; no liability can be accepted for use. | |
| # | |
| # UPDATE: 21/11/2015 | |
| INNOBACKUPEX=innobackupex | |
| INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX |
| server { | |
| # see: http://wiki.nginx.org/Pitfalls | |
| # see: http://wiki.nginx.org/IfIsEvil | |
| listen 80; | |
| root /app; | |
| index index.html index.htm index.php; | |
| error_page 404 /index.php; | |
| # Make site accessible from http://set-ip-address.xip.io |
| <?php | |
| date_default_timezone_set('UTC'); | |
| // Create keys at hhttps://portal.aws.amazon.com/gp/aws/securityCredentials | |
| class AmazonClient { | |
| /** @var cURL */ | |
| public $curl; |
| /* | |
| * Display Image from the_post_thumbnail or the first image of a post else display a default Image | |
| * Chose the size from "thumbnail", "medium", "large", "full" or your own defined size using filters. | |
| * USAGE: <?php echo my_image_display(); ?> | |
| */ | |
| function my_image_display($size = 'full') { | |
| if (has_post_thumbnail()) { | |
| $image_id = get_post_thumbnail_id(); | |
| $image_url = wp_get_attachment_image_src($image_id, $size); |