Skip to content

Instantly share code, notes, and snippets.

View maxmalysh's full-sized avatar
🚀
BUY BITCOIN

Max Malysh maxmalysh

🚀
BUY BITCOIN
View GitHub Profile
@maxmalysh
maxmalysh / ddos.txt
Created August 27, 2020 02:47 — forked from bom-d-van/ddos.txt
Detecting and Mitigating DDOS Attacks
Detecting and Mitigating DDOS Attacks
#List all Finish (FIN) packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0'
#List all SYN and SYN-ACK packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0'
@maxmalysh
maxmalysh / pwnd.py
Created June 11, 2019 18:16
Python wrapper for the Have I Been Pwned API
def check_password(password):
"""
Returns how many times password appears in the breach data set.
>>> check_password('qwerty123')
'592110'
>>> check_password('Very$ecurePa$$word')
0
"""
import requests
from hashlib import sha1
/*
Output:
100000 digits
3 ms | regex
9 ms | lambda
11 ms | StringUtils
1000000 digits
8 ms | regex
9 ms | lambda
public class Main {
public interface NumericChecker {
boolean isNumeric(String string);
}
public static class TestCase {
public String string;
public TestCase(String string) {
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang.RandomStringUtils;
public class Main {
public static abstract class Test {
abstract boolean start(String a, String b);
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}