Skip to content

Instantly share code, notes, and snippets.

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

Bruno Tinoco brunocrt

🏠
Working from home
  • New York, NY
View GitHub Profile
@rkbalgi
rkbalgi / gist:2b605c86a4d50def73f9aced5619396b
Created October 3, 2018 04:50
Direct Access Grants (Resource Owner Password Flow) with Spring Boot and Keycloak
This gist describes the process of setting up direct grant access (oauth2 resource owner password flow) with keycloak and spring boot. We'll follow the
below steps -
1. Install keycloak - there are plenty of examples out there (even a docker image)
2. Create a demo realm and create a client within the demo realm with the settings as -
client-protocol: openid-connect, access-type: confidential, (implicit-flow+direct-access-grant+service-accounts)=enabled
3. Create 2 roles - developer and admin within the demo realm
4. Create 2 users - one with developer role and other with admin (Ensure that user is enabled, there are no "Required User Actions" and that the password has been reset (in the credentials tab)

Demo - Simple riff Java function using javac

Create the function code

  1. Create the source directory and class file

    $ mkdir -p upper/functions
    $ cd upper
    $ touch ./functions/Upper.java
@marwei
marwei / how_to_reset_kafka_consumer_group_offset.md
Created November 9, 2017 23:39
How to Reset Kafka Consumer Group Offset

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@eriadam
eriadam / example-jenkinsfile-pipeline.groovy
Last active March 31, 2024 15:14
example-jenkinsfile-pipeline.groovy
#!groovy
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
@coco98
coco98 / kube-registry.yaml
Created May 2, 2017 16:31
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
{ "conferences": [
{
"name": "Sao Paulo Science meetup",
"month": "January",
"city": "Sao Paulo",
"country": "Brazil",
"role": ["Speaker"],
"slides": ["http://slides.com/hannelitavante-hannelita/geometria-analitica#/"],
"video": "https://www.youtube.com/watch?v=a9s2PQavqYk",
"website": ["https://www.meetup.com/SP-Math-Physics-Science-Meetup/events/227582851/"],
@amaksoft
amaksoft / Jenkinsfile
Last active December 29, 2021 08:15
My example Jenkins Pipeline setup for Android app project
#!/usr/bin/groovy
/*
* Copyright (c) 2016, Andrey Makeev <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@trisberg
trisberg / scdf-yarn-spark-task.adoc
Last active March 16, 2018 15:55
Running a Spark application on YARN using Spring Cloud Data Flow

Running a Spark application on YARN using Spring Cloud Data Flow

Deploy Spring Cloud Data Flow on YARN

Download the Spark distribution and copy assembly jar file to HDFS

For Spark 1.6.1 do the following

@vicainelli
vicainelli / README.md
Last active October 6, 2023 18:33
10 livros que todo mundo deveria ler - by Murilo Gun

10 livros que todo mundo deveria ler

by Murilo Gun

  1. Abundancia - O futuro é melhor do que você imagina | Steven Kotler e Peter H. Diamandis
  2. VLEF - Vai lá e faz
  3. A Startup Enxuta - Como Os Empreendedores Atuais Utilizam a Inovação
  4. Marketing e Comunicação da Era Pós-Digital - As Regras Mudaram | Walter Longo
  5. De Onde Vem as Boas Ideias | Steven Johnson
  6. Steve Jobs - A Biografia | Walter Isaacson
@efenderbosch
efenderbosch / EncryptablePropertiesPropertySource
Created January 12, 2015 14:39
Encryptable YAML for Spring Boot
public class EncryptablePropertiesPropertySource extends MapPropertySource {
@SuppressWarnings({ "unchecked", "rawtypes" })
public EncryptablePropertiesPropertySource(String name, Properties source) {
super(name, (Map) source);
}
protected EncryptablePropertiesPropertySource(String name, Map<String, Object> source) {
super(name, source);
}