Steps with explanations to set up a server using:
- Virtualenv
- Virtualenvwrapper
- Django
- Gunicorn
| -- TermTheme.scpt | |
| -- Ken Hansen 02/2012 | |
| -- Sets theme of current terminal window/tab | |
| ----------------------- | |
| -- Arguments | |
| ----------------------- | |
| -- If a theme name is provided on the command line then set to that | |
| -- Example | |
| -- osascript TermTheme.scpt Grass |
| #!/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 |
| #!/usr/bin/php | |
| <?php | |
| $in = fopen('php://stdin', 'r'); | |
| $result=array(); | |
| $format='_.'; | |
| while($line=fgetcsv($in, 0, "\t")) { | |
| $result[]='|'.$format.implode('|'.$format, $line).'|'; | |
| $format=''; | |
| } | |
| fclose($in); |
| curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s |
| # creating and testing permissions and test groups in django tests. | |
| from django.contrib.auth.models import User, Permission, Group | |
| from django.test import TestCase | |
| from django.test import Client | |
| class ExampleGroupPermissionsTests(TestCase): | |
| def setUp(self): | |
| #create permissions group |
| FROM nginx:alpine | |
| # stock verison from php:alpine image | |
| # ensure www-data user exists | |
| RUN set -x \ | |
| && addgroup -g 82 -S www-data \ | |
| && adduser -u 82 -D -S -G www-data www-data | |
| # 82 is the standard uid/gid for "www-data" in Alpine | |
| # http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2 |
| <?php | |
| /** | |
| * This is a quick example of how to stream a file to a client, likely a browser, | |
| * using Zend Expressive. There are a lot of factors which it doesn't take in to | |
| * account. But for the purposes of a quick intro, this should suffice. | |
| */ | |
| class ViewDocumentPageAction | |
| { | |
| protected function downloadFile() | |
| { |
| Possible values for ext-name: | |
| bcmath | |
| bz2 | |
| calendar | |
| ctype | |
| curl | |
| dba | |
| dom | |
| enchant |
sentrySENTRY_SECRET_KEY to random 32 char stringdocker-compose up -ddocker-compose exec sentry sentry upgrade to setup database and create admin userdocker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done laterdocker-compose restart sentry9000