Skip to content

Instantly share code, notes, and snippets.

View rajiv's full-sized avatar

Rajiv Aaron Manglani rajiv

View GitHub Profile
@rajiv
rajiv / gist:957181
Created May 5, 2011 14:51
version control info in your bash shell prompt
# based on http://pastie.org/230805
# http://gist.github.com/3829/
# http://pastie.org/1868906
# from http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
_bold=$(tput bold)
_normal=$(tput sgr0)
__vcs_dir() {
local vcs base_dir sub_dir ref
@rajiv
rajiv / export_apple_mail_prev_recipients.sh
Last active December 16, 2015 07:28
export apple mail previous recipients to a csv file.
echo 'first name,last name,email' > ~/recent.csv
sqlite3 -csv ~/Library/Application\ Support/AddressBook/MailRecents-v4.abcdmr 'select ZFIRSTNAME, ZLASTNAME, ZEMAIL from ZABCDMAILRECENT;' >> ~/recent.csv
require 'net/http'
uri = URI('https://www.googleapis.com/oauth2/v1/userinfo')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
puts http.get(uri.request_uri)
Interval Since Last Panic Report: 43 sec
Panics Since Last Report: 1
Anonymous UUID: 1FA4ED44-FBAF-03E9-2FB5-0DF656D8EF90
Anonymous UUID: 1FA4ED44-FBAF-03E9-2FB5-0DF656D8EF90
Thu Oct 24 16:42:42 2013
panic(cpu 3 caller 0xffffff80134b8945): Kernel trap at 0xffffff7f953c91d4, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x0000000000000010, CR3: 0x00000000049d3000, CR4: 0x0000000000000660
RAX: 0x0000000000000001, RBX: 0xffffff817fa51000, RCX: 0xffffff8031fd7d98, RDX: 0xffffff81abbaba38
@rajiv
rajiv / pg-9.2.sh
Last active December 27, 2015 10:29 — forked from darkofabijan/pg-9.2.sh
build commands to run postgres 9.2 on semaphoreapp.com.
sudo apt-get remove -y postgresql-client-9.3 postgresql-9.3 postgresql-contrib-9.3 postgresql-server-dev-9.3
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
echo " deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y --force-yes install postgresql-9.2 postgresql-contrib-9.2
sudo su - postgres -c "pg_dropcluster --stop 9.2 main"
sudo su - postgres -c "pg_createcluster --start -e UTF-8 9.2 main"
sudo su - postgres -c "psql -c \"CREATE USER runner WITH PASSWORD 'semaphoredb';\" -d template1"
sudo su - postgres -c "psql -c \"ALTER USER runner CREATEUSER CREATEDB;\" -d template1"
$ curl -v 'https://graph.facebook.com/669029534/picture' -H 'dnt: 1' -H 'accept-encoding: gzip,deflate,sdch' -H 'accept-language: en-US,en;q=0.8' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.76 Safari/537.36' -H 'accept: image/webp,*/*;q=0.8' --compressed
* Adding handle: conn: 0x7f8d00803a00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7f8d00803a00) send_pipe: 1, recv_pipe: 0
* About to connect() to graph.facebook.com port 443 (#0)
* Trying 31.13.74.128...
* Connected to graph.facebook.com (31.13.74.128) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA

Keybase proof

I hereby claim:

  • I am rajiv on github.
  • I am rajiv (https://keybase.io/rajiv) on keybase.
  • I have a public key whose fingerprint is 0A86 FC80 20B6 CDA3 B48D 4875 9EDD 2FD3 302A 3876

To claim this, I am signing this object:

@rajiv
rajiv / Gemfile
Created April 13, 2015 23:31
static websites on heroku
source 'https://rubygems.org'
gem 'rack-contrib'
gem 'rack-rewrite'
gem 'thin'
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
98:13:f4:75:13:e5:75:0b:43:e7:43:1e:97:1e:44:bd
Signature Algorithm: sha256WithRSAEncryption
Issuer: O=Digital Signature Trust Co., CN=DST Root CA X3
Validity
Not Before: Oct 19 22:33:36 2015 GMT
Not After : Oct 19 22:33:36 2020 GMT
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
c3:83:4c:98:c0:bd:6b:25:2c:a3:79:b6:6f:a5:2b:0e
Signature Algorithm: sha256WithRSAEncryption
Issuer: O=Digital Signature Trust Co., CN=DST Root CA X3
Validity
Not Before: Oct 19 22:35:01 2015 GMT
Not After : Oct 19 22:35:01 2020 GMT