Skip to content

Instantly share code, notes, and snippets.

View hodrigohamalho's full-sized avatar
💭
let's code!

Rodrigo Ramalho hodrigohamalho

💭
let's code!
View GitHub Profile
@hodrigohamalho
hodrigohamalho / benchmark-commands.md
Created June 21, 2020 13:33 — forked from ueokande/benchmark-commands.md
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \
@hodrigohamalho
hodrigohamalho / tcp-dump.md
Created June 17, 2020 17:17 — forked from luszczynski/tcp-dump.md
TCP Dump Examples

TCP Dump Example

Check TCP Packet Content on Port 80

tcpdump -i eth0 -nn -s 1800 -XXX port 80

Check TCP Syn Packet on Port 80

@hodrigohamalho
hodrigohamalho / kafka-cheat-sheet.md
Created June 8, 2020 18:32 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

{
"host": "api-3scale-apicast-staging.apps.latam-559c.open.redhat.com",
"next": {
"current": {
"configuration": {
"services": {
"hasht": {},
"node2key": {},
"key2node": {}
},
@hodrigohamalho
hodrigohamalho / auto-fill-swagger-2-0.json
Created January 23, 2020 19:40 — forked from jerzyn/auto-fill-swagger-2-0.json
Auto-filling of the user keys in Swagger 2.0
"parameters": [
{
"name": "user_key",
"description": "Your access API Key",
"type": "string",
"in": "query",
"x-data-threescale-name": "user_keys",
"required": true
},
// ...
@hodrigohamalho
hodrigohamalho / nfs-handler.sh
Created November 20, 2019 13:14
nfs-handler.sh
# @author Rodrigo Ramalho - hodrigohamalho@gmail.com / rramalho@redhat.com
# This script creates:
# - nfs directory
# - persistence volume on openshift
# - persistence claim on openshift
# Parameters:
# 1. Directory to be create (every names, pv, pvc, nfs will be based on this name)
# 2. Size in Gb
# 3. Project in which pvc will be created
# Usage: oc-nfs-volume jenkis-storage 5 desenvolvimento claim-name
@hodrigohamalho
hodrigohamalho / delete-pods-crash.sh
Last active January 21, 2020 16:01
delete all pods in crash loop back error state
# From your host, SSH as ec2-user into the bastion server
# ssh -i /path/ocpkey.pem \
# ec2-user@bastion.NAME-GUID.open.redhat.com
# Become root on the bastion server
#sudo -i
oc get pods --all-namespaces | grep Crash | awk '{ printf ("oc delete pod %5s\t -n %s\n", $2, $1) }' | while read -r line ; do $line; done

Integration Demos

Integrating message-oriented middleware with a RESTful API using AMQ Online

This is available as a walkthrough. On Integreatly environment.

1) Create a queue

work-queue-requests

Route.java

rest("/orders").description("Content Base Router Example")
.get("/")
    .route().routeId("get-all-orders")
    .log("processing your request")
    .wireTap("direct:process-request")
    .setBody().simple("processing your request");
@hodrigohamalho
hodrigohamalho / day-in-the-life.adoc
Last active February 5, 2020 18:18
Day in the life workshop

Day in the life workshop

In the local machine (REMEBER TO CHANGE TO YOURS)

export GUID=latam-f81b

On the remote machine

Connect and download the workshop: