Skip to content

Instantly share code, notes, and snippets.

View jhallard's full-sized avatar
🏠
Working from home

John Allard jhallard

🏠
Working from home
View GitHub Profile
@md2perpe
md2perpe / .gitignore
Last active April 17, 2024 23:36
StackOverflow 64497615
venv/
*.pyc
@andrisasuke
andrisasuke / install_m2crypto.txt
Created May 2, 2017 10:12
python install m2crypto on Mac OS X
$> brew install openssl
$> brew install swig
$> env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto
@mattseymour
mattseymour / build-instructions
Created May 1, 2017 06:58
Build Python 3.6 from source for Ubuntu and Debian
Prerequisties install:
- sudo apt-get install build-essential checkinstall
These are the dependancies required by python:
- sudo apt-get install libbz2-dev libc6-dev libgdbm-dev libncursesw5-dev libreadline-gplv2-dev libssl-dev libsqlite3-dev tk-dev
Download the tar source file from python.org (at the time of writing 3.6.1 is the latest release):
- wget -O ~/Downloads/python3.6.1.tgz https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
Via command line navigate to the downloaded file directory:
@kerma
kerma / example.py
Created August 3, 2016 09:01
Tornado access log split to STDOUT
import sys
import logging
import tornado.httpserver
import tornado.log
import tornado.options
import tornado.web
logger = logging.getLogger(__name__)
tornado.options.define("access_to_stdout", default=False, help="Log tornado.access to stdout")
@Brainiarc7
Brainiarc7 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Last active March 26, 2024 18:18
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@vincenthsu
vincenthsu / onvif_request.py
Created January 12, 2016 08:26
ONVIF http request example
#!/usr/bin/env python3
import hashlib
import os
import base64
from datetime import datetime
username = "admin"
password = "12345"
# created = datetime.now().strftime("%Y-%m-%dT%H:%M:%S.000Z")
@joshz
joshz / memoized.py
Created January 6, 2012 14:16
Memoizing decorator, caches function's return value, expires after ttl time in seconds or ctl calls - Python
import time
class memoized(object):
def __init__(self, ctl=3, ttl=2):
self.cache = {}
self.ctl = ctl
self.ttl = ttl
self._call_count = 1
def __call__(self, func):