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 / AllowChangePassword.json
Created August 3, 2015 05:09
Additional iam policies to allow power users to update their console password and 2FA
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUsersAllActionsForCredentials",
"Effect": "Allow",
"Action": [
"iam:*LoginProfile",
"iam:*AccessKey*",
"iam:*SigningCertificate*"
@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: git@github.com:omnypay/amplitude.git
Error building classpath. git@github.com:omnypay/amplitude.git: USERAUTH fail
org.eclipse.jgit.api.errors.TransportException: git@github.com: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)
I'm in the midst of trying to wrangle an HBase backup/restore to/from S3 or HDFS
built around export/backup of 1 table at a time
using org.apache.hadoop.hbase.mapreduce.Export from HBASE-1684.
Just a reminder:
Usage: Export <tablename> <outputdir> [<versions> [<starttime> [<endtime>]]]
In the psuedo code below:
persistant_store is some kind of non-HBase store in the Cloud that you can just
@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'