This file contains hidden or 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
| pynew download: https://code.google.com/p/pyew/downloads/list | |
| TypicalProblems problem: | |
| https://code.google.com/p/pyew/wiki/TypicalProblems | |
| 1. PEFILE: global name 'Decode32Bits' is not defined | |
| Slove: https://github.com/kbandla/distorm64 | |
| X86組合語言/基本指令集 |
This file contains hidden or 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
| # sudo mn --custom ./fat_tree.py --topo mytopo --switch ovs,protocols=OpenFlow13 --controller=remote,ip=192.168.56.1 | |
| from mininet.topo import Topo | |
| from mininet.cli import CLI | |
| from mininet.net import Mininet | |
| from mininet.link import TCLink | |
| from mininet.util import dumpNodeConnections | |
| from mininet.log import setLogLevel | |
| from mininet.node import RemoteController | |
| # hosts connections |
This file contains hidden or 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
| # original PoC: http://pastebin.com/raw.php?i=ypURDPc4 | |
| ''' | |
| ___. .___ __ __ | |
| \_ |__ ____ ___.__. ____ ____ __| _// |________ __ __ _______/ |_ | |
| | __ \_/ __ < | |/ _ \ / \ / __ |\ __\_ __ \ | \/ ___/\ __\ | |
| | \_\ \ ___/\___ ( <_> ) | \/ /_/ | | | | | \/ | /\___ \ | | | |
| |___ /\___ > ____|\____/|___| /\____ | |__| |__| |____//____ > |__| | |
| \/ \/\/ \/ \/ \/ | |
| MS15-034 Checker |
This file contains hidden or 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
| var EthernetAddr = require("./ethernet_addr"); | |
| var IPv4Addr = require("./ipv4_addr"); | |
| // DHCP packet parser | |
| // RFC 2131 | |
| // DHCP packet format | |
| // 0 1 2 3 | |
| // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |
| // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
| // | op (1) | htype (1) | hlen (1) | hops (1) | |
This file contains hidden or 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 ryu.base import app_manager | |
| from ryu.controller import ofp_event | |
| from ryu.controller.handler import CONFIG_DISPATCHER | |
| from ryu.controller.handler import set_ev_cls | |
| class DeleteAll(app_manager.RyuApp): | |
| def __init__(self, *args, **kwargs): | |
| super(DeleteAll, self).__init__(*args, **kwargs) |
This file contains hidden or 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
| var request = require('request'); | |
| var config = require('./config'); | |
| module.exports = { | |
| startPkt: function() { | |
| dpid = config.dpid; | |
| urlApi = 'http://127.0.0.1:8080/packetgen/start/' + dpid; | |
| request(urlApi, function(error, response, body) { | |
| if (!error && response.statusCode == 200) { |
This file contains hidden or 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
| def fizzbuzz(num, &strategy) | |
| arr = [] | |
| 1.upto(num) do |i| | |
| if i % 5 == 0 and i % 3 == 0 | |
| arr.push("FizzBuzz") | |
| if strategy | |
| yield 'FizzBuzz' | |
| end | |
| elsif i % 3 == 0 | |
| arr.push("Fizz") |
This file contains hidden or 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
| if ARGV[1].nil? | |
| print 'Insert the name of your output file (tsv file) ' | |
| outname = $stdin.gets.chomp | |
| else | |
| outname = ARGV[1] | |
| end | |
| # Deserialize | |
| require 'yaml' | |
| survey = YAML.load(File.read(ARGV[0])) | |
| # Create the TSV file |
This file contains hidden or 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
| # Check the output file | |
| if ARGV[1].nil? | |
| print 'Insert the name of your output file (yml file) ' | |
| outname = $stdin.gets.chomp | |
| else | |
| outname = ARGV[1] | |
| end | |
| # Build the array of Hashes | |
| require 'yaml' | |
| survey = [] |
This file contains hidden or 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
| require 'minitest/autorun' | |
| require './short_string_packer' | |
| def random_string | |
| [*'a'..'z'].sample(rand(1..12)).join | |
| end | |
| test_cases = %w(a z asdf abcdefghijkl aaaaaazzzzzz) | |
| describe 'Test whether packing methods are valid' do |