Skip to content

Instantly share code, notes, and snippets.

View shurane's full-sized avatar

Ehtesh Choudhury shurane

  • Astoria, NY | Seattle, WA
  • 12:28 (UTC -07:00)
View GitHub Profile
@shurane
shurane / install.python.sh
Last active August 29, 2015 13:56 — forked from pithyless/gist:1208841
Python installation instructions
#!/usr/bin/env bash
##Install python, assuming you already have homebrew: http://brew.sh/
brew install readline sqlite gdbm
brew install python --universal
python --version ##Python 2.7
##Install PIP
easy_install pip
@shurane
shurane / whatsapp_decrypt.py
Created May 27, 2014 21:56
just individual files at Bas Bosschert's decryption of Whatsapp: http://bas.bosschert.nl/steal-whatsapp-database/
#!/usr/bin/env python
import sys
from Crypto.Cipher import AES
try:
wafile=sys.argv[1]
except:
print "Usage: %s <msgstore.db.crypt>" % __file__
sys.exit(1)
@shurane
shurane / ls_cannot_access.yml
Last active August 29, 2015 14:02
stderr: /bin/ls: cannot access >/tmp/ls_output: No such file or directory
---
- hosts: logstash
sudo: True
user: root
tasks:
- name: update logstash.conf
command: /bin/true
notify: do nothing
handlers:
@shurane
shurane / tim_pearson_apache.conf
Created June 20, 2014 17:22
apache log with https and virtualhost logging
input {
generator {
type => "generated"
message => '127.0.0.1 - - [16/Jun/2014:06:25:16 -0400] "POST /this/is/a/sample/path.php HTTP/1.1" 200 3891 "https://www.example.com/foo/bar/qux/baz.php?f=file&active=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:25.0) Gecko/20100101 Firefox/25.0" on www.example.com'
count => 1
}
}
filter {
grok {
@shurane
shurane / casper_thrane_url_split.conf
Last active August 29, 2015 14:03
multiple logstash.confs
input {
generator {
type => "generated"
message => 'http://www.elasticsearch.org/blog/series-c-financing-sharing-fruit-labors/?example=yes&kv=true&style=elk'
count => 1
}
}
filter {
# If you want to chomp off the http:// URI portion:
logstash elasticsearch
1.4.2 1.1.1
1.4.1 1.1.1
1.4.0 1.0.1
1.3.3 0.90.9
1.3.2 0.90.9
1.3.1 0.90.9
1.1.10 0.20.5
1.1.9 0.20.2
@shurane
shurane / culprit.json
Last active August 29, 2015 14:04
CURL -XPOST requests to Elasticsearch.
{ "@fields": { "args": [ "filename", { "title": "that" } ] } }
@shurane
shurane / Vagrantfile
Last active August 29, 2015 14:04
Basic logstash conf
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.network :forwarded_port, guest: 9200, host: 9200
config.vm.network :forwarded_port, guest: 9300, host: 9300
config.vm.network :forwarded_port, guest: 9201, host: 9201
@shurane
shurane / app.json
Created September 4, 2014 02:21
PM2 managing arbitrary binaries. Thanks @ravi and pm2 issue #471!
[{
"name" : "redis-server",
"script": "/usr/local/bin/redis-server",
"instances" : 1,
"out_file" : "redis-server.log",
"error_file" : "redis-server.error",
"exec_interpreter" : "none",
"exec_mode" : "fork_mode"
}, {
"name" : "mongod",
@shurane
shurane / mysql_graphite
Created September 11, 2014 18:37
centos 5.x sysvinit script
#!/bin/bash
#
# mysql_graphite Script to output mysql stats to graphite
#
# Author: Ehtesh Choudhury/Aaron Kaplan
#
# chkconfig: - 90 10
# description: Starts and stops mysql_graphite logging.
# Based off of /etc/init.d/psacct