Skip to content

Instantly share code, notes, and snippets.

View marceloserpa's full-sized avatar
🇧🇷
coding... :D

Marcelo Serpa marceloserpa

🇧🇷
coding... :D
View GitHub Profile

Fixing Ubuntu HDMI issue

ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
sudo apt install nvidia-340

GET _cat/indices

Create the template:

PUT _index_template/blogposts
{
  "index_patterns": ["post-*"],
 "template": {

Create mapping

PUT profile 
{
  "mappings": {
    "doc": {
      "properties": { 
        "name":     { "type": "text"  }, 
        "age":      { "type": "integer" }  
 } 
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo yum install -y nodejs
const http = require('http');

Acessar a máquina

sudo chmod 400 [arquivo e diretório do seu PEM FILE].pem
ssh -i [arquivo e diretório do seu PEM FILE].pem ec2-user@[IP publico da sua maquina]

Preparar o servidor:

bin/kafka-topics.sh --create --topic car-sales --bootstrap-server localhost:9092 --replication-factor 1 --partitions 2

bin/kafka-console-producer.sh --topic car-sales --broker-list localhost:9092 --property parse.key=true --property key.separator=":"

bin/kafka-console-consumer.sh --topic car-sales --bootstrap-server localhost:9092 --from-beginning --property print.key=true --property key.separator="-" --partition 0

mvn install:install-file -Dfile={path-to-file} \ -DgroupId={group-id}
-DartifactId={artifact-id}
-Dversion={version}
-Dpackaging={packaging}

$ git clone --bare https://github.com/exampleuser/old-repository.git
$ cd old-repository.git
$ git push --mirror https://github.com/exampleuser/new-repository.git
$ cd ..
$ rm -rf old-repository.git
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install jq -y
curl -sL https://rpm.nodesource.com/setup_13.x | sudo -E bash -
sudo yum install -y nodejs