Skip to content

Instantly share code, notes, and snippets.

Jayson Reis jaysonsantos

Block or report user

Report or block jaysonsantos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d2d33bf7a9913b4d5586e962bc343fc2
-- Logs begin at Sat 2019-10-19 17:13:06 CEST, end at Tue 2019-12-03 16:16:09 CET. --
Oct 22 22:00:17 jayson-lg systemd[1]: Started ZeroTier One.
Oct 23 09:59:20 jayson-lg zerotier-one[17481]: connect: Network is unreachable
Oct 23 09:59:20 jayson-lg zerotier-one[17481]: connect: Network is unreachable
Oct 23 21:42:00 jayson-lg zerotier-one[17481]: connect: Connection timed out
Oct 31 21:08:29 jayson-lg zerotier-one[17481]: connect: Connection refused
Oct 31 21:08:29 jayson-lg zerotier-one[17481]: connect: Connection refused
Oct 31 21:14:06 jayson-lg zerotier-one[17481]: connect: Connection refused
Oct 31 21:14:06 jayson-lg zerotier-one[17481]: connect: Connection refused
Oct 31 21:14:06 jayson-lg zerotier-one[17481]: connect: Connection refused
@jaysonsantos
jaysonsantos / Dockerfile
Last active Nov 4, 2019
killbill api with fargate/ecs/kubernetes systems
View Dockerfile
FROM killbill/killbill:0.20.0
ADD kpm.yml /var/lib/killbill/kpm.yml
# Patch to respect X-Fowarded-Proto and others when running with ELB
ADD server.xml.patch ./
RUN patch -p1 < server.xml.patch
# Script that setup traps to respect docker stop commands and stop catalina
ADD fargate-killbill.sh ./
View find_and_format_named_nvme.sh
find_kafka_device() {
for device in $(nvme list | grep ^/dev | awk '{print $1}')
do
local found_device="$(nvme id-ctrl -v $device | grep -Po '/dev/[a-z0-9]+' || true)"
if [[ -n "$found_device" ]]; then
echo "$device"
return 0
fi
done
View resolve_ip.c
#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <arpa/inet.h>
int main(int argc, char **argv)
{
if (argc < 2) {
printf("Provide the host to be resolved\n");
return 1;
View export_env_to_amazon_ssm.rb
# frozen_string_literal: true
require 'pathname'
class EnvImporter
def initialize(env_file, environment_name, app_name, overwrite = false,
number_of_threads = 4)
validate_aws_cli
@env_file = env_file
@environment_name = environment_name
@jaysonsantos
jaysonsantos / pre-commit-poetry-lock.yaml
Last active Nov 21, 2019
Example hook for pre-commit to check if poetry file is locked
View pre-commit-poetry-lock.yaml
- repo: local
hooks:
- id: poetry_lock
name: Check if poetry is updated
entry: python -c "from poetry.poetry import Poetry;
assert Poetry.create('.').locker.is_fresh(), 'Poetry is not locked'"
language: python_venv
additional_dependencies:
- poetry
@jaysonsantos
jaysonsantos / caseinsensitivedict.py
Last active Jul 30, 2018
Yet another CaseInsensitiveDict implementation
View caseinsensitivedict.py
class CaseInsensitiveDict(dict):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__map = {}
mapping = args[0] if len(args) else {}
keys = set()
if isinstance(mapping, dict):
keys |= mapping.keys()
elif isinstance(mapping, (list, tuple)):
@jaysonsantos
jaysonsantos / .dockerignore
Last active Nov 19, 2018
Rust AWS Lambda Builder and Runner
@jaysonsantos
jaysonsantos / conftest.py
Created Oct 27, 2017
sqlalchemy + pytest patch session to avoid commits on tests
View conftest.py
import pytest
@pytest.yield_fixture(scope='session')
def patch_session():
def commit():
"""Flush and expire caches."""
db.session.flush()
db.session.expire_all()
old_commit = db.session.commit
@jaysonsantos
jaysonsantos / force_spoon_java8.patch
Last active Oct 11, 2017
Force spoon to always run on java8
View force_spoon_java8.patch
--- spoon.sh.bkp 2017-10-11 11:43:09.000000000 +0200
+++ spoon.sh 2017-10-11 11:52:07.000000000 +0200
@@ -1,5 +1,15 @@
#!/bin/sh
+# Hacky way to force java8
+JAVA_VMS_LOCATION="/Library/Java/JavaVirtualMachines"
+LATEST_JAVA_8="$(ls $JAVA_VMS_LOCATION | grep jdk1.8 | sort | tail -n 1)"
+if [ -z "$LATEST_JAVA_8" ]; then
+ echo "Java 8 not found"
You can’t perform that action at this time.