Skip to content

Instantly share code, notes, and snippets.

View RenatoExpert's full-sized avatar
🎯
Focusing

Renato Araujo RenatoExpert

🎯
Focusing
View GitHub Profile
@RenatoExpert
RenatoExpert / artigo_html.md
Created July 12, 2024 15:01
Artigo: qual a diferença entre HTML, CSS e Javascript?

Qual a diferença entre HTML, CSS e Javascript?

O que é HTML?

HTML é uma sigla para HyperText Markup Language, ou seja é uma linguagem de marcação para hipertexto.

Hipertexto

Hipertexto é texto que não é pleno, ou seja, ele tem dados a mais além do texto. Um exemplo: qual a diferença entre escrever no Bloco de Notas e no Word? No word você pode ajustar um tamanho diferente para cada palavra, ajusta fonte, estilos (negrito, italico, sublinhado). No bloco de notas você possui apenas um texto simples, sem nenhuma estilização. Então o HTML é uma linguagem para escrever textos com estilização.

#!/usr/bin/bash
# Baixando uma imagem de docker
docker pull alpine:3.20
# Iniciando um container
docker run \
`# Rodar em background` -d \
`# Associando portas` -p 8080:8080 \
`# Nomeando o container` --name webserver \
@RenatoExpert
RenatoExpert / post-receive
Created May 14, 2024 15:05
Make CI/CD pipelines on git servers with this hook. Paste as .git/hooks/post-receive with run privilege
#!/usr/bin/env bash
GIT_DIR="/home/git/myrepo"
DEPLOY_DIR="/home/git/ops/deploy"
TEST_DIR="/home/git/ops/test"
MAIN="main"
TEST="test"
while read oldrev newrev ref
do
# Next time use input() to define parameters
fit = 5000
secret_a = 15
secret_b = -22
def calcule(x, a, b):
y = a * x + b
return y
def secret_y(x):
/*
* This is a sample funtional code to send HTTP POST requests on Scada-LTS.
*
* It is sending an whatsapp message through an API service.
* Whatsapp service source: https://github.com/chrishubert/whatsapp-api
*
* Scada-LTS scripts are interpreted by jsdoc-toolkit package which runs Rhino at its core.
* Rhino has some limitations about javascript resources, as example: DOM API, Fetch API and XMLHttpRequest.
*/
import os
import time
import hashlib
import csv
# Cache Handler
cache_file = "/tmp/cache_md5"
def load_cache():
cache = {}
@RenatoExpert
RenatoExpert / fake_tag.js
Created January 24, 2024 21:57
A simple express webserver that simulates a sensor value
const express = require('express')
const app = express()
const port = 8081
var pressure = 25;
function noise() {
let max = 10;
let min = -10;
let factor = Math.random();
GIMP Palette
Name: High Perfomance HMI Rockwell
Columns: 6
# Renato Ramos Ribeiro Araujo (renatorraraujo@gmail.com)
# This palette follows Rockwell recomendations from the document below
# https://literature.rockwellautomation.com/idc/groups/literature/documents/wp/proces-wp023_-en-p.pdf
0 0 0 Empty
# Display Color Use
224 224 224 Light Gray 224
192 192 192 Silver 192
/*
* Example of what I think a Scada-LTS script would be written like.
* 1 - Using DOM instead of strings
* 2 - Using a native API to fetch info from backend
*/
var pontos = {};
for(let i = 1; i <= 15; i++) {
pontos[i] = scada.getDatapointById(`user${i}`);
}
@RenatoExpert
RenatoExpert / Dockerfile
Created December 4, 2023 21:39
Dockerfile to ScadaBR v1.2
FROM debian:latest
WORKDIR /scadabr
RUN apt update && apt upgrade
RUN yes | apt install wget unzip
RUN wget https://github.com/ScadaBR/ScadaBR/releases/download/v1.2/ScadaBR_Setup_Linux.zip
RUN unzip ScadaBR_Setup_Linux.zip
CMD ./install_scadabr.sh && echo "Press CTRL+P then CTRL+Q now" && read REPLY