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
| # https://sites.google.com/site/jimmyxu101/testing/use-tcpdump-to-monitor-http-traffic | |
| tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 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
| server_url= "http://127.0.0.1:4723/wd/hub" | |
| driver = Selenium::WebDriver.for(:remote, :desired_capabilities => { | |
| platform: 'Mac', | |
| app: 'safari', | |
| device: 'iPad Simulator', | |
| # version: '7.0', | |
| }, | |
| :url => server_url ) |
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
| Nokogiri::CSS.xpath_for('#foo') |
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
| tell application "System Events" to tell process "iPhone Simulator" | |
| tell application "iPhone Simulator" to activate | |
| delay 1 | |
| tell window "iOS Simulator - iPad Retina / iOS 7.1 (11D167)" | |
| --get the name of window 1 | |
| --get every window | |
| click button 8 | |
| --get every button |
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
| # View the messages sent to the websocket | |
| # https://developers.google.com/chrome-developer-tools/docs/debugger-protocol | |
| # | |
| _old_send = function(msg) { console.log(msg); console.log(" "); WebInspector.socket.send(msg); }; | |
| InspectorFrontendHost.sendMessageToBackend = _old_send; | |
| WebInspector.socket.onmessage = function(message) { console.log(message.data); console.log(" "); InspectorBackend.dispatch(message.data); }; | |
| Sent: |
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
| # http://git-scm.com/book/en/Git-Basics-Undoing-Things | |
| # Undo a merge | |
| git revert -m 1 commit_hash |
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
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
| Capture HTTP Headers | |
| sudo tcpdump -l -s0 -w - tcp dst port 80 | strings |
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
| Show the active interface: | |
| ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active' | |
| List All Network Services with information which interface they use: | |
| sudo networksetup -listnetworkserviceorder | |
| To set the Proxy: | |
| sudo networksetup -setwebproxystate "Wi-Fi" off | |
| sudo networksetup -setwebproxy "Wi-Fi" 127.0.0.1 8080 |
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 sys | |
| import cStringIO | |
| from PIL import Image | |
| from libmproxy.protocol.http import decoded | |
| def response(context, flow): | |
| content_type = flow.response.headers.get_first("content-type", "") | |
| sys.stdout.write("Content Type: "+ content_type +"\n\n") | |
| if content_type.startswith("text"): | |
| sys.stdout.write("Response Content: "+ flow.response.content +"\n\n") |