Using JSON in Postgres by example.
- Download and install: Docker Toolbox
- Open Docker Quickstart Terminal
- Start a new postgres container:
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
| import datetime | |
| import logging | |
| import os | |
| import re | |
| import constants | |
| log_separator = "\n====================================================================================================" | |
Using JSON in Postgres by example.
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres| #!/bin/bash | |
| # A lighter graphite for raspberry pi/raspbian wheezy. | |
| # For when you don't need memcache/rabbitmq/full uWSGI server/etc | |
| # Not fully tested on a clean install. This is just what it *should* take. | |
| # Installing supervisor because upstart conflicts with sysvinit | |
| aptitude update && aptitude install gcc python-dev python-pip python-cairo python-pysqlite2 supervisor | |
| pip install django==1.4.3 |
| # get this: https://github.com/jedie/python-ping.git | |
| import os | |
| import string | |
| from time import time, sleep | |
| from ping import Ping | |
| class QuietPing(Ping): | |
| def print_failed(self): |
| <?php | |
| // See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html | |
| // Start a session (which should use cookies over HTTP only). | |
| session_start(); | |
| // Create a new CSRF token. | |
| if (! isset($_SESSION['csrf_token'])) { | |
| $_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32)); | |
| } |