Skip to content

Instantly share code, notes, and snippets.

View rberger's full-sized avatar

Robert J. Berger rberger

View GitHub Profile
@rberger
rberger / sst_error.txt
Created September 21, 2022 22:29
SST Start error with poetry python
bf15a1ca-b221-4ab7-8e42-acd3f0d7a1d1 REQUEST rberger-api-handler-MyStack-ApiHandler5E7490E8-80mzoSLcqbxN [api_handler.handler] invoked by API POST /v1/auto/applications
Traceback (most recent call last):
File "/Users/rberger/work/informed/internal/techno-core/apps/api_handler/node_modules/@serverless-stack/core/src/runtime/shells/bootstrap.py", line 88, in <module>
module = import_module(args.handler_module)
File "/Users/rberger/.pyenv/versions/3.9.11/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
@rberger
rberger / Build-aws-otel-lambda.md
Last active August 12, 2022 05:24
How to build a aws-otel-lambda/opentelemetry-lambda python lambda layer
@rberger
rberger / header-meta-render.cljs
Created June 15, 2021 02:11
SSR a simple "static" page for social bots to consume to get media / content for social links
(ns visx.socialite.content
(:require-macros
[hiccups.core :refer [html]])
(:require
[hiccups.runtime :as hiccupsrt]))
(defn render
"These inputs were from our app fetched from appsync/dynamodb.
You could get the inputs you need using whatever backing store you have
@rberger
rberger / Build and Deploy CLJS Lambda with minimal size.md
Last active May 9, 2021 00:26
Building and deploying Clojurescript aws lambda with shadow-cljs to fit in lambda@edge

Some excerpts of how we build and deploy two lambdas. In this case these will end up as lambda@edge for a cloudfront distribution for handling viewer-requests and origin-requests.

The main point is how the origin-request lambda in the deploy-lambda section includes the node_modules directory into the lambda zip image. Lambda@edge can't have the image be bigger than 50MB. So we do

yarn install --production

To install only the production parts of the dependencies, Then use modclean to reduce the size of node_modules further.

Had problems doing the direct file upload for aws lambda update-function-code so used the s3 upload option for the origin-request lambda.

@rberger
rberger / project.clj
Created January 22, 2021 22:13
Gist Push Test
(defproject clj-linq "0.1.0-SNAPSHOT"
:description "Clojure Console App"
:url "https://gist.cafe/#clojure"
:license {:name "The 3-Clause BSD License"
:url "https://github.com/ServiceStack/gistcafe-kotlin/blob/main/LICENSE"}
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/data.json "1.0.0"]
[net.servicestack/gistcafe "0.0.6"]
[org.jetbrains.kotlin/kotlin-stdlib "1.4.21"]
[com.google.code.gson/gson "2.8.6"]]
$ /Users/rberger/omnyway/visx/visx-dashboard/node_modules/.bin/shadow-cljs -A:dev watch app
shadow-cljs - config: /Users/rberger/omnyway/visx/visx-dashboard/shadow-cljs.edn
shadow-cljs - starting via "clojure"
Cloning: [email protected]:omnypay/amplitude.git
Error building classpath. [email protected]:omnypay/amplitude.git: USERAUTH fail
org.eclipse.jgit.api.errors.TransportException: [email protected]:omnypay/amplitude.git: USERAUTH fail
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:248)
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:89)
@rberger
rberger / gist:8c301ef7482c8a1794aeb7d17dbde338
Created May 30, 2017 17:05
Error executing action `install` on resource 'python_package[setuptools]' debug level
* python_package[setuptools] action install[2017-05-30T17:03:09+00:00] INFO: Processing python_package[setuptools] action install (/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb line 138)
[2017-05-30T17:03:09+00:00] DEBUG: Providers for generic python_package resource enabled on node include: [PoisePython::Resources::PythonPackage::Provider]
[2017-05-30T17:03:09+00:00] DEBUG: Provider for action install on resource python_package[setuptools] is PoisePython::Resources::PythonPackage::Provider
[2017-05-30T17:03:09+00:00] DEBUG: Resources for generic python_runtime resource enabled on node include: [PoisePython::Resources::PythonRuntime::Resource]
[2017-05-30T17:03:09+00:00] DEBUG: Resource for python_runtime is PoisePython::Resources::PythonRuntime::Resource
[2017-05-30T17:03:09+00:00] DEBUG: Resources for generic python_runtime resource enabled on node include: [PoisePython::Resources::PythonRuntime::Resource]
[2017-05-30T17:03:09+00:00] DEBUG: Resource for pyth
@rberger
rberger / gist:8ee1bdc183f31fc25df222c458a9fe5f
Created May 30, 2017 17:04
Error executing action `install` on resource 'python_package[setuptools]' info level
* python_package[setuptools] action install[2017-05-30T17:00:28+00:00] INFO: Processing python_package[setuptools] action install (/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb line 138)
================================================================================
Error executing action `install` on resource 'python_package[setuptools]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
Exception in thread "main" Exception in thread "pool-110-thread-1" java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V
at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.<init>(SdkTLSSocketFactory.java:56)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:91)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:51)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:39)
at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:283)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonW
2016-06-22T05:46:18.968+0000 ERROR atlas.server.monitoring - 50.156.88.5 :get /tester/tests java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream {"stacktrace":"java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream\n\tat org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:89)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:497)\n\tat clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)\n\tat clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)\n\tat ariadne.io.excel_reader$read_excel.invokeStatic(excel_reader.clj:74)\n\tat ariadne.io.excel_reader$read_excel.doInvoke(excel_reader.clj:66)\n\tat clojure.lang.RestFn.invoke(RestFn.java:423)\n\t