This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import sys | |
hashes = [line.strip() for line in sys.stdin.readlines()] | |
for i in range(10000): | |
digest = hashlib.sha512('%04d' % i).hexdigest() | |
if digest in hashes: | |
print(digest, '%04d' % i) | |
# $> python cracker.py < hashes.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
import string | |
import sys | |
def factores_primos(n): | |
factor = 2 | |
while n >= 2: | |
if n % factor: | |
factor += 1 | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Compilacion: Como el usuario lo estime conveniente. | |
// Si se define HAVE_GMP entonces hay que linkear contra libgmp y libgmpxx, e.g.: | |
// | |
// $> CXXFLAGS="-Wall -O3 -DHAVE_GMP" LDLIBS="-lgmp -lgmpxx" make capicuas | |
// | |
// Uso: ./capicuas | |
// ./capicuas <primer-numero> <ultimo-numero> | |
// ./capicuas <primer-numero> <ultimo-numero> <precision> | |
// ./capicuas <primer-numero> <ultimo-numero> <precision> <max-iteraciones> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import print_function | |
import resource | |
import gc | |
import time | |
import six | |
# set IJSON_BACKEND=yajl2_c or yajl2_cffi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gc | |
import os | |
import resource | |
import sys | |
import time | |
def memusage(): | |
"""memory usage in MB. getrusage defaults to KB on Linux.""" | |
return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1e3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script requires the changes in https://github.com/casacore/casacore/pull/1116, | |
# which as of 14/Jul/2021 haven't been merged upstream yet | |
import functools | |
import operator | |
import os | |
import sys | |
import time | |
import casacore.tables as tables |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.