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 / camel-raw-oauth.java
Created December 1, 2022 17:16 — forked from rafaeltuelho/camel-raw-oauth.java
camel snippet using oauth to get an auth token and use it to request a secured rest service
from("timer://scheduler?period=30s")
.log("get access token")
.to("direct:authService");
from("direct:authService").tracing()
.setHeader(Exchange.HTTP_PATH)
.simple("<auth service context>/oauth2/token")
.setHeader("CamelHttpMethod")
.simple("POST")
.setHeader("Content-Type")
Sub PasswordBreaker()
'Breaks worksheet password protection.
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
On Error Resume Next
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
@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 ...

@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 / gist:8114722ac0916ee487e50188ecdc3382
Last active December 14, 2017 13:30 — forked from davivcgarcia/gist:bcc330b9c886d97290f4d81af3e2319a
Red Hat Training - OpenShift Advanced Deployment (v3.7), Lab 1
[OSEv3:vars]
timeout=60
ansible_ssh_user=ec2-user
ansible_become=true
deployment_type=openshift-enterprise
openshift_release=3.7
openshift_clock_enabled=true
openshift_master_cluster_method=native
@hodrigohamalho
hodrigohamalho / README.md
Last active March 23, 2017 15:07 — forked from mayorova/README.md
Deploy 3scale AMP on OpenShift

Installing 3scale AMP ER3-2 on EC2

You will need:

  • a running instance with 8GB RAM minimum (recommended 16GB) and RHEL

  • <PUBLIC_DNS>: (e.g. ec2-54-123-456-78.compute-1.amazonaws.com)

  • ``: (e.g. 54.123.456.78)

@hodrigohamalho
hodrigohamalho / latency.txt
Created March 27, 2016 13:48 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@hodrigohamalho
hodrigohamalho / robot.js
Created December 5, 2012 12:47 — forked from Mr0ok/robot.js
hodrigohamalho
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();