Skip to content

Instantly share code, notes, and snippets.

View jackdesert's full-sized avatar

Jack Desert jackdesert

View GitHub Profile
# Using an RLock so that one decorated function may call
# another decorated function without blocking
from threading import RLock
class EasyLock:
# Provides a decorator that wraps one or more functions
# in an threading.RLock.
#
# When two or more functions are decorated using the same *name*,
# the lock applies to all those functions collectively.
# This docuemtation
# https://uwsgi-docs.readthedocs.io/en/latest/Python.html#paste-support
#
# Gives this example
# uwsgi --paste config:/opt/tg2env/addressbook/development.ini --socket :3031 -H /opt/tg2env
# Running on my machine (paths adapted to Ubuntu 16.04)
$ uwsgi --paste config:/home/ubuntu/stethoscope/production.ini --socket :3031 -H /home/ubuntu/env
# Gives this error:
@jackdesert
jackdesert / gist:3015200944599fe2f13853287ad4e670
Created July 10, 2018 14:00
pip install uwsgi - python3_plugin.so no found
# Install System-wide
sudo apt install -y uwsgi-core uwsgi-plugin-python3
# Run system uwsgi: this works!
$ cd ~/myproject
$ uwsgi --ini production.ini
[uWSGI] getting INI configuration from production.ini
# Install uwsgi via pip
@jackdesert
jackdesert / gist:52db46f680c9e76b0c85ddb55b3e03ab
Last active July 9, 2018 16:24
WSGI endpoing for pyramid app
# project is named "stethoscope"
# project was built from pyramid-cookiecutter-alchemy
##############################################################
# Here are the contents of stethoscope/stethoscope/__init__.py
##############################################################
ubuntu@rubinius-test:/opt/elitecarerails$ rc
main # Rubinius::Loader at
core/loader.rb:852 (+90)
script # Rubinius::Loader at
core/loader.rb:667 (+343)
load_script # Rubinius::CodeLoader at
core/code_loader.rb:280 (+60)
load # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Script) at
core/code_loader.rb:119 (+81)
run_script # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Script) at
$ dpkg-query -L libssl-dev
dpkg-query: package 'libssl-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-query -L libssl1.0.2
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
/usr/lib/x86_64-linux-gnu/openssl-1.0.2
/usr/lib/x86_64-linux-gnu/openssl-1.0.2/engines
$ dpkg -S ssl.h
libssl1.0-dev:amd64: /usr/include/openssl/ssl.h
libssl1.0-dev:amd64: /usr/include/openssl/kssl.h
libgnutls28-dev:amd64: /usr/include/gnutls/openssl.h
$ apt-cache search libssl
dcmtk - OFFIS DICOM toolkit command line utilities
dlang-openssl - D version of the C headers for openssl
libdcmtk-dev - OFFIS DICOM toolkit development libraries and headers
libdcmtk12 - OFFIS DICOM toolkit runtime libraries
libssl-dev - Secure Sockets Layer toolkit - development files
libssl-doc - Secure Sockets Layer toolkit - development documentation
libssl-ocaml - OCaml bindings for OpenSSL (runtime)
libssl-ocaml-dev - OCaml bindings for OpenSSL
find: ‘/usr/share/jitsi-videobridge/.java/.userPrefs’: Permission denied
find: ‘/usr/share/jicofo/.java/.userPrefs’: Permission denied
/usr/include/gnutls/openssl.h
/usr/include/openssl/ssl.h
/usr/include/openssl/kssl.h
find: ‘/usr/local/pgsql/data’: Permission denied