Skip to content

Instantly share code, notes, and snippets.

Avatar
🔒
Migrado para o GitLab

Eduardo Rolim vndmtrx

🔒
Migrado para o GitLab
  • Curitiba, Paraná, Brazil
View GitHub Profile
@vndmtrx
vndmtrx / Makefile
Created Nov 30, 2020
My Makefile for bootstrapping Python projects
View Makefile
SHELL := /bin/bash
.SHELLFLAGS = -e -c
.ONESHELL:
.PHONY: clean freeze
PRJ_NAME = Project Name
.venv: .venv/bin/activate
@vndmtrx
vndmtrx / subnet.py
Last active Mar 23, 2021
Python 3 simple subnet calculator
View subnet.py
#!/usr/bin/env python3
# Use: ./subnet.py <ip/cidr>
# Alt: ./subnet.py <ip> <mask>
import sys
if __name__=="__main__":
addr = [0, 0, 0, 0]
mask = [0, 0, 0, 0]
cidr = 0
@vndmtrx
vndmtrx / cron_script.sh
Last active Nov 12, 2018
Script para execução de atividades no Cron, com controle de horas e bloqueio de múltiplas execuções. Rode com cron_script.sh <path da atividade>.
View cron_script.sh
#!/usr/bin/env bash
## Script Modelo de execução de tarefas no cron
## Recomendação: Usar script na pasta /etc/cron.d/ em vez de usar cron de usuário (crontab -e)
## Recomendação: Usar rotação de logs (https://www.thegeekstuff.com/2010/07/logrotate-examples)
##################################################### Configuração ####################################################
#TODO: Criar /etc/logrotate.d/script
if [ $# -ne 1 ]; then
@vndmtrx
vndmtrx / gen-cert.sh
Created Dec 31, 2017
Servidor HTTPS em Python2/3 com TLS ativado, para fins de desenvolvimento
View gen-cert.sh
#!/usr/bin/env bash
openssl req -new -x509 -keyout certificado.pem -out certificado.pem -days 365 -nodes
@vndmtrx
vndmtrx / Tarefa.java
Last active Nov 26, 2017
Post saindo do forno... #Java9 #SpringBoot
View Tarefa.java
package com.vndmtrx.springboot.tarefas.modelos;
import javax.validation.constraints.Size;
import java.util.Date;
import javax.validation.constraints.NotNull;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
View Application.kt
package io.github.vndmtrx.spring
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
@EnableAutoConfiguration
@ComponentScan
class Application
fun main(args: Array<String>) {
View Application.kt
package io.github.vndmtrx.spring
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
@EnableAutoConfiguration
@ComponentScan
class Application {
companion object {
@JvmStatic fun main(args: Array<String>) {
View Application.kt
package io.github.vndmtrx.spring
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
@SpringBootApplication
open class Application {
companion object {
@JvmStatic fun main(args: Array<String>) {
SpringApplication.run(Application::class.java, *args)
View Application.java
package io.github.vndmtrx.spring;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@vndmtrx
vndmtrx / CMakeLists.txt
Created Apr 13, 2017
Script CMake para situação onde temos várias pastas
View CMakeLists.txt
cmake_minimum_required(VERSION 3.4)
project(teste_pasta)
#Adicionando os cabeçalhos, como o Mensagem.h no projeto
include_directories(includes)
#Podemos adicionar manualmente os fontes usando o comando abaixo:
#set(FONTES src/main.cpp src/Mensagem.cpp)
#No entanto, o comando file(GLOB...) nos permite usar wildcards para simplificar a adição de vários arquivos: