Skip to content

Instantly share code, notes, and snippets.

@holydevil
holydevil / get-pnr-status.php
Created August 20, 2011 12:43
Get PNR status using Alagu's API
<?php
error_reporting(1);
//$url = "http://pnrapi.alagu.net/api/v1.0/pnr/6359817259?jsonp=parseJSON";
$url = "http://pnrapi.alagu.net/api/v1.0/pnr/6359817259";
$ch = curl_init($url);
//curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
@holydevil
holydevil / yql-finance-quotes.php
Created August 20, 2011 14:55
YQL for Finance quotes
<h2>Using YQL to Finance quotes</h2>
<?php
$BASE_URL = "https://query.yahooapis.com/v1/public/yql";
// Form YQL query and build URI to YQL Web service
$yql_query = "select * from yahoo.finance.quotes where symbol in ('YHOO', 'APPL')";
$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&env=store://datatables.org/alltableswithkeys&format=json";
@holydevil
holydevil / hack.sh
Created August 21, 2012 14:20 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@holydevil
holydevil / ssh_tips
Created March 31, 2013 11:21
Fix for "Too many authentication failures for <username>" on hostgator
ssh -o PubkeyAuthentication=no user@hostname
@holydevil
holydevil / chrome-settings
Created April 1, 2013 10:19
Chrome hacks
chrome://histograms/DNS
@holydevil
holydevil / gist:5390174
Created April 15, 2013 18:24
Curl request data log
curl --trace-ascii data.log --trace-time <url>
$ git commit --amend --reset-author (Changes the most recent commit message + author in this case)
@holydevil
holydevil / gist:7312372
Created November 5, 2013 01:28
tcpdump to list HTTP requests source: http://stackoverflow.com/a/16610385
man tcpdump | less -Ip examples
# tcpdump filter for HTTP GET
sudo tcpdump -s 0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'
# tcpdump filter for HTTP POST
sudo tcpdump -s 0 -A 'tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)'
# monitor HTTP traffic including request and response headers and message body
# cf. https://sites.google.com/site/jimmyxu101/testing/use-tcpdump-to-monitor-http-traffic
@holydevil
holydevil / ymail-wpt
Created January 31, 2014 02:51
wpt script for yahoo mail logged in user
logData 0
// bring up the login screen
navigate https://mail.yahoo.com/
logData 1
// log in
setValue name=login loginid
setValue name=passwd password