Skip to content

Instantly share code, notes, and snippets.

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

Allan Cesar Marques Lira acmlira

🏠
Working from home
View GitHub Profile
@acmlira
acmlira / kafka-getting-started.sh
Last active September 10, 2022 15:27
Kafka topic sample
# Clone and start
git clone git@github.com:conduktor/kafka-stack-docker-compose.git
cd kafka-stack-docker-compose
docker-compose -f zk-single-kafka-single.yml up -d
# Open kafka container
docker exec -it kafka1 /bin/bash
# Inside container Create topic
kafka-topics --bootstrap-server localhost:9092 --list
@acmlira
acmlira / how-to-connect-to-a-k8s-cluster.sh
Created July 19, 2022 18:22
How to connect to a k8s cluster
export K8S_USER="my-user"
export K8S_CLUSTER="my-cluster"
export K8S_TOKEN="my-token"
kubectl config set-cluster ${K8S_CLUSTER} --server=https://api.${K8S_CLUSTER} --insecure-skip-tls-verify=true
kubectl config set-context ${K8S_USER}-${K8S_CLUSTER} --cluster=${K8S_CLUSTER} --user=${K8S_USER}
kubectl config use-context ${K8S_USER}-${K8S_CLUSTER}
kubectl config set-credentials ${K8S_USER} -- ${K8S_TOKEN}
@acmlira
acmlira / xserialport.md
Last active September 1, 2020 16:36
XSerialPort spotlight

XSerialPort spotlight

Class to access serial ports

Port setup

You can use setPortName() method to assign the desired serial device.

XSerialPort serialPort = new XSerialPort();
#!docker
ARG AARCH=arm32v7
FROM ${AARCH}/ubuntu
RUN apt-get update && apt-get install build-essential cmake --no-install-recommends
WORKDIR /build
@acmlira
acmlira / cross-compiling-cmake-with-docker.md
Last active August 14, 2020 17:58
Cross-compiling CMake project with Docker

Docker basics: cross-compiling a CMake project

In this article you will understand how I built my own cross-compile tool for my CMake project for Linux systems with Docker. Obviously, you will need:

  1. Docker installed;
  2. Some CMake project.

Let's start!

Describing our image

Docker is a powerful tool of OS virtualization to deliver software in packages called containers. These containers are stored in the form of images (that can be distributed).

@acmlira
acmlira / article.md
Last active July 21, 2020 16:29
Java CI with Maven article text

Creating Java CI with Maven

with GitHub Actions

In recent years, tools like Travis CI and CircleCI have set out to solve the problem behind the CI/CD building. Often confusing for devs who had to switch sites again and again, these tools created the need to be added to the repository page. Since 2019, GitHub Actions has support for CI/CD and now makes it easier to automate how we build, test, and deploy our projects. In this tutorial, we are going to build a CI/CD pipeline to deploy a Java application with TotalCross but you can use into your favorite framework/vanilla project. It's quite generic.

GitHub Actions CI/CD banner

TotalCross is a cross-platform free open source GUI creator and will be very helpful for us in this tutorial. How about starting in just 8 minutes? [See more about TotalCross](https://totalcross.c

@acmlira
acmlira / ci.yml
Created July 20, 2020 23:46
Java CI with Maven code snippet
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build: