Skip to content

Instantly share code, notes, and snippets.

View asantos2000's full-sized avatar
🏠
Working from home

Anderson Santos asantos2000

🏠
Working from home
View GitHub Profile
@asantos2000
asantos2000 / README.md
Created September 28, 2018 21:30 — forked from detiber/README.md
kubeadm v1.12 stacked control plane install

Kubeadm stacked control plane install v1.12

Warning: hardcoded values below will need to be modified for testing against different hostnames and/or IPs

Common Steps

Install Docker

apt-get update && \
@asantos2000
asantos2000 / converter-cli.js
Last active August 24, 2018 23:08 — forked from sorjef/converter-cli.js
Script to convert AWS Data Pipeline template to Cloudformation template with a sample Terraform module
const fs = require('fs');
const Converter = require('./converter.js');
const options = {
name: process.argv[3],
description: process.argv[4],
activate: process.argv[5],
};
const converter = new Converter(JSON.parse(fs.readFileSync(process.argv[2])), options);
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
# Unzip
unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@asantos2000
asantos2000 / ResizeImage.java
Created March 5, 2018 18:35 — forked from werbth/ResizeImage.java
Given a jpeg image as InputStream, resize it and return another InputStream.
public static InputStream resizeImage(InputStream inputStream, int width, int height) throws IOException {
BufferedImage sourceImage = ImageIO.read(inputStream);
Image thumbnail = sourceImage.getScaledInstance(width, height, Image.SCALE_SMOOTH);
BufferedImage bufferedThumbnail = new BufferedImage(thumbnail.getWidth(null),
thumbnail.getHeight(null),
BufferedImage.TYPE_INT_RGB);
bufferedThumbnail.getGraphics().drawImage(thumbnail, 0, 0, null);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(bufferedThumbnail, "jpeg", baos);
return new ByteArrayInputStream(baos.toByteArray());
@asantos2000
asantos2000 / NetworkServiceDiscovery.java
Created February 18, 2018 20:00 — forked from icastell/NetworkServiceDiscovery.java
Using Network Service Discovery (Bonjour) in Android
package com.solarfighter.activities;
import java.io.IOException;
import java.net.InetAddress;
import javax.jmdns.JmDNS;
import javax.jmdns.ServiceEvent;
import javax.jmdns.ServiceListener;
import android.content.Context;
@asantos2000
asantos2000 / KongJwt.md
Last active June 29, 2017 17:46 — forked from martinheld/KongJwt.md
Short example to use JWT with Kong

JWT Kong Example

  • Get and Start Kong and Co
git clone https://github.com/Mashape/docker-kong.git
cd docker-kong/compose
docker-compose up
  • Create Kong API Route