Skip to content

Instantly share code, notes, and snippets.

@brizzbane
brizzbane / deadsnakes-python38-ubuntu-bionic.md
Last active February 15, 2021 03:18
Deadsnakes python 3.8 on Ubuntu 18.04 LTS

Deadsnakes python 3.8.6 on Ubuntu 18.04 LTS

The deadsnakes PPA make the latest stable versions of python available on LTS distributions. I now find it preferable to installing from source, whether from download or using pyenv.

The following was tested on a Ubuntu 18.04.5 LTS desktop with python 2.7.15 and 3.6.9 as the shipping system python versions. The pip3 binary was install using the stock python3-pip package, updated with pip3 install --upgrade pip.

One of the key reasons this works for me is that I've been aggressive about individually virtualizing project environments with venv.

First, add the deadsnakes PPA to apt:

'''
Copyright (C) 2017-2020 Bryant Moscon - bmoscon@gmail.com
Please see the LICENSE file for the terms and conditions
associated with this software.
'''
import logging
import itertools
from datetime import datetime as dt, timezone as tz
from yapic import json
# RFC 2822 - style email validation for Python
# (c) 2012 Syrus Akbary <me@syrusakbary.com>
# Extended from (c) 2011 Noel Bush <noel@aitools.org>
# for support of mx and user check
# This code is made available to you under the GNU LGPL v3.
#
# This module provides a single method, valid_email_address(),
# which returns True or False to indicate whether a given address
# is valid according to the 'addr-spec' part of the specification
# given in RFC 2822. Ideally, we would like to find this
https://www.digitalocean.com/community/tutorials/how-to-install-go-on-debian-8
https://stackoverflow.com/questions/25216765/gobin-not-set-cannot-run-go-install
set -xg GOROOT /usr/local/go $GOROOT
set -xg GOPATH $HOME/Develop
set -xg PATH /usr/local/go/bin $GOPATH/bin $PATH
import logging
import time
import pyuv
import gruvi
import pycurl
from io import BytesIO
from gruvi.futures import Future
@brizzbane
brizzbane / gist:2053dde3f4d81d7dbffa
Last active November 27, 2021 06:36
libcurl libuv
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
__author__ = 'brizzbane'
#for some reason, 'hello world' is only displayed some of the time (i.e. doing python thisfile.py producer 5 times, 'hello world' may only be printed 3
import logging
from mtm.v2.core.log import configure_logging
configure_logging()
import sys
from kombu import Exchange, Queue
from kombu.mixins import ConsumerMixin
__author__ = 'brizzbane'
from elasticsearch_dsl import DocType
from copy import deepcopy
from elasticsearch import Elasticsearch
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=['localhost'])
client = Elasticsearch()
class EmailDomain(DocType):
@brizzbane
brizzbane / gist:7369f539929b1fa239ef
Created August 3, 2015 20:21
serialization problems 2
__author__ = 'brizzbane'
from elasticsearch_dsl import DocType
from copy import deepcopy
from elasticsearch import Elasticsearch
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=['localhost'])
client = Elasticsearch()
class EmailDomain(DocType):