Use:
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_TYPE=en_US.UTF-8
It works for Debian.
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_TYPE=en_US.UTF-8
mount -rw -o remount /
apt-get install python-pip
pip install virtualenv
su myuser
virtualenv ~/.myenv
virtualenv ~/.myenv
source ~/.myenv/bin/activate
(.myenv)# pip install gunicorn
Note: DO NOT create /tmp/gunicorn.sock#!/bin/bash
NAME="myproject" # Name of the application
DJANGODIR=/path/to/project # Django project directory
SOCKFILE=/tmp/gunicorn.sock # we will communicte using this unix socket
USER=john # the user to run as
GROUP=www-data # the group to run
NUM_WORKERS=9 # twice the number of cpu cores
DJANGO_SETTINGS_MODULE=sai.settings # which settings file should Django use
DJANGO_WSGI_MODULE=sai.wsgi # WSGI module name
echo "Starting $NAME as `whoami`"
# Activate the virtual environment
cd $DJANGODIR
source /home/user/.virtualenv/bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR
# Start your Django Unicorn
# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
exec /home/john/.virtualenv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER --group=$GROUP \
--bind=unix:$SOCKFILE \
--log-level=debug \
--log-file=-
nano /etc/init/gunicorn.conf
description "Gunicorn application server handling myproject"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid john
setgid www-data
chdir /path/to/project
exec bash gunicorn.sh
service gunicorn restart
The only remaining step is to pass request to gunicorn in nginx, by a file like this:
Note 2: If you just started upstart, you may need to reboot to be able to service gunicorn restart.upstream myproject {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host;
server unix:///tmp/gunicorn.sock; # the socket will be created automatically
}
server {
#...other stuff
location / {if (!-f $request_filename) {
proxy_pass http://myproject;
break;
}
}
}
deb http://ftp.uk.debian.org/debian jessie-backports main
apt-get update
apt-get install ffmpeg
/etc/apt/sources.list (with your preferred mirror):deb http://ftp.debian.org/debian jessie-backports main
apt-get update
apt-get install ffmpeg
Which installs `ffmpeg version 3.2.2-1~bpo8+1`
Thanks this good fella, DanOptions +Indexes IndexOptions FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=*
<Location /admin> Order deny,allow Deny from all Allow from 192.168.10.111 Allow from 111.222.333.444 </Location>
# service httpd restart
<Location /admin> AuthUserFile /var/www/htpasswd/.htpasswd AuthName "Password Protected Area" AuthType Basic Require valid-user </Location>
#htpasswd -cm /var/www/htpasswd/.htpasswd myuser New password: Re-type new password: Adding password for user myuser
# service httpd restart
apt-get install redis-server -y
2.8.17 which doesn't have the features in 3.0+.apt-get update apt-get install build-essential -y wget http://download.redis.io/releases/redis-stable.tar.gz tar xzf redis-stable.tar.gz cd redis-stable make apt-get install tcl8.5 -y # optionally run "make test" to check everything is ok make install
cd utils bash ./install_server.sh
redis-server --version
service redis_6379 [start | stop | restart]
redis-cli
pdftk file.pdf output uncompressed.pdf uncompress
sed -e "s/ORIGINALSTRING/NEWSTRING/g" <uncompressed.pdf >modified.pdf
pdftk modified.pdf output recompressed.pdf compress