I hereby claim:
- I am docapotamus on github.
- I am docapotamus (https://keybase.io/docapotamus) on keybase.
- I have a public key ASA1xy2FMb6q_6Qp8HyCn6HadLHgpgMayb8krdfzgB9wlAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> | |
| <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> |
| joe@XXXXXX:~$ curl -I https://pjuu.com/ | |
| HTTP/1.1 200 OK | |
| Server: nginx | |
| Date: Tue, 07 Mar 2017 16:05:54 GMT | |
| Content-Type: text/html; charset=utf-8 | |
| Content-Length: 4525 | |
| Connection: keep-alive | |
| Vary: Accept-Encoding | |
| Set-Cookie: session=4e8bf10d360e4b129bdb1319ad3ab15c; Secure; HttpOnly; Path=/ | |
| Strict-Transport-Security: max-age=31536000 |
| # Work successfully in my tests | |
| resp = self.client.post( | |
| url_for('posts.post'), | |
| data={ | |
| 'body': 'Test', | |
| 'upload': '', | |
| }, | |
| follow_redirects=True | |
| ) |
| >>> def func1(): | |
| ... for i in xrange(10): | |
| ... yield i | |
| ... | |
| >>> def func2(): | |
| ... for i in func1(): | |
| ... print i | |
| ... | |
| >>> func1() | |
| <generator object func1 at 0x7feb54159960> |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "path/filepath" | |
| "sort" | |
| "strings" | |
| ) |
| # UUID v1mc Python | |
| import random | |
| from uuid import uuid1 | |
| random_node = random.randrange(0, 1<<48L) | 0x010000000000L | |
| print uuid1(random_node).hex | |
| # Covert hex encoded UUID back to a UUID | |
| from uuid import UUID |
| PJUU_SETTINGS=/pjuu/conf/settings.py WEB_CONCURRENCY=`nproc` gunicorn -b 127.0.0.1:8000 -D -k gevent pjuu.wsgi |
Swappiness controls the tendancy the kernel wishes to swap.
Even with free memory the kernel may swap.
100 means aggressively swap 0 means wait until the last minute to swap
To check current swappiness
cat /proc/sys/vm/swappiness
| [Unit] | |
| Description=Pjuu | |
| After=network.target | |
| [Service] | |
| PIDFile=/run/pjuu/pid | |
| User=pjuu | |
| Group=pjuu | |
| WorkingDirectory=/pjuu/app | |
| ExecStart=/pjuu/venv/bin/gunicorn --pid /run/pjuu/pid wsgi:application |