Skip to content

Instantly share code, notes, and snippets.

@carlosroman
carlosroman / README.MD
Created June 5, 2024 16:28
TLS over UDP

Simple test to show TLS over UDS

To run:

go test -v -timeout 1s

The third test hangs (ClientUsesTLS) at the moment. The output does look like the client has encrypted the data as it got sent to the listner.

@carlosroman
carlosroman / Dockerfile
Created April 5, 2024 16:36
Java Runtime Metrics with dd-trace-java
# syntax=docker/dockerfile:1
# Allows to cheange the JDK image used
ARG JRE_DOCKER_IMAGE=eclipse-temurin:11
# Use the official JDK image as the base image
FROM ${JRE_DOCKER_IMAGE}
WORKDIR /app
@carlosroman
carlosroman / docker-compose-ad.yaml
Last active November 21, 2023 10:15
Run Kafka locally (with Docker) and Datadog Agent config to pull metrics from it
---
version: "3.9"
services:
zookeeper:
image: quay.io/debezium/zookeeper:2.3
ports:
- 2181:2181
- 2888:2888
- 3888:3888
kafka:
@carlosroman
carlosroman / README.md
Last active March 20, 2023 16:40
Working HA Proxy config example with a fallback backend

Simple HA proxy with fallback backend

To run:

docker compose up # or docker-compose up if not using the docker plugin

In another terminal the run the following:

@carlosroman
carlosroman / Dockerfile
Last active December 11, 2023 15:24
Simple journald random logger service
# syntax=docker/dockerfile:1
FROM python:3.11-alpine
COPY random-logger.py /usr/bin/
ENTRYPOINT [ "python" ]
CMD [ "/usr/bin/random-logger.py" ]
@carlosroman
carlosroman / origin_access.yml
Last active November 30, 2017 13:45
ansible origin access
---
- name: Create/update CloudFront origin access identity
command: aws cloudfront create-cloud-front-origin-access-identity --cloud-front-origin-access-identity-config "CallerReference={{ site }},Comment=access-identity-{{ site }}.site.s3.amazonaws.com"
environment:
AWS_ACCESS_KEY_ID: "{{ aws_access_key }}"
AWS_SECRET_ACCESS_KEY: "{{ aws_secret_access_key }}"
AWS_DEFAULT_REGION: "{{ aws_region }}"
no_log: true
register: aws_cli_out
@carlosroman
carlosroman / SomeResourceCounter.go
Last active March 31, 2017 15:12
Java To Go mistakes
type SomeResource struct {
counter int
}
func (sr *SomeResource) incCounter(rw http.ResponseWriter, r *http.Request) {
sr.counter++
}
func (sr *SomeResource) getCounter(rw http.ResponseWriter, r *http.Request) {
v := strconv.Itoa(sr.counter)
@carlosroman
carlosroman / ua.json
Created August 30, 2016 09:55
Firefox UA from bash on windows
{
"ua": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0",
"browser": {
"name": "Firefox",
"version": "48.0",
"major": "48"
},
"engine": {
"version": "48.0",
"name": "Gecko"
@carlosroman
carlosroman / MessageTest.java
Created May 6, 2016 13:36
Example Large SQS message
package com.example.sqs.large.message;
import com.amazon.sqs.javamessaging.AmazonSQSExtendedClient;
import com.amazon.sqs.javamessaging.ExtendedClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
@carlosroman
carlosroman / tsession
Created January 15, 2015 10:13
Short cut for creating new tmux session... and logging into existing one
tmux has-session -t $1
if [ $? != 0 ]
then
tmux new-session -s $1 -n editor -d
fi
tmux attach -t $1