Skip to content

Instantly share code, notes, and snippets.

View aaronpk's full-sized avatar

Aaron Parecki aaronpk

View GitHub Profile
$ irb
require 'mechanize'
agent = Mechanize.new {|agent| agent.user_agent_alias = "Mac Safari"}
scraper = agent.get 'https://www.brid.gy/like/twitter/aaronpk/418251719303495680/14447132' # works
scraper = agent.get 'https://www.brid.gy/like/googleplus/109182513536739786206/z12detsbpu2egrgfg223hzqw3xiuwlazj04/116247173913852395530' # fails
> OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A
scraper = agent.get 'https://www.brid.gy/like/twitter/aaronpk/418251719303495680/14447132' # fails
@aaronpk
aaronpk / api.rb
Created January 6, 2014 07:28
example of mixing jsonatra with Sinatra
class API < Jsonatra::Base
get '/' do
{
hello: 'world'
}
end
end
USD 210000
USD 155000
USD 132000
USD 130000
USD 125000
USD 115000
USD 113000
USD 112000
USD 109000
USD 108000

Keybase proof

I hereby claim:

  • I am aaronpk on github.
  • I am aaronpk (https://keybase.io/aaronpk) on keybase.
  • I have a public key whose fingerprint is C0A3 39C1 6254 377A 2536 CF2E 3745 E500 B4FF 7CB1

To claim this, I am signing this object:

## Install base packages
sudo apt-get update
sudo apt-get install git build-essential make bison flex gcc patch autoconf locate libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpq-dev libpq5 curl cmake libaio-dev libjpeg-dev libpng-dev libgif-dev libfreetype6 libfreetype6-dev imagemagick libmagickwand-dev libyaml-dev libffi-dev libreadline-gplv2-dev libxslt-dev libsqlite3-dev traceroute lynx htop
## Install MySQL
@aaronpk
aaronpk / nginx.conf
Created March 11, 2014 23:22
Upstart script for nginx
# nginx
description "nginx http daemon"
author "George Shammas <georgyo@gmail.com>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/nginx/sbin/nginx
env PID=/usr/local/nginx/logs/nginx.pid
@aaronpk
aaronpk / metrics.conf
Created March 17, 2014 16:28
upstart script for metrics node.js server
description "node.js server"
start on startup
stop on shutdown
respawn
script
export HOME="/home/ubuntu"
echo $$ > /var/run/metrics.pid
@aaronpk
aaronpk / gist:9863262
Created March 29, 2014 21:21
Instagram API error when posting comments from a non-whitelisted app.
{
"meta": {
"error_type": "APIError",
"code": 400,
"error_message": "Please visit http://bit.ly/instacomments for commenting access"
}
}
aaronpk@pk ~/Code: curl -i http://bret.io
HTTP/1.1 302 Found
Connection: close
Pragma: no-cache
cache-control: no-cache
Location: /
aaronpk@pk ~/Code:
{
"items": [],
"rels": {},
"http": {
"status": 410
}
}