Skip to content

Instantly share code, notes, and snippets.

View emilio2hd's full-sized avatar

Emílio emilio2hd

  • Limerick, Ireland
View GitHub Profile
@emilio2hd
emilio2hd / docker-pocket.txt
Last active April 25, 2018 09:18
Docker Pocket
# Build an image
docker build -t <image_name> <dockerfile_path>
# Run a container
docker run -d -p <host_port>:<container_port> --name <container_name> <image_name>
PS1: In this sample, I'm mapping ports with option '-p'. For more details, see below.
PS2: You can add links among containers using --link <container_name>:<alias> option.
# Start a bash session at a running container
docker exec -it <nome_container> bash
@emilio2hd
emilio2hd / app.component.ts
Last active July 27, 2019 11:27
Print message array every 5000 ms or if the buffer reach 5 items
export class AppComponent implements OnInit {
messageBuffer$ = new Subject<string>();
msgCount = 0;
ngOnInit(): void {
this.messageBuffer$.pipe(
bufferTime(5000, null, 5),
filter(buffer => buffer.length > 0),
).subscribe(console.log);
}
@emilio2hd
emilio2hd / README.md
Last active July 7, 2022 14:56
Docker + Elasticsearch + Logstash + Kibana

Configuring Elasticsearch + Logstash + Kibana using Docker

Here, there are some configs to use Elasticsearch as a Docker container and Logstash + Kibana as well.

You will see that Elasticsearch config is separated from Logstash and Kibana because I'm assuming that you want to use the ES container to other things rather than only log analyses.

Docker instalation

Go to https://docs.docker.com/install/ and open the "Docker CE" menu, choose you OS and follow their instructions.

After install, open your terminal and type:

@emilio2hd
emilio2hd / gradle_defaults_main.yml
Last active January 3, 2023 10:48
Ansible role to install sdkman and gradle
---
sdkman_script_install_url: http://get.sdkman.io
sdkman_folder: '/home/vagrant/.sdkman'
gradle_version: 2.3