pip install pycurl

I ran pip install pycurl and got crazy error

Collecting pycurl
  Downloading pycurl-7.43.0.1.tar.gz (195kB)
    100% |████████████████████████████████| 204kB 6.0MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-build-msc3b_98/pycurl/setup.py", line 104, in configure_unix
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-msc3b_98/pycurl/setup.py", line 841, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/tmp/pip-build-msc3b_98/pycurl/setup.py", line 508, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/tmp/pip-build-msc3b_98/pycurl/setup.py", line 72, in __init__
        self.configure()
      File "/tmp/pip-build-msc3b_98/pycurl/setup.py", line 108, in configure_unix
        raise ConfigurationError(msg)
    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-msc3b_98/pycurl/

Apparently pip doesn’t really resolve all of pycurl’s dependencies.

Run apt-cache depends python-pycurl

python-pycurl
  Depends: python
  Depends: python
  Depends: <python:any>
    python
  Depends: libc6
  Depends: libcurl3-gnutls
  Suggests: libcurl4-gnutls-dev
  Suggests: python-pycurl-dbg
  Suggests: python-pycurl-doc

See the Suggests. So run

sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install python-pycurl-dbg
sudo apt-get install python-pycurl-doc

Run pip install pycurl, but that still fails due to x86_64-linux-gnu-gcc

Collecting pycurl
  Using cached pycurl-7.43.0.1.tar.gz
Building wheels for collected packages: pycurl
  Running setup.py bdist_wheel for pycurl ... error
  Complete output from command /home/elt/.virtualenvs/de/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bcazyxsx/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpfk6sldmcpip-wheel- --python-tag cp35:
  Using curl-config (libcurl 7.47.0)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/curl
  copying python/curl/__init__.py -> build/lib.linux-x86_64-3.5/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.1" -DHAVE_CURL_GNUTLS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.5m -I/home/elt/.virtualenvs/de/include/python3.5m -c src/docstrings.c -o build/temp.linux-x86_64-3.5/src/docstrings.o
  In file included from src/docstrings.c:4:0:
  src/pycurl.h:168:30: fatal error: gnutls/gnutls.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

To save you time, do

# upgrade pip if necessary
pip install --upgrade pip

# remove current pycurl
pip uninstall pycurl

# set PYCURL_SSL_LIBRARY
export PYCURL_SSL_LIBRARY=nss

# recompile and install pycurl
pip install --compile pycurl

Ref: http://pycurl.io/docs/latest/install.html

ADT Theft Protection Guarantee

From ADT’s website: https://www.adt.com/specials

Theft Protection Guarantee

If a burglary occurs while your ADT security system is armed, weʼll pay up to $500* of your insurance deductible.

*Subject to terms and conditions of the Residential Services Contract.

Um…

OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected

This seems to be an OOM exception, thus leads to db disconnection.

OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected

Retrying with exponential backoff could help.

Ref:
https://stackoverflow.com/questions/24130305/postgres-ssl-syscall-error-eof-detected-with-python-and-psycopg
https://github.com/psycopg/psycopg2/issues/533
https://dba.stackexchange.com/questions/175085/postgresql-ssl-syscall-error-eof-detected

Blue Laws

I was chatting with co-workers over blue laws. I never heard of blue laws so this sounds very interesting. It turns out there are states that cannot buy/sell alcohol on sundays.

I am still not sure where the ‘blue’ came from.

Ref:
http://www.historylink.org/File/9057
https://www.theguardian.com/commentisfree/2013/mar/03/no-sunday-alcohol-sales-states-prohibition
https://en.wikipedia.org/wiki/Blue_laws_in_the_United_States

https://www.britannica.com/topic/blue-law
http://www.todayifoundout.com/index.php/2014/12/blue-laws-come/

Get comfortable with being uncomfortable – Luvvie Ajayi

https://www.ted.com/talks/luvvie_ajayi_get_comfortable_with_being_uncomfortable/

Learn Git Branching

A nice game to learn git.

https://learngitbranching.js.org/

Go West – Pet Shop Boys

(Together) We will go our way
(Together) We will leave someday
(Together) Your hand in my hands
(Together) We will make our plans

(Together) We will fly so high
(Together) Tell all our friends goodbye
(Together) We will start life new
(Together) This is what we’ll do

(Go West) Life is peaceful there
(Go West) In the open air
(Go West) Where the skies are blue
(Go West) This is what we’re gonna do

(Go West, this is what we’re gonna do, Go West)

(Together) We will love the beach
(Together) We will learn and teach
(Together) Change our pace of life
(Together) We will work and strive

(I love you) I know you love me
(I want you) How could I disagree?
(So that’s why) I make no protest
(When you say) You will do the rest

(Go West) Life is peaceful there
(Go West) In the open air
(Go West) Baby you and me
(Go West) This is our destiny (Aah)

(Go West) Sun in wintertime
(Go West) We will do just fine
(Go West) Where the skies are blue
(Go West, this is what we’re gonna do)

There where the air is free
We’ll be (We’ll be) what we want to be (Aah aah aah aah)
Now if we make a stand (Aah)
We’ll find (We’ll find) our promised land (Aah)

(I know that) There are many ways
(To live there) In the sun or shade
(Together) We will find a place
(To settle) Where there’s so much space

(Without rush) And the pace back east
(The hustling) Rustling just to feed
(I know I’m) Ready to leave too
(So that’s what) We are gonna do

(What we’re gonna do is
Go West) Life is peaceful there
(Go West) There in the open air
(Go West) Where the skies are blue
(Go West) This is what we’re gonna do

(Life is peaceful there)
Go West (In the open air)
Go West (Baby, you and me)
Go West (This is our destiny)

Come on, come on, come on, come on

(Go West) Sun in wintertime
(Go West) We will feel just fine
(Go West) Where the skies are blue
(Go West) This is what we’re gonna do

(Come on, come on, come on)
(Go West)

(Go West)
(Go, ooh, go, yeah)
(Go West)
(Go, ooh, go, yeah)
(Go West)
(Go, ooh, go, yeah)
(Go West)
(Go, ooh, go, yeah)
(Gimme a feelin’)
(Gimme a feelin’)
(Go West)
(Gimme a feelin’)
(Gimme a feelin’)
(Go West)
(Gimme a feelin’)
(Gimme a feelin’)