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
#!/bin/bash | |
wget http://chromedriver.storage.googleapis.com/2.16/chromedriver_linux64.zip | |
unzip chromedriver_linux64.zip | |
sudo chmod +x chromedriver | |
sudo chown root:root chromedriver | |
sudo mv chromedriver /usr/local/bin | |
wget http://chrome.richardlloyd.org.uk/install_chrome.sh | |
chmod u+x install_chrome.sh |
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
To enable PHP in Apache add the following to httpd.conf and restart Apache: | |
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so | |
The php.ini file can be found in: | |
/usr/local/etc/php/5.6/php.ini | |
✩✩✩✩ PEAR ✩✩✩✩ | |
If PEAR complains about permissions, 'fix' the default PEAR permissions and config: | |
chmod -R ug+w /usr/local/Cellar/php56/5.6.12/lib/php |
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
Selected config: | |
Port : 6379 | |
Config file : /etc/redis/6379.conf | |
Log file : /var/log/redis_6379.log | |
Data dir : /var/lib/redis/6379 | |
Executable : /usr/local/bin/redis-server | |
Cli Executable : /usr/local/bin/redis-cli | |
Is this ok? Then press ENTER to go on or Ctrl-C to abort. | |
Copied /tmp/6379.conf => /etc/init.d/redis_6379 |
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") |
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
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
# 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
# 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
# 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
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 |