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
| #!/usr/bin/env python | |
| #coding=utf-8 | |
| import json | |
| import sys | |
| import re | |
| config = {} | |
| General = {} | |
| Proxy = {} | |
| Rule = {} |
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
| import Foundation | |
| import Darwin | |
| class DNSPacket: NSObject { | |
| var identifier:UInt16 = 0 | |
| var queryDomains:[String] = [] | |
| var rawData:NSData | |
| // override init() { | |
| // | |
| // } |
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 __future__ import print_function | |
| import websocket | |
| import ssl | |
| import thread | |
| import time | |
| import sys | |
| import threading, time, random | |
| count = 0 | |
| class Counter(threading.Thread): |
This file has been truncated, but you can view the full 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
| 2015-12-31 23:50:14.169 TunServerUI[48611:1598382] ServerTunnel.swift.startListeningOnPort[56]:Starting network service on port 8890 | |
| 2015-12-31 23:50:14.920 TunServerUI[48611:1598353] ServerTunnel.swift.netServiceDidPublish[328]:Network service published successfully | |
| 2015-12-31 23:50:21.078 TunServerUI[48611:1598353] ServerTunnel.swift.netService(_:didAcceptConnectionWithInputStream:outputStream:)[333]:Accepted a new connection | |
| 2015-12-31 23:50:21.084 TunServerUI[48611:1598353] ServerTunnel.swift.handleConnectionOpen[142]:["tunnel-type": 1, "command": 6, "identifier": 2900739254] | |
| 2015-12-31 23:50:21.085 TunServerUI[48611:1598353] AddressPool.swift.allocateAddress()[83]:Allocated address Optional("240.0.0.1") | |
| 2015-12-31 23:50:21.086 TunServerUI[48611:1598353] Tunnel.swift.serializeMessage[174]:messageProperties identifier Optional(2900739254) | |
| 2015-12-31 23:50:21.466 TunServerUI[48611:1598353] /var/root/Library/Group Containers/745WQDK4L7.com.yarshure.Surf/Library/Application Support/Log | |
| 2015/12/31 23:50:21.466 |
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
| // | |
| // ViewController.swift | |
| // testgcdt | |
| // | |
| // Created by yarshure on 16/1/11. | |
| // Copyright © 2016年 yarshure. All rights reserved. | |
| // | |
| import Cocoa |
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
| let target = "1.1.7" | |
| let romver = "1.1.23" | |
| if romver.compare(target, options: NSStringCompareOptions.NumericSearch, range: nil, locale: nil) == NSComparisonResult.OrderedDescending { | |
| print("abc") | |
| }else { | |
| print("def") | |
| } |
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
| import Darwin | |
| import Foundation | |
| let ipString = "2001:0b28:f23f:f005:0000:0000:0000:000a" | |
| func test(ipString:String) ->NSData?{ | |
| var addr = in6_addr() | |
| let retval = withUnsafeMutablePointer(&addr) { | |
| inet_pton(AF_INET6, ipString, UnsafeMutablePointer($0)) | |
| } | |
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
| func getIFAddresses() -> [String:String] { | |
| var addresses = [String:String]() | |
| //let d0 = NSDate() | |
| // Get list of all interfaces on the local machine: | |
| var ifaddr : UnsafeMutablePointer<ifaddrs> = nil | |
| if getifaddrs(&ifaddr) == 0 { | |
| // For each interface ... | |
| var ptr = ifaddr | |
| while( ptr != nil) { |
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
| let base64Encoded = proxy.base64String() | |
| let stringData = base64Encoded.data(using: .utf8, allowLossyConversion: false) | |
| let filter = CIFilter(name: "CIQRCodeGenerator") | |
| guard let f = filter else { | |
| return | |
| } | |
| f.setValue(stringData, forKey: "inputMessage") | |
| f.setValue("M", forKey: "inputCorrectionLevel") | |
| guard let image = f.outputImage else { |
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
| let base64Encoded = base64String | |
| let stringData = base64Encoded.data(using: .utf8, allowLossyConversion: false) | |
| let filter = CIFilter(name: "CIQRCodeGenerator") | |
| guard let f = filter else { | |
| return | |
| } | |
| f.setValue(stringData, forKey: "inputMessage") | |
| f.setValue("M", forKey: "inputCorrectionLevel") | |
| guard let image = f.outputImage else { |