Skip to content

Instantly share code, notes, and snippets.

View M3nin0's full-sized avatar
🌍

Felipe M3nin0

🌍
View GitHub Profile
@M3nin0
M3nin0 / scan_ssh.sh
Created June 19, 2016 23:10
Script muito simples que usei em alguns testes do Snort.
#!/bin/bash
echo "Insira o endereço a ser analisado"
read ip
echo "Insira o numero de portas a ser analisado"
read port
for ((a=1; a <= port ; a++))
@M3nin0
M3nin0 / baixa_tk.ssh
Last active February 10, 2020 00:24
Script Super simples escrito para testar as regras do Snort, compartilhando apenas para deixar salvo
#!/bin/bash
echo "Insira o endereço a ser analisado"
read site_tk
echo "Baixar quantas vezes?"
read vezes
for ((a=1; a <= vezes ; a++))
@M3nin0
M3nin0 / remove-bak.bat
Created August 5, 2016 15:00
Remova o backup do MySQL de maneira rapida e simples
@echo off
forfiles -p "CAMINHODOBANCO" -s -d -1 -m *.bak -c "cmd /c del /f /q @path"
stop
exit
import os
import json
from flask import Flask, request
import requests
import traceback
'''
Estrutura do json carregado pelo app
{
"tokens": {
@M3nin0
M3nin0 / escreve-netcdf4.py
Created January 22, 2019 00:27
Escrita de dados em arquivo NetCDF4 com Python
import numpy as np
from netCDF4 import Dataset
# Criando dado de exemplo
data_array = np.zeros((100, 100))
# Criando dataset
dataset = Dataset('dataset.nc', 'w', format='NETCDF4')
# Criando as dimensões que serão utilizadas
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Example to understand the difference between interpolation and regression
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
# ===== Regression
#include <iostream>
// Idea from: https://stackoverflow.com/questions/5171739/tostring-override-in-c
class Teste
{
private:
int a;
public:
Teste(int a)
@M3nin0
M3nin0 / powernoise.m
Last active May 11, 2020 13:36
powernoise for octave
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Arbitrary Spectral Slope Noise Generation %
% with OCTAVE Implementation %
% %
% From Little, 1992. Adapted from R. Rosa (08/08/14) %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function x = powernoise(beta, N, varargin)
% Generate samples of power law noise. The power spectrum
% of the signal scales as f^(-beta).
import numpy as np
import pandas as pd
from sklearn import linear_model
import matplotlib.pyplot as plt
# Carregando os dados
data_owd = pd.read_csv('https://covid.ourworldindata.org/data/owid-covid-data.csv')
# Filtrando os dados (Canadá)
can = data_owd[data_owd.iso_code == 'CAN']
@M3nin0
M3nin0 / stac-intersects.py
Created August 5, 2020 14:49
STAC.py intersects method
import stac
bdc_stac_service = stac.STAC('http://brazildatacube.dpi.inpe.br/bdc-stac/0.8.0/')
collection = bdc_stac_service.search({'collections': ['LC8SR'], "intersects": {"type": "Point", "coordinates": [-45, -13] }, "limit": 10})