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)
@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'
@rajiv
rajiv / resend.sh
Created April 28, 2017 18:28
resend failed nullmailer messages
find /var/spool/nullmailer/failed -type f | while read ln; do nullmailer-queue < $ln; done
@rajiv
rajiv / # testssl - 2017-09-27_16-48-16.txt
Created September 27, 2017 20:52
testssl on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for testssl on macOS 10.12.6
Build date: 2017-09-27 16:48:16
@rajiv
rajiv / out.log
Created February 13, 2018 16:46
pacmatic upgrade
# pacmatic -Syu
Recent ML chatter:
:: Synchronizing package databases...
core is up to date
extra 1612.6 KiB 1359K/s 00:01 [##################################] 100%
community 4.1 MiB 1574K/s 00:03 [##################################] 100%
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...