Skip to content

Instantly share code, notes, and snippets.

blackstrip /
Created November 25, 2022 02:54 — forked from tapanhp/
Python Logging module utilities
import datetime
import logging
import os
import re
import constants
log_separator = "\n===================================================================================================="
blackstrip /
Created August 11, 2019 13:43 — forked from rmtsrc/
Using JSON in Postgres by example

PostgreSQL JSON Cheatsheet

Using JSON in Postgres by example.

Quick setup via Docker

  1. Download and install: Docker Toolbox
  2. Open Docker Quickstart Terminal
  3. Start a new postgres container:
    docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
blackstrip /
Created September 18, 2017 02:38 — forked from rothwerx/
Bash: Graphite for Raspbian
# 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

Set up L2TP/IPsec VPN on Debian

Set up IPsec

Set up networking

blackstrip /
Created November 22, 2016 15:24 — forked from aleksclark/
Little Ping Monitor in python
# get this:
import os
import string
from time import time, sleep
from ping import Ping
class QuietPing(Ping):
def print_failed(self):
blackstrip / index.php
Created November 4, 2015 14:48 — forked from ziadoz/index.php
Simple PHP / jQuery CSRF Protection
View index.php
// See:
// Start a session (which should use cookies over HTTP only).
// Create a new CSRF token.
if (! isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32));