Skip to content

Instantly share code, notes, and snippets.

@brthor
brthor / README.md
Created March 23, 2018 02:41
Docker network create error: "Error response from daemon: failed to check bridge interface existence: numerical result out of range"

I recently hit this problem, while using ansible to create docker networks:

- name: Construct Default docker networks
  shell: "docker network create 
            -o com.docker.network.bridge.enable_icc=false 
            -o com.docker.network.bridge.name={{item.networkName}}
            --subnet {{item.subnet}} {{item.networkName}}"
  with_items: "{{ docker_networks }}"
@brthor
brthor / dotnet-linux-contained.md
Last active March 7, 2018 03:15
.NET core copy/paste deploy to linux by adding system libs.

Overview

When you publish a self-contained dotnet linux app for .net core 2.0, and run it on a brand new machine, you'll get this error:

Failed to load', error: libunwind.so.8: cannot open shared object file: No such file or directory
Failed to bind to CoreCLR at '/export/libcoreclr.so'

You can solve this by installing system packages, but for a truly self-contained publish, pull the missing libraries from the microsoft docker image, and into your app's output. You can put them in the publish directory and distribute them with your app.

@brthor
brthor / sqlalchemysqlitejsontype.md
Last active August 11, 2017 10:37
Sqlalchemy Sqlite JSON Type Supporting Index Queries
engine = create_engine(engineUrl, convert_unicode=True, poolclass=NullPool)

def jsonExtract(item, key):
    j = json.loads(item)
    value = j.get(key)
    return value

@sqlalchemy.event.listens_for(engine, "begin")
def do_begin(conn):
Bryans-MacBook-Pro:web-migrate brthor$ dotnet run3
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
User profile is available. Using '/Users/brthor/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Hosting environment: Production
Content root path: /Users/brthor/code/web-migrate
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]