Skip to content

Instantly share code, notes, and snippets.

View martinsam16's full-sized avatar
💡
etatnevnieR

Martín Alexis Samán Arata martinsam16

💡
etatnevnieR
View GitHub Profile
@martinsam16
martinsam16 / AreSame.java
Last active November 29, 2022 22:14
Are they the "same"? codewars java 11
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
public class AreSame {
public static boolean comp(int[] a, int[] b) {
if (a == null || b == null) return false;
int[] arrAlcuadrado = Arrays.stream(a).map(operand -> operand * operand).toArray();
Arrays.sort(arrAlcuadrado);
@martinsam16
martinsam16 / reto.sol
Last active December 2, 2022 01:34
reto seguridad smart contract
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol";
contract Desafio is Ownable {
using SafeMath for uint256;
@martinsam16
martinsam16 / pingback_attack_xmlrpc.py
Last active November 15, 2022 00:42
pingback attack exploit xmlrpc.php on wordpress
import requests
def verify_vulnerability(url) -> bool:
# Verify if the target is vulnerable
result = requests.get(url + "/xmlrpc.php")
if result.status_code == 405:
return True
else:
return False
@martinsam16
martinsam16 / limit-wsl2.md
Created January 21, 2021 13:45
Limit resources in wsl2
  1. Enter the user's folder. C:\Users\USER

  2. Create the file: .wslconfig

  3. Enter the following:

[wsl2]
memory = 4GB # Limits memory
processors = 2 # Limits virtual processors
@martinsam16
martinsam16 / docker-wsl2.md
Last active May 1, 2024 19:28
How to install wsl2 ubuntu + docker + docker-compose

Activate wsl2

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Install and Configure Ubuntu