Skip to content

Instantly share code, notes, and snippets.

View marcosbarker's full-sized avatar
🧙‍♂️
code == There and back again

Marcos Paulo Marques Corrêa marcosbarker

🧙‍♂️
code == There and back again
View GitHub Profile
@marcosbarker
marcosbarker / calculaPosicaoXML.py
Last active December 20, 2024 21:41
Retorna linha (Propriedade 'Tag' + Conteúdo) de XML baseado na posição passada.
xml =
"""
<COLAR XML AQUI>
"""
posicao = <COLOCAR POSIÇÃO AQUI>
if posicao > len(xml) or posicao <= 0:
print(f"Erro: posicao {posicao} fora do intervalo do XML.")
@marcosbarker
marcosbarker / codificaPdfEmBase64.java
Last active April 11, 2023 16:04
Codifica PDF em Base64 puro texto
import java.util.Base64;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
String filePath = "pdfTeste.pdf";
File file = new File(filePath);
byte[] bytes = Files.readAllBytes(file.toPath());
@marcosbarker
marcosbarker / -sw2d_kf_rna_notebook.ipynb
Last active February 10, 2023 14:02
sw2d_kf_rna_notebook.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marcosbarker
marcosbarker / lorenz_da_magic.ipynb
Created February 9, 2023 15:43
Lorenz_DA_Magic.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marcosbarker
marcosbarker / viewKeyWindows.vbs
Last active September 27, 2022 15:34
🔑 VBScript para visualizar chave do Windows.
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
@marcosbarker
marcosbarker / iac-servidor-web.sh
Last active July 30, 2022 16:05
🐧IaC modelo de provisionamento de servidor web (🪶Apache)
#!/bin/bash
echo "***_Atualizando o Servidor_***"
apt-get update
apt-get upgrade -y
echo "***_Instalando Servidor Apache_**"
apt-get install apache2 -y
echo "***_Instalando unzip_***"
@marcosbarker
marcosbarker / iac-grupos-e-usuarios.sh
Last active July 29, 2022 05:23
🐧IaC modelo para criar Usuários, Grupos, Permissões e atribuir Usuários aos Grupos.
#!/bin/bash
echo "***_Criando os diretorios_***"
mkdir /publico
mkdir /adm
mkdir /ven
mkdir /sec
echo "***_Criando Grupos de Usuarios_***"
groupadd GRP_ADM
@marcosbarker
marcosbarker / troca-usuario-git.bat
Created November 13, 2021 15:09
Script para alternar de forma pratica entre usuários Git: pessoal x trabalho : trabalho x pessoal
@echo off
echo -----------------------------------------------------------
echo ----------------------USUARIO ATUAL------------------------
echo -----------------------------------------------------------
echo.
git config user.name
git config user.email
echo.
echo -----------------------------------------------------------
echo.
@marcosbarker
marcosbarker / heroku-create-dataBase.md
Created July 30, 2021 02:13
HEROKU CREATE DATABASE: Manual com passo a passo de como criar banco de dados no servidor, sincronizar localmente, criar tabelas, popular com o DBeaver (🐘PostgreSQL) e como usar com Spring Boot.
@marcosbarker
marcosbarker / SecurityConfig.java
Created July 27, 2021 20:44
SPRING BOOT: Tratamento de CORS
package com.<...>.config;
import java.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;