Skip to content

Instantly share code, notes, and snippets.

View joseabraham's full-sized avatar
😎
Building cool things

Jose Abraham Garcia joseabraham

😎
Building cool things
View GitHub Profile
@joseabraham
joseabraham / app-ingres.yml
Created February 21, 2023 21:12
Kubernetes Ingress Configuration for Nginx - Let's Encrypt
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
@joseabraham
joseabraham / k8s.yaml
Created February 21, 2023 19:05
Kubernetes LKE resources Node.js - Redis Load Balancer
apiVersion: v1
kind: Secret
metadata:
name: regcred
data:
.dockerconfigjson: DOCKER_CONFIG
type: kubernetes.io/dockerconfigjson
---
# This section will create a deployment in the Kubernetes cluster
apiVersion: apps/v1
@joseabraham
joseabraham / bitbucket-pipelines.yml
Created February 21, 2023 18:59
Bitbucket Linode Kubernetes Pipeline
# This is a sample build configuration for Python.
# Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
definitions:
services:
docker:
memory: 4096
@joseabraham
joseabraham / docker-compose.yml
Created February 21, 2023 18:25
Docker Compose for a Node.js & Redis Server
version: '3.9'
services:
redis:
image: 'redis:alpine'
ports:
- '6379:6379'
networks:
- redis
server:
restart: on-failure
@joseabraham
joseabraham / Dockerfile
Last active February 21, 2023 18:21
Dockerfile for a Node.js application
FROM node:alpine
# Create app directory
WORKDIR /usr/src/app
# ENV LANG es_ES.UTF-8
# ENV LC_ALL es_ES.UTF-8
# ENV LANGUAGE es_ES.UTF-8
# ENV TZ America/Bogota
RUN apk add git
/**
* Launch Puppeteer chromium instance with MetaMask plugin installed
* */
export async function launch(puppeteerLib: typeof puppeteer, options: LaunchOptions): Promise<puppeteer.Browser> {
if (!options || !options.metamaskVersion)
throw new Error(
`Pleas provide "metamaskVersion" (use recommended "${RECOMMENDED_METAMASK_VERSION}" or "latest" to always get latest release of MetaMask)`,
);
const { args, metamaskVersion, metamaskLocation, ...rest } = options;
const downloadMetamaskLocally = async (): Promise<string> => {
try {
let metamaskPath = await download({
metamaskVersion: "v10.1.1",
metamaskLocation: './home/browserless'
});
return metamaskPath;
} catch (e) {